public class RelevancyModel extends Object implements Iterable<RelevancyModel.FeatureWeight>, Comparable<RelevancyModel>, Serializable, Cloneable
The model for applying weights and scoring features
specified on a QueryRequest
.
EXPERIMENTAL: this class is expected to change in incompatible ways.
Modifier and Type | Class and Description |
---|---|
static class |
RelevancyModel.FeatureWeight |
static class |
RelevancyModel.Source |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_HISTORY |
static long |
DEFAULT_MAX_SIGNAL_AGE |
static String |
RELEVANCY_MODEL_WARNING |
Constructor and Description |
---|
RelevancyModel() |
RelevancyModel(String name) |
RelevancyModel(String name,
long version) |
Modifier and Type | Method and Description |
---|---|
void |
addWeight(String feature,
float weight) |
RelevancyModel |
clone() |
int |
compareTo(RelevancyModel other) |
boolean |
equals(Object other) |
double |
getAccuracy()
Get the computed accuracy for a trained relevancy model.
|
static String |
getBaseName(String query)
Get the relevancy model name for a query.
|
Set<String> |
getFeatureBlacklist()
Get the names of the features to exclude from relevancy model training data.
|
Set<String> |
getFeatureWhitelist()
Get the names of the features to use for training relevancy model.
|
long |
getLastModified()
Get the timestamp for the last modification to this relevancy model
|
int |
getMaxHistory()
Get the maximum number of trained relevancy models to retain.
|
long |
getMaxSignalAge()
Get maximum age for a signal to include when training relevancy model (in milliseconds).
|
String |
getName() |
String |
getOption(String name)
Get an option by name.
|
Map<String,String> |
getOptions()
Get options to use for training relevancy model.
|
double |
getPublishThreshold()
Get the accuracy threshold needed to be achieved to automatically publish a trained relevancy model.
|
String |
getQueryString()
Get a query string for explicitly selecting this relevancy model.
|
static String |
getQueryString(String name,
long version)
Get a query string for explicitly selecting this relevancy model.
|
Set<String> |
getSignalTypes()
Get the signal types to use when training relevancy model.
|
RelevancyModel.Source |
getSource() |
long |
getVersion() |
static long |
getVersion(String query)
Get the version for a relevancy model query.
|
List<RelevancyModel.FeatureWeight> |
getWeights() |
int |
hashCode() |
static boolean |
isBaseName(String query)
Returns
true if query is a base relevancy model name. |
Iterator<RelevancyModel.FeatureWeight> |
iterator() |
void |
setAccuracy(double value)
Set the computed accuracy for a trained relevancy model.
|
void |
setFeatureBlacklist(Set<String> value)
Set the names of the features to exclude from relevancy model training data.
|
void |
setFeatureBlacklist(String... value)
Set the names of the features to exclude from relevancy model training data.
|
void |
setFeatureWhitelist(Set<String> value)
Set the names of the features to use for training relevancy model.
|
void |
setFeatureWhitelist(String... value)
Set the names of the features to use for training relevancy model.
|
void |
setLastModified(long value)
Get the timestamp for the last modification to this relevancy model
|
void |
setMaxHistory(int value)
Set the maximum number of trained relevancy models to retain.
|
void |
setMaxSignalAge(long value)
Set maximum age for a signal to include when training relevancy model (in milliseconds).
|
void |
setName(String value) |
void |
setOption(String name,
String value) |
void |
setOptions(Map<String,String> value)
Set options to use for training relevancy model.
|
void |
setPublishThreshold(double value)
Set the accuracy threshold needed to be achieved to automatically publish a trained relevancy model.
|
void |
setSignalTypes(Set<String> value)
Set the signal types to use when training relevancy model.
|
void |
setSignalTypes(String... value) |
void |
setSource(RelevancyModel.Source value) |
void |
setVersion(long value) |
void |
setWeights(List<RelevancyModel.FeatureWeight> value) |
String |
toString() |
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final String RELEVANCY_MODEL_WARNING
public static final int DEFAULT_MAX_HISTORY
public static final long DEFAULT_MAX_SIGNAL_AGE
public RelevancyModel()
public RelevancyModel(String name)
public RelevancyModel(String name, long version)
public String getName()
public void setName(String value)
public RelevancyModel.Source getSource()
public void setSource(RelevancyModel.Source value)
public long getVersion()
public void setVersion(long value)
public long getLastModified()
public void setLastModified(long value)
public String getQueryString()
public double getAccuracy()
Accuracy score will range between 0.0 and 100.0, indicating a percentage score.
Accuracy will only be populated for RelevancyModel.Source.TRAINED
relevancy models and will
be computed over the signal data used to train the model.
public void setAccuracy(double value)
Accuracy score will range between 0.0 and 100.0, indicating a percentage score.
Accuracy will only be populated for RelevancyModel.Source.TRAINED
relevancy models and will
be computed over the signal data used to train the model.
public double getPublishThreshold()
If this threshold is > 0.0 and the computed accuracy for the relevancy model is greater than this threshold, the relevancy model will be automatically published as part of training.
NOTE: only applies when relevancy model is being trained.
public void setPublishThreshold(double value)
If this threshold is > 0.0 and the computed accuracy for the relevancy model is greater than this threshold, the relevancy model will be automatically published as part of training.
NOTE: only applies when relevancy model is being trained.
public int getMaxHistory()
If greater than zero, upon successful training of this relevancy model, old trained relevancy models that are not published will be purged.
public void setMaxHistory(int value)
If greater than zero, upon successful training of this relevancy model, old trained relevancy models that are not published will be purged.
public long getMaxSignalAge()
If less than 1, signals will be included in training data regardless of age.
public void setMaxSignalAge(long value)
If less than 1, signals will be included in training data regardless of age.
public Set<String> getSignalTypes()
If null
all signal types will be included in training data.
public void setSignalTypes(Set<String> value)
If null
all signal types will be included in training data.
public void setSignalTypes(String... value)
public Set<String> getFeatureWhitelist()
If null
all available features not in getFeatureBlacklist()
will be included in training data.
public void setFeatureWhitelist(Set<String> value)
If no features are specified, all available features not in getFeatureBlacklist()
will be included in training data.
public void setFeatureWhitelist(String... value)
If no features are specified, all available features not in getFeatureBlacklist()
will be included in training data.
public Set<String> getFeatureBlacklist()
public void setFeatureBlacklist(Set<String> value)
public void setFeatureBlacklist(String... value)
public String getOption(String name)
Options are advanced arbitrary key/value pairs used for tuning the training of relevancy models.
public Map<String,String> getOptions()
Options are advanced arbitrary key/value pairs used for tuning the training of relevancy models.
public void setOptions(Map<String,String> value)
Options are advanced arbitrary key/value pairs used for tuning the training of relevancy models.
public List<RelevancyModel.FeatureWeight> getWeights()
public void setWeights(List<RelevancyModel.FeatureWeight> value)
public void addWeight(String feature, float weight)
public Iterator<RelevancyModel.FeatureWeight> iterator()
iterator
in interface Iterable<RelevancyModel.FeatureWeight>
public int compareTo(RelevancyModel other)
compareTo
in interface Comparable<RelevancyModel>
public RelevancyModel clone()
public static boolean isBaseName(String query)
true
if query
is a base relevancy model name.
Returns false
if query
contains a version specification.
public static String getBaseName(String query)
public static long getVersion(String query)
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.