Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understanding the Evaluation Code #98

Open
Vincent950129 opened this issue Dec 20, 2020 · 1 comment
Open

Understanding the Evaluation Code #98

Vincent950129 opened this issue Dec 20, 2020 · 1 comment

Comments

@Vincent950129
Copy link

Thanks for the nice code.

I am confused with the evaluation code in run_ner.py L570. In particular, why "if j==0: continue" and what is variable "temp_" for? It would be nice if someone can walk me through.

       for i, label in enumerate(label_ids):
            temp_1 = []
            temp_2 = []
            for j,m in enumerate(label):
                if j == 0:
                    continue
                elif label_ids[i][j] == len(label_map):
                    y_true.append(temp_1)
                    y_pred.append(temp_2)
                    break
                else:
                    temp_1.append(label_map[label_ids[i][j]])
                    temp_2.append(label_map[logits[i][j]])

Also, I got the report file as follows, which seems incorrect (the extra "SEP]"):

          precision    recall  f1-score   support

     LOC     0.9213    0.9329    0.9270      1668
    MISC     0.7756    0.8319    0.8027       702
     ORG     0.8867    0.9001    0.8933      1661
     PER     0.9521    0.9586    0.9553      1617
    SEP]     0.0000    0.0000    0.0000         0

micro avg 0.9005 0.9180 0.9092 5648
macro avg 0.7071 0.7247 0.7157 5648
weighted avg 0.9018 0.9180 0.9098 5648

Any help would be highly appreciated.
Thank you for your time.

@terminator123
Copy link

i met the same prob, have u solved it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants