Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- bg
|
| 5 |
+
- en
|
| 6 |
+
- fr
|
| 7 |
+
- de
|
| 8 |
+
- ru
|
| 9 |
+
- es
|
| 10 |
+
- sw
|
| 11 |
+
- tr
|
| 12 |
+
- vi
|
| 13 |
+
base_model:
|
| 14 |
+
- rustemgareev/mdeberta-v3-base-lite
|
| 15 |
+
pipeline_tag: token-classification
|
| 16 |
+
tags:
|
| 17 |
+
- deberta
|
| 18 |
+
- deberta-v3
|
| 19 |
+
- mdeberta
|
| 20 |
+
- ner
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# mdeberta-ontonotes5
|
| 24 |
+
|
| 25 |
+
This is a multilingual DeBERTa model fine-tuned for Named Entity Recognition (NER) task.
|
| 26 |
+
It is based on the [rustemgareev/mdeberta-v3-base-lite](https://huggingface.co/rustemgareev/mdeberta-v3-base-lite) model.
|
| 27 |
+
|
| 28 |
+
## Usage
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
from transformers import pipeline
|
| 32 |
+
|
| 33 |
+
# Initialize the NER pipeline
|
| 34 |
+
ner_pipeline = pipeline(
|
| 35 |
+
"token-classification",
|
| 36 |
+
model="rustemgareev/mdeberta-ontonotes5",
|
| 37 |
+
aggregation_strategy="simple"
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
# Example text
|
| 41 |
+
text = "Apple Inc. is looking at buying a U.K. startup for $1 billion in London next week."
|
| 42 |
+
|
| 43 |
+
# Get predictions
|
| 44 |
+
entities = ner_pipeline(text)
|
| 45 |
+
|
| 46 |
+
# Print the results
|
| 47 |
+
for entity in entities:
|
| 48 |
+
print(f"Entity: {entity['word']}, Label: {entity['entity_group']}, Score: {entity['score']:.4f}")
|
| 49 |
+
|
| 50 |
+
# Expected output:
|
| 51 |
+
# Entity: Apple Inc., Label: ORGANIZATION, Score: 0.9975
|
| 52 |
+
# Entity: U.K., Label: GPE, Score: 0.9956
|
| 53 |
+
# Entity: $1 billion, Label: MONEY, Score: 0.9981
|
| 54 |
+
# Entity: London, Label: GPE, Score: 0.9981
|
| 55 |
+
# Entity: next week, Label: DATE, Score: 0.9940
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## License
|
| 59 |
+
|
| 60 |
+
This model is distributed under the [MIT License](https://opensource.org/licenses/MIT).
|