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: update helloworld evaluate #1488
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1488 +/- ##
==========================================
+ Coverage 84.11% 84.16% +0.04%
==========================================
Files 105 105
Lines 5975 6049 +74
==========================================
+ Hits 5026 5091 +65
- Misses 949 958 +9
Continue to review full report at Codecov.
|
Latency summaryCurrent PR yields:
Breakdown
Backed by latency-tracking. Further commits will update this comment. |
@@ -77,8 +82,11 @@ def write_html(html_path): | |||
open(html_path, 'w') as fw: | |||
t = fp.read() | |||
t = t.replace('{% RESULT %}', '\n'.join(result_html)) | |||
evaluation_percentage = evaluation_value/num_docs_evaluated * 100.0 | |||
t = t.replace('{% EVALUATION %}', '{:.2f}%'.format(evaluation_percentage)) | |||
precision_evaluation_percentage = evaluation_value['evaluate-Precision@5'] / num_docs_evaluated * 100.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is @5
hardcoded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ 5 is the eval_at
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do the trick to select any key containing Precision
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but why is it 5, shouldn't this be top_k
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see so the eval_at
is an attribute in Executor, making it impossible to read from querylang/driver
class BaseRankingEvaluator(BaseEvaluator):
"""A :class:`BaseRankingEvaluator` evaluates the content of matches against the expected GroundTruth.
It is used to evaluate messages coming out from Indexers and Rankers and compares matches with groundtruths
"""
def __init__(self, eval_at: int, *args, **kwargs):
""""
:param eval_at: k at which evaluation is performed
"""
super().__init__(*args, **kwargs)
self.eval_at = eval_at
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved, refactor on eval_at
in another PR
No description provided.