Package com.yahoo.search.intent.model
Class IntentModel
- java.lang.Object
-
- com.yahoo.search.intent.model.Node
-
- com.yahoo.search.intent.model.ParentNode<InterpretationNode>
-
- com.yahoo.search.intent.model.IntentModel
-
- All Implemented Interfaces:
java.lang.Comparable<Node>
public class IntentModel extends ParentNode<InterpretationNode>
This is the root node of an intent model. The intent model represents the intent analysis of a query. This is a probabilistic model - the query may have multiple interpretations with different probability. Each interpretation may have multiple possible intents, making this a tree.- Author:
- bratseth
-
-
Field Summary
Fields Modifier and Type Field Description static com.yahoo.processing.request.CompoundName
intentModelObjectName
The name of the property carrying the intent model object: IntentModelstatic com.yahoo.processing.request.CompoundName
intentModelStringName
The name of the property carrying the intent model string: intentModel
-
Constructor Summary
Constructors Constructor Description IntentModel()
Creates an empty intent modelIntentModel(Interpretation... interpretations)
Creates an intent model from some interpretationsIntentModel(java.util.List<Interpretation> interpretations)
Creates an intent model from some interpretations
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IntentModel
getFrom(Query query)
Returns the intent model stored at property key "intentModel" in this query, or null if nonejava.util.List<java.lang.String>
getSourceNames()
Returns the names of the sources returned fromgetSources()
for conveniencejava.util.List<SourceNode>
getSources()
Returns a flattened list of sources with a normalized appropriateness of each, sorted by decreasing appropriateness.void
setTo(Query query)
Stores this intent model at property key "intentModel" in this queryvoid
sortChildren()
Sort interpretations by descending score order-
Methods inherited from class com.yahoo.search.intent.model.ParentNode
children
-
-
-
-
Field Detail
-
intentModelStringName
public static final com.yahoo.processing.request.CompoundName intentModelStringName
The name of the property carrying the intent model string: intentModel
-
intentModelObjectName
public static final com.yahoo.processing.request.CompoundName intentModelObjectName
The name of the property carrying the intent model object: IntentModel
-
-
Constructor Detail
-
IntentModel
public IntentModel()
Creates an empty intent model
-
IntentModel
public IntentModel(java.util.List<Interpretation> interpretations)
Creates an intent model from some interpretations
-
IntentModel
public IntentModel(Interpretation... interpretations)
Creates an intent model from some interpretations
-
-
Method Detail
-
sortChildren
public void sortChildren()
Sort interpretations by descending score order
-
getSources
public java.util.List<SourceNode> getSources()
Returns a flattened list of sources with a normalized appropriateness of each, sorted by decreasing appropriateness. This is obtained by summing the source appropriateness vectors of each intent node weighted by the owning intent and interpretation probabilities. Sources with a resulting probability of 0 is omitted in the returned list.
-
getSourceNames
public java.util.List<java.lang.String> getSourceNames()
Returns the names of the sources returned fromgetSources()
for convenience
-
getFrom
public static IntentModel getFrom(Query query)
Returns the intent model stored at property key "intentModel" in this query, or null if none
-
setTo
public void setTo(Query query)
Stores this intent model at property key "intentModel" in this query
-
-