Hello! I am trying to use the pre-trained model to make some predictions. After some googling around I managed to ‘read’ the prediction outputs:
from transformers import TokenClassificationPipeline
pipe = TokenClassificationPipeline(model=model, tokenizer=tokenizer)
pipe("Michael Jordan basketball player - defense, offense")
The output though only uses LABEL_11 (Unknown) for all words. What is it missing?
[{'word': 'michael',
'score': 0.2715179920196533,
'entity': 'LABEL_11',
'index': 1,
'start': 0,
'end': 7},
{'word': 'jordan',
'score': 0.3014214038848877,
'entity': 'LABEL_11',
'index': 2,
'start': 8,
'end': 14},
{'word': 'basketball',
'score': 0.31579136848449707,
'entity': 'LABEL_11',
'index': 3,
'start': 15,
'end': 25},
{'word': 'player',
'score': 0.34259045124053955,
'entity': 'LABEL_11',
'index': 4,
'start': 26,
'end': 32},
{'word': '-',
'score': 0.3144441246986389,
'entity': 'LABEL_11',
'index': 5,
'start': 33,
'end': 34},
{'word': 'defense',
'score': 0.3268392086029053,
'entity': 'LABEL_11',
'index': 6,
'start': 35,
'end': 42},
{'word': ',',
'score': 0.29030275344848633,
'entity': 'LABEL_11',
'index': 7,
'start': 42,
'end': 43},
{'word': 'offense',
'score': 0.2715778350830078,
'entity': 'LABEL_11',
'index': 8,
'start': 44,
'end': 51}]