Closed Karthi-DStech closed 1 month ago
I've not written a proper issue for this, my apologies. I've added it
I had envisioned a more general form of the metric, as we don't know exactly the format we will be getting out of different pipelines.
I had also defined
class SingleResultMetric(Metric):
"""Metric for evaluating pipelines that return a single result."""
class InformationRetrievalMetric(Metric):
"""Metric for evaluating information retrieval pipelines."""
So that we could implement metrics for pipelines that return multiple results so that we could make sure nobody calls the precision metric on the result of a pipeline where the answer is length 1 (a single result), so could PrecisionMetric
be a InformationRetrievalMetric
, please?
The extra documentation is nice! Separating out the different kinds of evaluation tests is good too.
Hi James,
I'll work on the changes and push it for the Pull Request. Thanks for your feedback.
Description:
This PR introduces the implementation of the PrecisionMetric and associated tests to verify the precision of the IdentityPipeline's output. The precision is calculated based on word-level matches between predicted and expected outputs.
Changes in This PR:
Added a PrecisionMetric class that computes precision by comparing the words in the predicted and expected outputs. Precision is calculated as the ratio of matched words to the total words in the expected output.
All Match: Test to ensure perfect precision (100%) when all input words match the expected output words exactly.
The precision is calculated based on the percentage of matched words between the predicted and expected outputs.
Test Cases:
All precision-related test cases pass successfully when running pytest.