Update README.md
Browse files
README.md
CHANGED
|
@@ -122,15 +122,12 @@ The following hyperparameters were used during training:
|
|
| 122 |
## How to Use
|
| 123 |
|
| 124 |
```python
|
|
|
|
| 125 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 126 |
from transformers import pipeline
|
| 127 |
|
| 128 |
-
# Load model and tokenizer
|
| 129 |
-
tokenizer = AutoTokenizer.from_pretrained("MatteoFasulo/ModernBERT-base-NER")
|
| 130 |
-
model = AutoModelForTokenClassification.from_pretrained("MatteoFasulo/ModernBERT-base-NER")
|
| 131 |
-
|
| 132 |
# Create NER pipeline
|
| 133 |
-
ner_pipeline = pipeline("
|
| 134 |
|
| 135 |
# Example usage
|
| 136 |
text = "Apple Inc. was founded by Steve Jobs in Cupertino, California."
|
|
|
|
| 122 |
## How to Use
|
| 123 |
|
| 124 |
```python
|
| 125 |
+
import torch
|
| 126 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 127 |
from transformers import pipeline
|
| 128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
# Create NER pipeline
|
| 130 |
+
ner_pipeline = pipeline("token-classification", model="MatteoFasulo/ModernBERT-base-NER", aggregation_strategy="simple", dtype=torch.bfloat16)
|
| 131 |
|
| 132 |
# Example usage
|
| 133 |
text = "Apple Inc. was founded by Steve Jobs in Cupertino, California."
|