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

**`class LanguageDetection(config)`**

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

Perform language detection on document.

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)`, ``"lang_detection"`) – lang_detection
- `input_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`,``"user_terms_str"`) – query
- `output_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`,``"language"`) – detected language as ISO code
- `fallback_language` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"en"`) – Default language to use
- `path` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``"."`) – path

Attributes SummaryMethods SummaryAttributes Documentation

**`MODEL_CACHE_KEY = 'fasttext_language_detector'`**

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