MantisAI / nervaluate

Full named-entity (i.e., not tag/token) evaluation metrics based on SemEval’13
MIT License
154 stars 19 forks source link

Addressing issue #65 - Expanded evaluator class: extract results as a Dataframe #80

Closed adgianv closed 3 weeks ago

adgianv commented 1 month ago

This pull request addresses issue https://github.com/MantisAI/nervaluate/issues/65#issue-1715456415, which involved extracting the results from the Evaluator class as a pandas DataFrame.

Changes made:

Added Method: Introduced a new method results_to_dataframe in the Evaluator class. Functionality: This method transposes the nested dictionary of evaluation results and converts it into a pandas DataFrame. This transformation makes the results more readable and easier to analyse.

Summary of Changes:

These changes improve the usability of the evaluation results by providing a straightforward way to view and analyse them in a tabular format.

nsorros commented 1 month ago

Write a more detailed description, refer to what issue this solves and include instructions on how the reviewer can test that its working. those instructions can form the basis of a test that is lacking as well.

adgianv commented 1 month ago

This pull request addresses issue https://github.com/MantisAI/nervaluate/issues/65#issue-1715456415, which involved extracting the results from the Evaluator class as a pandas DataFrame.

Changes made:

Added Method: Introduced a new method results_to_dataframe in the Evaluator class. Functionality: This method transposes the nested dictionary of evaluation results and converts it into a pandas DataFrame. This transformation makes the results more readable and easier to analyze. Summary of Changes:

Transposed the nested dictionary from the Evaluator class. Exported the transposed dictionary to a pandas DataFrame. These changes improve the usability of the evaluation results by providing a straightforward way to view and analyse them in a tabular format.

ivyleavedtoadflax commented 1 month ago

Much better - this can now go into the PR description

davidsbatista commented 1 month ago

Hi @adgianv , thanks for your contribution.

Please, rename the PR title to a sentence summarizing what you are proposing. Can you also add a test for the new method you are introducing?

adgianv commented 1 month ago

Changes made:

Added Method: Introduced a new method results_to_dataframe in the Evaluator class. Functionality: This method transposes the nested dictionary of evaluation results and converts it into a pandas DataFrame. This transformation makes the results more readable and easier to analyze.

Summary of Changes:
Transposed the nested dictionary from the Evaluator class. Exported the transposed dictionary to a pandas DataFrame.

These changes improve the usability of the evaluation results by providing a straightforward way to view and analyse them in a tabular format.

adgianv commented 4 weeks ago

With this new commit I modified the results_to_dataframe method to allow for more complicated nested structures in the results. To do it I added a helper method in the Evaluator class called _flatten_dict, that flattens a nested dataframe.

I added a relevant test in the test_evaluator.py file called test_results_to_dataframe.

nsorros commented 3 weeks ago

You just need to address the following two comments

Much better - this can now go into the PR description

and

Please, rename the PR title to a sentence summarizing what you are proposing. Can you also add a test for the new method you are introducing?

also tests need to pass in CI

davidsbatista commented 3 weeks ago

this PR also introduces pandas as a dependency

adgianv commented 3 weeks ago

this PR also introduces pandas as a dependency

I added it in the description

davidsbatista commented 3 weeks ago

sorry, I meant you need to add it to the pyproject.toml, you need to create a new section for dependencies and add it, for the other two CI errors one I fixed already the other is just the order of the imports

davidsbatista commented 3 weeks ago

seems all good now! 🚀 thanks for your effort and contribution! I will approved it

davidsbatista commented 3 weeks ago

@nsorros @ivyleavedtoadflax after this merge I would bump the version, add the release notes (how is that actually added?) - and then we can make a new release - wdyt?