Views
No views yet
O, B-PER, I-PER, B-ORG, I-ORG, B-LOC, I-LOC, B-MISC, I-MISCbert-base-cased for token classification2e-5200.01epochepoch| Entity Type | Precision | Recall | F1 Score |
|---|---|---|---|
| LOC | 97.27% | 97.11% | 97.19% |
| MISC | 87.46% | 91.54% | 89.45% |
| ORG | 93.37% | 93.44% | 93.40% |
| PER | 96.02% | 98.15% | 97.07% |
| Entity Type | Precision | Recall | F1 Score |
|---|---|---|---|
| LOC | 92.87% | 92.87% | 92.87% |
| MISC | 75.55% | 82.76% | 78.99% |
| ORG | 88.32% | 90.61% | 89.45% |
| PER | 95.28% | 96.23% | 95.75% |
1from transformers import pipeline
2
3# Replace with your specific model checkpoint
4model_checkpoint = "Prikshit7766/bert-finetuned-ner"
5token_classifier = pipeline(
6 "token-classification",
7 model=model_checkpoint,
8 aggregation_strategy="simple"
9)
10
11# Example usage
12result = token_classifier("My name is Sylvain and I work at Hugging Face in Brooklyn.")
13print(result)1[
2 {
3 "entity_group":"PER",
4 "score":0.9999881,
5 "word":"Sylvain",
6 "start":11,
7 "end":18
8 },
9 {
10 "entity_group":"ORG",
11 "score":0.99961376,
12 "word":"Hugging Face",
13 "start":33,
14 "end":45
15 },
16 {
17 "entity_group":"LOC",
18 "score":0.99989843,
19 "word":"Brooklyn",
20 "start":49,
21 "end":57
22 }
23]