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

Refactor evaluate.py. #10

Merged
merged 16 commits into from
Apr 22, 2021
Merged

Refactor evaluate.py. #10

merged 16 commits into from
Apr 22, 2021

Conversation

Eleven1Liu
Copy link
Collaborator

@Eleven1Liu Eleven1Liu commented Apr 21, 2021

  1. Class MultiLabelMetric is removed as it has the same functionality as FewShotMetrics.
  2. FewShotMetrics
  • rename to MultiLabelMetrics
  • remove all target groups (e.g., S, F, Z) : use config.label_file in the future (?)
  1. Move all CAML-like metrics to metrics.py.
  2. requirements.txt: Remove package tabulate.

@Eleven1Liu Eleven1Liu changed the title [WIP] Metric Refactor evaluate.py. Apr 21, 2021
main.py Outdated Show resolved Hide resolved
metrics.py Outdated Show resolved Hide resolved
metrics.py Outdated Show resolved Hide resolved
metrics.py Outdated Show resolved Hide resolved
metrics.py Outdated Show resolved Hide resolved
metrics.py Outdated Show resolved Hide resolved
# get precision at k for each example
vals = []
for i, tk in enumerate(topk):
if len(tk) > 0:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't len(tk) always be k?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could be multiple top-ks in CAML like [8,15] for the full code, [5] for the top-50 code.
If we don't use multiple top-ks in the future, I should remove this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, you're right!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to solve this!

metrics.py Outdated Show resolved Hide resolved
evaluate.py Outdated Show resolved Hide resolved
evaluate.py Outdated Show resolved Hide resolved
@Eleven1Liu
Copy link
Collaborator Author

Merge this PR first. I will:
(1) check CAML metrics again
(2) remove some functions in MultiLabelMetrics
in the next pull request.

@Eleven1Liu Eleven1Liu merged commit d6941fb into master Apr 22, 2021
@Eleven1Liu Eleven1Liu deleted the metric branch April 22, 2021 23:34
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

Successfully merging this pull request may close these issues.

None yet

2 participants