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
Upload folder using huggingface_hub
Browse files- config.json +9 -0
- newsagency_ner.py +1 -1
config.json
CHANGED
|
@@ -5,6 +5,15 @@
|
|
| 5 |
],
|
| 6 |
"attention_probs_dropout_prob": 0.1,
|
| 7 |
"classifier_dropout": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
"gradient_checkpointing": false,
|
| 9 |
"hidden_act": "gelu",
|
| 10 |
"hidden_dropout_prob": 0.1,
|
|
|
|
| 5 |
],
|
| 6 |
"attention_probs_dropout_prob": 0.1,
|
| 7 |
"classifier_dropout": null,
|
| 8 |
+
"custom_pipelines": {
|
| 9 |
+
"newsagency-ner": {
|
| 10 |
+
"impl": "newsagency_ner.NewsAgencyModelPipeline",
|
| 11 |
+
"pt": [
|
| 12 |
+
"AutoModelForTokenClassification"
|
| 13 |
+
],
|
| 14 |
+
"tf": []
|
| 15 |
+
}
|
| 16 |
+
},
|
| 17 |
"gradient_checkpointing": false,
|
| 18 |
"hidden_act": "gelu",
|
| 19 |
"hidden_dropout_prob": 0.1,
|
newsagency_ner.py
CHANGED
|
@@ -210,7 +210,7 @@ class NewsAgencyModelPipeline(Pipeline):
|
|
| 210 |
:return:
|
| 211 |
"""
|
| 212 |
tokens_result, text_sentence, text = outputs
|
| 213 |
-
import pdb;pdb.set_trace()
|
| 214 |
# Get raw logits and convert to numpy array
|
| 215 |
logits = tokens_result["logits"].detach().cpu().numpy()
|
| 216 |
|
|
|
|
| 210 |
:return:
|
| 211 |
"""
|
| 212 |
tokens_result, text_sentence, text = outputs
|
| 213 |
+
# import pdb;pdb.set_trace()
|
| 214 |
# Get raw logits and convert to numpy array
|
| 215 |
logits = tokens_result["logits"].detach().cpu().numpy()
|
| 216 |
|