IntentDetector#

class IntentDetector(config)#

Bases: BatchedStep

Do intent detection

Parameters:
  • step (str, "app") – app

  • type (str, "query_processing") – query_processing

  • name (str, "intent_detector") – intent_detector

  • analyzed_input_field (str, "nlp") – analyzed spacy Doc

  • target_index_name (str, "") –

    index to be searched

    Deprecated since version 3.10.7: Target index name is now automatically detected from the pipeline

  • match_entity_as_phrase (list, ["PERSON", "PRODUCT", "FAC", "NORP","ORG", "GPE", "LOC"]) – list of NER tags that should be appended as a phrase query

  • match_entity_phrase_slop (int, 5) – Phrase slop that is applied for those auto-detected entities

  • match_entity_combine_operator (str, "OR") – If multiple entities are detected, should all of them match? OR / AND

  • label_lookup_match_ngram_field (bool, False) – [Label Retrieval] Enable matching ngram field (high recall)

  • label_lookup_fuzzy (bool, False) – [Label Retrieval] Enable fuzzy search (high recall)

  • label_lookup_prefix_queries (bool, False) – [Label Retrieval] Enable sub-query prefix queries (high recall)

  • label_lookup_most_common_rescoring (bool, True) – [Label Retrieval] Rescore matching label values by their respective overall doc–count (how often documents are tagged with this label)

  • label_match_rewrite_mode (str, "filter_query") – How to apply the detected label match: filter, boost, or rescore

  • label_match_combine_operator (str, "OR") – How to combine multiple label matches: OR / AND

  • label_match_category_weights (dict, {}) – Specify weight applied on the facet-filter, by type. Default is 10

  • label_lookup_rescore_parameters (dict, {}) – Specify rescoring parameters for ES label lookup

  • date_match_on_facet (str, "item_created_at") – What field to be used for date filtering

  • date_match_rewrite_mode (str, "filter_query") – How to apply the detected date match: filter, boost, or rescore

  • date_match_recency_per_category (dict, {}) – TODO: Mapping of recency boost profile for detected category (from label-match lookup)

  • source_match_rewrite_mode (str, "boost_query") – How to apply the detected source match: filter, boost, or rescore

  • path (str, ".") – path

Methods Summary

process_doc(doc)

Process a document

process_entities(doc)

Methods Documentation

process_doc(doc)#

Process a document

Parameters:

doc (Document) – Document

Returns:

Processed document

Return type:

Document

process_entities(doc)#
Return type:

List[Intent]