<!-- Source: https://docs.squirro.com/en/latest/api/squirro.lib.nlp.apps.query_processing.IntentDetector.html -->
# IntentDetector

**`class IntentDetector(config)`**

Bases: [`BatchedStep`](../technical/libnlp/steps/standard.md#squirro.lib.nlp.steps.batched_step.BatchedStep)

Do intent detection

Parameters

- `step` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"app"`) – app
- `type` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"query_processing"`) – query_processing
- `name` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"intent_detector"`) – intent_detector
- `analyzed_input_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"nlp"`) – analyzed spacy Doc
- `target_index_name` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#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`](https://docs.python.org/3.11/library/stdtypes.html#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`](https://docs.python.org/3.11/library/functions.html#int)`, ``5`) – Phrase slop that is applied for those auto-detected entities
- `match_entity_combine_operator` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"OR"`) – If multiple entities are detected, should all of them match? OR / AND
- `label_lookup_match_ngram_field` ([`bool`](https://docs.python.org/3.11/library/functions.html#bool)`, ``False`) – [Label Retrieval] Enable matching ngram field (high recall)
- `label_lookup_fuzzy` ([`bool`](https://docs.python.org/3.11/library/functions.html#bool)`, ``False`) – [Label Retrieval] Enable fuzzy search (high recall)
- `label_lookup_prefix_queries` ([`bool`](https://docs.python.org/3.11/library/functions.html#bool)`, ``False`) – [Label Retrieval] Enable sub-query prefix queries (high recall)
- `label_lookup_most_common_rescoring` ([`bool`](https://docs.python.org/3.11/library/functions.html#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`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"filter_query"`) – How to apply the detected label match: filter, boost, or rescore
- `label_match_combine_operator` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"OR"`) – How to combine multiple label matches: OR / AND
- `label_match_category_weights` ([`dict`](https://docs.python.org/3.11/library/stdtypes.html#dict)`, ``{}`) – Specify weight applied on the facet-filter, by type. Default is 10
- `label_lookup_rescore_parameters` ([`dict`](https://docs.python.org/3.11/library/stdtypes.html#dict)`, ``{}`) – Specify rescoring parameters for ES label lookup
- `date_match_on_facet` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"item_created_at"`) – What field to be used for date filtering
- `date_match_rewrite_mode` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"filter_query"`) – How to apply the detected date match: filter, boost, or rescore
- `date_match_recency_per_category` ([`dict`](https://docs.python.org/3.11/library/stdtypes.html#dict)`, ``{}`) – TODO: Mapping of recency boost profile for detected category (from label-match lookup)
- `source_match_rewrite_mode` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"boost_query"`) – How to apply the detected source match: filter, boost, or rescore
- `path` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"."`) – path
- `client_id` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``None`) – Squirro client id
- `client_secret` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``None`) – Squirro client secret
- `cluster` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – Squirro cluster
- `genai_api_url` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – Squirro GenAI API URL
- `token` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – Squirro token

Methods SummaryMethods Documentation

**`process_doc(doc)`**

Process a document

Parameters

`doc` ([`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)) – Document

Returns

Processed document

Return type

[Document](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)

**`process_entities(doc)`**

Return type

[`list`](https://docs.python.org/3.11/library/stdtypes.html#list)[`Intent`]
