-
Notifications
You must be signed in to change notification settings - Fork 14
Change model for Judgment entity #77
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
Change model for Judgment entity #77
Conversation
Signed-off-by: Martin Gaievski <[email protected]>
35c5546
to
efa8af2
Compare
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.
Looks good to me, thanks! Could you please remove the commented-out old code?
for (Map.Entry<String, Object> queryEntry : sourceJudgementRatings.entrySet()) { | ||
String queryText = queryEntry.getKey(); | ||
Object ratingData = queryEntry.getValue(); | ||
// for (Map.Entry<String, Object> queryEntry : sourceJudgementRatings.entrySet()) { |
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.
// for (Map.Entry<String, Object> queryEntry : sourceJudgementRatings.entrySet()) { |
) { | ||
Map<String, List<String>> indexAndQueries = (Map<String, List<String>>) results.get(METRICS_INDEX_AND_QUERIES_FIELD_NAME); | ||
List<String> queryTextWithReferences = (List<String>) results.get(METRICS_QUERY_TEXT_FIELD_NAME); | ||
|
||
Map<String, Map<String, String>> allJudgments = new HashMap<>(); | ||
// Map<String, Map<String, String>> allJudgments = new HashMap<>(); |
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.
// Map<String, Map<String, String>> allJudgments = new HashMap<>(); | |
@Override | ||
public void onResponse(Map<String, String> docIdToScore) { | ||
synchronized (allJudgments) { | ||
allJudgments.put(queryTextWithReference, docIdToScore); | ||
// allJudgments.put(queryTextWithReference, docIdToScore); |
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.
// allJudgments.put(queryTextWithReference, docIdToScore); |
) { | ||
LOGGER.debug("Starting COEC calculation with rank CTR: {}", rankAggregatedClickThrough); | ||
Map<String, Map<String, String>> judgmentRatings = new HashMap<>(); | ||
// Map<String, Map<String, String>> judgmentRatings = new HashMap<>(); |
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.
// Map<String, Map<String, String>> judgmentRatings = new HashMap<>(); |
} | ||
LOGGER.debug( | ||
"Final judgment ratings size - Queries: {}, Total Documents: {}", | ||
judgmentRatings.size(), | ||
judgmentRatings.values().stream().mapToInt(Map::size).sum() | ||
// judgmentRatings.values().stream().mapToInt(Map::size).sum() |
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.
// judgmentRatings.values().stream().mapToInt(Map::size).sum() |
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
super.writeTo(out); | ||
out.writeMap(judgmentScores); | ||
// out.writeList(judgmentScores); |
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.
// out.writeList(judgmentScores); |
Signed-off-by: Martin Gaievski <[email protected]>
corrected, thanks @heemin32 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #77 +/- ##
==========================
==========================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…pensearch-project#77 Signed-off-by: wrigleyDan <[email protected]>
* fix implicit judgment for the new nested data structure introduced in #77 Signed-off-by: wrigleyDan <[email protected]> * run ./gradlew spotlessApply Signed-off-by: wrigleyDan <[email protected]> * add entry to CHANGELOG.md Signed-off-by: wrigleyDan <[email protected]> * edit comment as per suggestion Signed-off-by: wrigleyDan <[email protected]> --------- Signed-off-by: wrigleyDan <[email protected]>
Description
Changed the model for Judgments to use fixed set of fields instead of dynamic field for each query text. Example of Judgment object with new model:
In this PR following items got changed:
Issues Resolved
#71
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.