Token Classification
Transformers
PyTorch
TensorBoard
Safetensors
bert
named-entity-recognition
sequence-tagger-model
Instructions to use Babelscape/wikineural-multilingual-ner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Babelscape/wikineural-multilingual-ner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="Babelscape/wikineural-multilingual-ner")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("Babelscape/wikineural-multilingual-ner") model = AutoModelForTokenClassification.from_pretrained("Babelscape/wikineural-multilingual-ner", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Simone Tedeschi commited on
Commit ·
c981bc5
1
Parent(s): 4cc3026
added "how to use"
Browse files
README.md
CHANGED
|
@@ -46,10 +46,13 @@ You can use this model with Transformers *pipeline* for NER.
|
|
| 46 |
```python
|
| 47 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 48 |
from transformers import pipeline
|
|
|
|
| 49 |
tokenizer = AutoTokenizer.from_pretrained("Babelscape/wikineural-multilingual-ner")
|
| 50 |
model = AutoModelForTokenClassification.from_pretrained("Babelscape/wikineural-multilingual-ner")
|
|
|
|
| 51 |
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 52 |
example = "My name is Wolfgang and I live in Berlin"
|
|
|
|
| 53 |
ner_results = nlp(example)
|
| 54 |
print(ner_results)
|
| 55 |
```
|
|
|
|
| 46 |
```python
|
| 47 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 48 |
from transformers import pipeline
|
| 49 |
+
|
| 50 |
tokenizer = AutoTokenizer.from_pretrained("Babelscape/wikineural-multilingual-ner")
|
| 51 |
model = AutoModelForTokenClassification.from_pretrained("Babelscape/wikineural-multilingual-ner")
|
| 52 |
+
|
| 53 |
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 54 |
example = "My name is Wolfgang and I live in Berlin"
|
| 55 |
+
|
| 56 |
ner_results = nlp(example)
|
| 57 |
print(ner_results)
|
| 58 |
```
|