Token Classification
Transformers
Safetensors
French
bert
newsagency
ner
historical
impresso
multilingual
Instructions to use impresso-project/ner-newsagency-bert-fr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use impresso-project/ner-newsagency-bert-fr with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="impresso-project/ner-newsagency-bert-fr")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("impresso-project/ner-newsagency-bert-fr") model = AutoModelForTokenClassification.from_pretrained("impresso-project/ner-newsagency-bert-fr") - Notebooks
- Google Colab
- Kaggle
Update newsagency_ner.py
Browse files- newsagency_ner.py +1 -1
newsagency_ner.py
CHANGED
|
@@ -130,7 +130,7 @@ def get_entities(tokens, tags, confidences, text):
|
|
| 130 |
entities.append(
|
| 131 |
{
|
| 132 |
"entity": original_label,
|
| 133 |
-
"score": np.average(confidences[idx : idx + len(subtree)]),
|
| 134 |
"index": idx,
|
| 135 |
"word": original_string,
|
| 136 |
"start": entity_start_position,
|
|
|
|
| 130 |
entities.append(
|
| 131 |
{
|
| 132 |
"entity": original_label,
|
| 133 |
+
"score": np.round(np.average(confidences[idx : idx + len(subtree)]) * 100.0, 2),
|
| 134 |
"index": idx,
|
| 135 |
"word": original_string,
|
| 136 |
"start": entity_start_position,
|