public class MockRelevancyModelApi extends Object implements RelevancyModelApi
DEFAULT_RELEVANCY_MODEL_NAME, NOOP_RELEVANCY_MODEL_NAME
Constructor and Description |
---|
MockRelevancyModelApi() |
Modifier and Type | Method and Description |
---|---|
void |
addFeature(RelevancyFeatureDef feature)
Add a
RelevancyFeatureDef . |
long |
addRelevancyModel(RelevancyModel model)
Create a new relevancy model.
|
void |
deleteFeature(String name)
Delete a
RelevancyFeatureDef with the specified name. |
void |
deleteRelevancyModel(String name,
long version)
Delete a relevancy model.
|
RelevancyModel |
findRelevancyModel(String... query)
Find a relevancy model given a query.
|
RelevancyFeatureDef |
getFeature(String name)
Get a
RelevancyFeatureDef by name . |
Iterable<RelevancyFeatureDef> |
getFeatures()
Get all features.
|
RelevancyModel |
getRelevancyModel(String name,
long version)
Get a specified version of a relevancy model.
|
List<String> |
getRelevancyModelNames()
Returns the names for all available relevancy models.
|
long |
getRelevancyModelPublishTime(String name,
long version)
Returns the time the specified relevancy model was published.
|
List<RelevancyModel> |
getRelevancyModels(String name)
Get all versions available for a relevancy model.
|
boolean |
isFeatureStatic(String name)
Returns
true if feature is statically defined. |
void |
publishRelevancyModel(String name,
long version)
Publish a relevancy model.
|
static String |
resolveKey(String baseName,
long version) |
void |
setRelevancyModels(Iterable<RelevancyModel> value) |
void |
setRelevancyModels(RelevancyModel... value) |
RelevancyModel |
testRelevancyModel(RelevancyModel model)
Test a relevancy model's accuracy according to stored signal data's expected output.
|
long |
trainRelevancyModel(RelevancyModel model)
Train a relevancy model according to signal data as specified by
model |
void |
updateFeature(RelevancyFeatureDef feature)
Update a
RelevancyFeatureDef . |
void |
updateRelevancyModel(RelevancyModel model)
Update an existing relevancy model.
|
public List<String> getRelevancyModelNames()
RelevancyModelApi
getRelevancyModelNames
in interface RelevancyModelApi
public RelevancyModel getRelevancyModel(String name, long version)
RelevancyModelApi
Returns null
if relevancy model does not exist.
getRelevancyModel
in interface RelevancyModelApi
public List<RelevancyModel> getRelevancyModels(String name)
RelevancyModelApi
getRelevancyModels
in interface RelevancyModelApi
public RelevancyModel findRelevancyModel(String... query)
RelevancyModelApi
Relevancy model names are matched case insensitive.
Returns the first available model specified in query
.
Query strings may include a version component in the format modelName#versionNumber to request a specific version. When version is not specified, the relevancy model returned will be the active version for the requested name.
Returns null
if no matching relevancy model found.
findRelevancyModel
in interface RelevancyModelApi
public RelevancyModel testRelevancyModel(RelevancyModel model)
RelevancyModelApi
Computing accuracy may take some time, depending on the volume of signal data being used.
NOTE: model
does not need to be a saved relevancy model.
For instance, you can test the relevancy model prior to adding/updating a model with new weights.
testRelevancyModel
in interface RelevancyModelApi
model
- A model to evaluate.public long trainRelevancyModel(RelevancyModel model)
RelevancyModelApi
model
Returns the version number for the newly created relevancy model.
Relevancy model created will initially have a source of RelevancyModel.Source.TRAINING
. Once training of the relevancy model is
complete, the source will be updated to be RelevancyModel.Source.TRAINED
.
trainRelevancyModel
in interface RelevancyModelApi
public long addRelevancyModel(RelevancyModel model)
RelevancyModelApi
Returns the version number for the newly created relevancy model.
addRelevancyModel
in interface RelevancyModelApi
public void updateRelevancyModel(RelevancyModel model)
RelevancyModelApi
Fails if relevancy model does not exist, or if the relevancy model is active.
updateRelevancyModel
in interface RelevancyModelApi
public void deleteRelevancyModel(String name, long version)
RelevancyModelApi
Fails if relevancy model does not exist, if the relevancy model's source is RelevancyModel.Source.STATIC
or if the model is active.
deleteRelevancyModel
in interface RelevancyModelApi
public void publishRelevancyModel(String name, long version)
RelevancyModelApi
Published relevancy models will be used for matching partial relevancy model names in
RelevancyModelApi.getRelevancyModel(String, long)
.
Fails if relevancy model does not exist.
publishRelevancyModel
in interface RelevancyModelApi
public long getRelevancyModelPublishTime(String name, long version)
RelevancyModelApi
Returns 0
if the relevancy model is not the published model.
Returns -1
if the model is the published model, but no time is associated with the publication.
getRelevancyModelPublishTime
in interface RelevancyModelApi
public Iterable<RelevancyFeatureDef> getFeatures()
RelevancyModelApi
Order of returned features is undefined. Returned features should not be modified in any way.
getFeatures
in interface RelevancyModelApi
public RelevancyFeatureDef getFeature(String name)
RelevancyModelApi
getFeature
in interface RelevancyModelApi
public boolean isFeatureStatic(String name)
RelevancyModelApi
true
if feature is statically defined.
Statically defined features cannot be updated or deleted.
isFeatureStatic
in interface RelevancyModelApi
public void addFeature(RelevancyFeatureDef feature)
RelevancyModelApi
RelevancyFeatureDef
.addFeature
in interface RelevancyModelApi
public void updateFeature(RelevancyFeatureDef feature)
RelevancyModelApi
RelevancyFeatureDef
.updateFeature
in interface RelevancyModelApi
public void deleteFeature(String name)
RelevancyModelApi
RelevancyFeatureDef
with the specified name.deleteFeature
in interface RelevancyModelApi
public void setRelevancyModels(RelevancyModel... value)
public void setRelevancyModels(Iterable<RelevancyModel> value)
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.