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, "athena_label_lookup") – index to be searched

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

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

  • path (str, ".") – path

Methods Summary

process_doc(doc)

Process a document

process_entities(doc)

rtype

List[Intent]

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]