public class ScoringModel
extends org.apache.solr.ltr.model.AdapterModel
MultiLayerNetwork or
ComputationGraph model.
Example configuration (snippet):
{
"class" : "org.deeplearning4j.nn.modelexport.solr.ltr.model.ScoringModel",
"name" : "myModel",
"features" : [
{ "name" : "documentRecency", ... },
{ "name" : "isBook", ... },
{ "name" : "originalScore", ... }
],
"params" : {
"serializedModelFileName" : "mySerializedModel"
}
}
Apache Solr Reference Guide:
| Modifier and Type | Field and Description |
|---|---|
protected org.deeplearning4j.nn.api.Model |
model |
| Constructor and Description |
|---|
ScoringModel(String name,
List<org.apache.solr.ltr.feature.Feature> features,
List<org.apache.solr.ltr.norm.Normalizer> norms,
String featureStoreName,
List<org.apache.solr.ltr.feature.Feature> allFeatures,
Map<String,Object> params) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.lucene.search.Explanation |
explain(org.apache.lucene.index.LeafReaderContext context,
int doc,
float finalScore,
List<org.apache.lucene.search.Explanation> featureExplanations) |
void |
init(org.apache.solr.core.SolrResourceLoader solrResourceLoader) |
protected InputStream |
openInputStream() |
static float |
outputScore(org.deeplearning4j.nn.api.Model model,
float[] modelFeatureValuesNormalized)
Uses the
NetworkUtils.output(Model, INDArray) method. |
protected org.deeplearning4j.nn.api.Model |
restoreModel(InputStream inputStream)
Uses the
ModelGuesser.loadModelGuess(InputStream) method. |
float |
score(float[] modelFeatureValuesNormalized) |
void |
setSerializedModelFileName(String serializedModelFileName) |
protected void |
validate() |
protected void |
validateModel() |
public void setSerializedModelFileName(String serializedModelFileName)
public void init(org.apache.solr.core.SolrResourceLoader solrResourceLoader)
throws org.apache.solr.ltr.model.ModelException
init in class org.apache.solr.ltr.model.AdapterModelorg.apache.solr.ltr.model.ModelExceptionprotected InputStream openInputStream() throws IOException
IOExceptionprotected org.deeplearning4j.nn.api.Model restoreModel(InputStream inputStream) throws Exception
ModelGuesser.loadModelGuess(InputStream) method.Exceptionprotected void validate()
throws org.apache.solr.ltr.model.ModelException
validate in class org.apache.solr.ltr.model.LTRScoringModelorg.apache.solr.ltr.model.ModelExceptionprotected void validateModel()
throws org.apache.solr.ltr.model.ModelException
org.apache.solr.ltr.model.ModelExceptionpublic float score(float[] modelFeatureValuesNormalized)
score in class org.apache.solr.ltr.model.LTRScoringModelpublic static float outputScore(org.deeplearning4j.nn.api.Model model,
float[] modelFeatureValuesNormalized)
NetworkUtils.output(Model, INDArray) method.public org.apache.lucene.search.Explanation explain(org.apache.lucene.index.LeafReaderContext context,
int doc,
float finalScore,
List<org.apache.lucene.search.Explanation> featureExplanations)
explain in class org.apache.solr.ltr.model.LTRScoringModelCopyright © 2019. All rights reserved.