lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yuki Yano (JIRA)" <>
Subject [jira] [Commented] (SOLR-11250) Add new LTR model which loads the model definition from the external resource
Date Mon, 28 Aug 2017 00:37:03 GMT


Yuki Yano commented on SOLR-11250:

Thank you for advising the patch!

bq. WrapperModel or WrappingModel or something like that might be alternatives. What do you

I agree with your opinion. Actually, {{ExternalModel}} is likely to cause misunderstanding.
I'll change the name of the base class.

bq. i.e. changes to it can be included in the same patch as the actual code changes.

Thanks for the information. I'll try creating a patch for the document.

bq. method it is now then also possible for custom (external) models to use a non-JSON format

That's a great idea! I think it is easy to extend our model to be able to consume non-JSON
format (e.g. xml, yaml, etc.) by using proper libraries. I'll try adding parser for these
formats and extending the model's parameters to something like below.

  "class" : "org.apache.solr.ltr.model.URIExternalModel",
  "name" : "modelZ",
  "params" : {
    "format": "xml",
    "uri" : "file:///var/models/modelF.xml"

> Add new LTR model which loads the model definition from the external resource
> -----------------------------------------------------------------------------
>                 Key: SOLR-11250
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: contrib - LTR
>            Reporter: Yuki Yano
>            Priority: Minor
>         Attachments: SOLR-11250_master.patch, SOLR-11250_master_v2.patch, SOLR-11250.patch
> We add new model which contains only the location of the external model and loads it
during the initialization.
> By this procedure, large models which are difficult to upload to ZooKeeper can be available.
> The new model works as the wrapper of existing models, and deligates APIs to them.
> We add two classes by this patch:
> * {{ExternalModel}} : a base class for models with external resources.
> * {{URIExternalModel}} : an implementation of {{ExternalModel}} which loads the external
model from specified URI (ex. file:, http:, etc.).
> For example, if you have a model on the local disk "file:///var/models/myModel.json",
the definition of {{URIExternalModel}} will be like the following.
> {code}
> {
>   "class" : "org.apache.solr.ltr.model.URIExternalModel",
>   "name" : "myURIExternalModel",
>   "features" : [],
>   "params" : {
>     "uri" : "file:///var/models/myModel.json"
>   }
> }
> {code}
> If you use LTR with {{model=myURIExternalModel}}, the model of {{myModel.json}} will
be used for scoring documents.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message