> For the complete documentation index, see [llms.txt](https://lauradang.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lauradang.gitbook.io/notes/machine-learning/rasa/optimizing-entity-recognition.md).

# Optimizing Entity Recognition

### SpaCy ([SpacyEntityExtractor](https://rasa.com/docs/rasa/nlu/components/#spacyentityextractor)) - `ner_spacy`

* Pretrained entity extractors
* Statistical BILOU transition model

### Duckling

* Number related information (dates, distance, duration)
* Run server on docker image [ner\_duckling](http://rasa.com/docs/rasa/nlu/components/#ducklinghttpextractor)

### NER\_CRF ([CRFEntityExtractor](https://rasa.com/docs/rasa/nlu/components/#crfentityextractor))

* trained from scratch
* Need to annotate training data yourself
* Annotate training examples EVERYWHERE in training data (even if entity is not relevant for intent)
* Use of lookup tables makes `ner_crf` prone to overfitting
  * If training data matches Regex or Lookup, it will ignore other features, so if you have message with entity that is not matched by Regex, `ner_crf` will not detect

## Common Problems

### Entities are not recognizing unseen values

* Could be:
  * Lack of training data
  * Overfitting of `ner_crf` (try training model without regex or look up)

### Map extracted entity to different value

* [ner\_synonyms](http://rasa.com/docs/rasa/nlu/components/#entitysynonymmapper)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lauradang.gitbook.io/notes/machine-learning/rasa/optimizing-entity-recognition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
