Named Entity Recognition
Overview
This node performs Named Entity Recognition (NER) on a given text input using a pre-trained Transformer model. It identifies and extracts entities such as persons, locations, organizations, and other named elements from the text. This is useful in scenarios like text analysis, information extraction, content categorization, or enhancing search capabilities by tagging key entities.
For example, given the input "N8N is a workflow automation tool based in Berlin, developed by Johannes and a great team," the node can extract entities like "N8N" (organization), "Berlin" (location), and "Johannes" (person).
Properties
| Name | Meaning |
|---|---|
| Input Text | The text string from which named entities will be extracted. Example: "N8N is a workflow automation tool based in Berlin..." |
| Aggregation Strategy | Strategy to group token parts into single entities. Options: None, Simple (recommended), First, Average, Max. "Simple" is often a good default. |
| Output Field Name | The name of the output field where the array of extracted entities will be stored. Default is "entities". |
Output
The node outputs an array of extracted entities under the specified output field name (default: entities). Each entity in the array typically includes details such as the entity text, its type (e.g., person, location), and possibly confidence scores depending on the underlying model.
If binary data were involved, it would be summarized here, but this node outputs only JSON data representing recognized entities.
Example output structure:
{
"entities": [
{
"entity": "ORG",
"score": 0.998,
"word": "N8N",
"start": 0,
"end": 3
},
{
"entity": "LOC",
"score": 0.995,
"word": "Berlin",
"start": 38,
"end": 44
},
{
"entity": "PER",
"score": 0.990,
"word": "Johannes",
"start": 57,
"end": 65
}
]
}
Dependencies
- Uses the
@huggingface/transformerslibrary via Transformers.js for running the NER pipeline. - Requires internet access or local availability of the
"Xenova/bert-base-NER"model to load the pre-trained NER model. - No explicit API keys or external service credentials are required.
- Runs within n8n environment with support for asynchronous execution and logging.
Troubleshooting
- Empty or missing input text: The node throws an error if the "Input Text" property is empty or contains only whitespace. Ensure you provide valid text input.
- Model loading failure: If the model fails to load (e.g., due to network issues or unavailable model), an error is thrown indicating failure to load the NER model. Check network connectivity or model availability.
- Unexpected output format: If the model returns data not in the expected array format, an error is raised. This could indicate a version mismatch or internal model issue.
- Continue on Fail: If enabled, errors during execution return an error message in the output JSON instead of stopping the workflow.