F1-score issue
Closed this issue · 1 comments
rajae-Bens commented
Hi,
I am trying to execute the code in this google colab notebook
but an error is generated when calculating the f1 score in the validation step
could someone help plz
thank u
Hironsan commented
You should give a list of lists to f1_score
:
>>> from seqeval.metrics import f1_score
>>> y_true = [['O', 'O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O']]
>>> y_pred = [['O', 'O', 'B-MISC', 'I-MISC', 'I-MISC', 'I-MISC', 'O'], ['B-PER', 'I-PER', 'O']]
>>> f1_score(y_true, y_pred)
0.50