Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shifucun committed May 22, 2024
1 parent c7465af commit 581be7d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 30 deletions.
1 change: 0 additions & 1 deletion server/config/nl_page/topic_cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -15422,7 +15422,6 @@
],
"relevantVariableList": [
"UnemploymentRate_Person",
"Count_Person_NonWorker",
"UnemploymentRate_Person_Female",
"UnemploymentRate_Person_Male"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"Parts": [
{
"CosineScore": [
0.9257855415344238
0.9257859587669373
],
"QueryPart": "male population",
"SV": [
Expand Down Expand Up @@ -89,8 +89,8 @@
},
{
"CosineScore": [
0.8874201774597168,
0.8723466396331787
0.8874198794364929,
0.872346818447113
],
"QueryPart": "population",
"SV": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@
{
"CosineScore": [
0.8084911108016968,
0.8080331087112427,
0.8044111728668213,
0.7984197735786438,
0.7966943979263306,
0.7915846705436707,
0.8080330491065979,
0.8044111132621765,
0.7984198331832886,
0.7966945171356201,
0.7915846109390259,
0.790185809135437,
0.7865886688232422,
0.777317464351654,
0.7773175239562988,
0.776214063167572,
0.7629760503768921
0.7629761099815369
],
"QueryPart": "number poor hispanic",
"SV": [
Expand All @@ -86,8 +86,8 @@
},
{
"CosineScore": [
0.8318256735801697,
0.8029924631118774
0.8318259119987488,
0.8029922842979431
],
"QueryPart": "women phd",
"SV": [
Expand All @@ -114,11 +114,11 @@
},
{
"CosineScore": [
0.7646968960762024,
0.7476688027381897,
0.7377066612243652,
0.7362767457962036,
0.7305883169174194
0.7646969556808472,
0.7476687431335449,
0.73770672082901,
0.7362766861915588,
0.7305881977081299
],
"QueryPart": "phd",
"SV": [
Expand All @@ -137,7 +137,7 @@
"Parts": [
{
"CosineScore": [
0.7890844941139221
0.7890845537185669
],
"QueryPart": "number poor",
"SV": [
Expand All @@ -146,10 +146,10 @@
},
{
"CosineScore": [
0.8151503801345825,
0.7885993719100952,
0.7775554060935974,
0.7752052545547485
0.8151504993438721,
0.7885995507240295,
0.7775554656982422,
0.7752053737640381
],
"QueryPart": "hispanic women phd",
"SV": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"Parts": [
{
"CosineScore": [
0.8787486553192139
0.8787485361099243
],
"QueryPart": "show climate change",
"SV": [
Expand All @@ -66,9 +66,9 @@
{
"CosineScore": [
0.794236958026886,
0.7929013967514038,
0.792901337146759,
0.7586168050765991,
0.758395791053772
0.7583957314491272
],
"QueryPart": "show climate",
"SV": [
Expand All @@ -80,7 +80,7 @@
},
{
"CosineScore": [
0.866512656211853
0.8665127158164978
],
"QueryPart": "change drought",
"SV": [
Expand Down
8 changes: 5 additions & 3 deletions server/lib/nl/common/debug_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def result_with_debug_info(data_dict: Dict, status: str,
for entity in query_detection.places_detected.entities_found:
entities_found_formatted += f"(name: {entity.name}, dcid: {entity.dcid}); "

query_transformations = query_detection_debug_logs['query_transformations']
query_transformations = query_detection_debug_logs.get(
'query_transformations', {})

debug_info.update({
'places_detected':
Expand All @@ -147,11 +148,12 @@ def result_with_debug_info(data_dict: Dict, status: str,
'entities_resolved':
entities_found_formatted,
'query_index_type':
query_transformations['sv_detection_query_index_type'],
query_transformations.get('sv_detection_query_index_type', ''),
'query_with_places_removed':
query_detection.places_detected.query_without_place_substr,
'query_with_stop_words_removal':
query_transformations['sv_detection_query_stop_words_removal'],
query_transformations.get('sv_detection_query_stop_words_removal',
''),
'query_detection_debug_logs':
query_detection_debug_logs,
})
Expand Down

0 comments on commit 581be7d

Please sign in to comment.