Skip to content

Commit

Permalink
Update transformers.md
Browse files Browse the repository at this point in the history
  • Loading branch information
omri374 authored Oct 16, 2024
1 parent 8446caf commit 036be37
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/analyzer/nlp_engines/transformers.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ The `ner_model_configuration` section contains the following parameters:
- `low_confidence_score_multiplier`: A multiplier to apply to the score of entities with low confidence.
- `low_score_entity_names`: A list of entity types to apply the low confidence score multiplier to.

> Note: To be able to create the `model_to_presidio_entity_mapping` dictionary, it is advised to check which classes the model is able to predict. This can be found on the huggingface hub site for the model in some cases. In other, one can check the model's `config.json` uner `id2label`. For example, for `bert-base-NER-uncased`, it can be found here: https://huggingface.co/dslim/bert-base-NER-uncased/blob/main/config.json. Note that most NER models add a prefix to the class (e.g. `B-PER` for class `PER`). When creating the mapping, do not add the prefix.

!!! note "Defining the entity mapping"
To be able to create the `model_to_presidio_entity_mapping` dictionary, it is advised to check which classes the model is able to predict.
This can be found on the huggingface hub site for the model in some cases. In other, one can check the model's `config.json` uner `id2label`.
For example, for `bert-base-NER-uncased`, it can be found here: https://huggingface.co/dslim/bert-base-NER-uncased/blob/main/config.json.
Note that most NER models add a prefix to the class (e.g. `B-PER` for class `PER`). When creating the mapping, do not add the prefix.


See more information on parameters on the [spacy-huggingface-pipelines Github repo](https://github.com/explosion/spacy-huggingface-pipelines#token-classification).
Expand Down

0 comments on commit 036be37

Please sign in to comment.