Class IntentModel

All Implemented Interfaces:
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 Details

    • 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 Details

    • IntentModel

      public IntentModel()
      Creates an empty intent model
    • IntentModel

      public IntentModel(List<Interpretation> interpretations)
      Creates an intent model from some interpretations
    • IntentModel

      public IntentModel(Interpretation... interpretations)
      Creates an intent model from some interpretations
  • Method Details

    • sortChildren

      public void sortChildren()
      Sort interpretations by descending score order
    • getSources

      public 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 List<String> getSourceNames()
      Returns the names of the sources returned from getSources() 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