CustomRelevanceFunctionFactory crfFactory = ModelStorage.getPreloadedModel(modelName);
return crfFactory.build();
}
else if (ModelStorage.hasRuntimeModel(modelName))
{
RuntimeRelevanceFunctionFactory rrfFactory = ModelStorage.getRuntimeModel(modelName);
return rrfFactory.build();
}
else
{
throw new JSONException("No such model (CustomRelevanceFunctionFactory plugin) is registered: " + modelName);
}
}
// runtime anonymous model;
else if (jsonRelevance.has(RelevanceJSONConstants.KW_MODEL))
{
JSONObject modelJson = jsonRelevance.optJSONObject(RelevanceJSONConstants.KW_MODEL);
// build the model factory and one model;
// if the model factory needs to be saved, the factory will be used, otherwise, just return the model object (RuntimeRelevanceFunction);
RuntimeRelevanceFunctionFactory rrfFactory = (RuntimeRelevanceFunctionFactory) buildModelFactoryFromModelJSON(modelJson);
RuntimeRelevanceFunction sm = (RuntimeRelevanceFunction) rrfFactory.build();
//store the model if specified;
if(modelJson.has(RelevanceJSONConstants.KW_SAVE_AS))
{
// "save_as":{