Interface NCIntentMatch

    • Method Detail

      • getIntentId

        String getIntentId()
        Gets ID of the matched intent.
        Returns:
        ID of the matched intent.
      • getContext

        NCContext getContext()
        Gets context of the user input query.
        Returns:
        Original query context.
      • getIntentTokens

        List<List<NCToken>> getIntentTokens()
        Gets a subset of tokens representing matched intent. This subset is grouped by the matched terms where a null sub-list defines an optional term. Order and index of sub-lists corresponds to the order and index of terms in the matching intent. Number of sub-lists will always be the same as the number of terms in the matched intent.

        Note that unlike getVariant() method this method returns only subset of the tokens that were part of the matched intent. Specifically, it will not return tokens for free words, stopwords or unmatched ("dangling") tokens.

        Consider using NCIntentTerm annotation instead for simpler access to intent tokens.

        Returns:
        List of list of tokens representing matched intent.
        See Also:
        getVariant(), NCIntentTerm
      • getTermTokens

        List<NCToken> getTermTokens​(int idx)
        Gets tokens for given term. This is a companion method for getIntentTokens().

        Consider using NCIntentTerm annotation instead for simpler access to intent tokens.

        Parameters:
        idx - Index of the term (starting from 0).
        Returns:
        List of tokens, potentially null, for given term.
        See Also:
        NCIntentTerm, getTermTokens(String)
      • getTermTokens

        List<NCToken> getTermTokens​(String termId)
        Gets tokens for given term. This is a companion method for getIntentTokens().

        Consider using NCIntentTerm annotation instead for simpler access to intent tokens.

        Parameters:
        termId - ID of the term for which to get tokens.
        Returns:
        List of tokens, potentially null, for given term.
        See Also:
        NCIntentTerm, getTermTokens(int)
      • getVariant

        NCVariant getVariant()
        Gets sentence parsing variant that produced the matching for this intent. Returned variant is one of the variants provided by NCContext.getVariants() methods. Note that tokens returned by this method are a superset of the tokens returned by getIntentTokens() method, i.e. not all tokens from this variant may have been used in matching of the winning intent.
        Returns:
        Sentence parsing variant that produced the matching for this intent.
        See Also:
        getIntentTokens()