Views
No views yet
Train Loss: 0.031400Validation Loss: 0.070702Validation Accuracy: 0.983061Precision: 0.912730Recall: 0.936385F1: 0.924406Accuracy: 0.9830611from transformers import pipeline
2checkpoint = "rasyosef/distilbert-finetuned-ner"
3token_classifier = pipeline("token-classification", model=checkpoint, aggregation_strategy="simple")
4token_classifier("My name is Tony Stark and I work at Stark Industries in Los Angeles.")1[{'entity_group': 'PER',
2 'score': 0.99873567,
3 'word': 'Tony Stark',
4 'start': 11,
5 'end': 21},
6 {'entity_group': 'ORG',
7 'score': 0.998356,
8 'word': 'Stark Industries',
9 'start': 36,
10 'end': 52},
11 {'entity_group': 'LOC',
12 'score': 0.9982861,
13 'word': 'Los Angeles',
14 'start': 56,
15 'end': 67}]