-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NL] Implement query-type fallback (#2225)
In fulfillment, loop over a sequence of query_types until we are able to produce some charts. The two key functions are: * `first_query_type`: Given a bunch of classification results in an utterance, we pick the first query_type to process * `next_query_type`: Given a list of past query_types we tried to fulfill and failed, we pick the next query_type to process Given fallbacks at query_type level, drop per-fulfillment-type fallbacks. Also, separate out the ClassificationType from a new QueryType, since the latter may be more fine-grained.
- Loading branch information
Showing
34 changed files
with
3,997 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
server/integration_tests/test_data/demo_fallback/query_1/chart_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"config": { | ||
"categories": [ | ||
{ | ||
"blocks": [ | ||
{ | ||
"columns": [ | ||
{ | ||
"tiles": [ | ||
{ | ||
"type": "PLACE_OVERVIEW" | ||
} | ||
] | ||
} | ||
], | ||
"title": "Palo Alto" | ||
} | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"placeDcid": [ | ||
"geoId/0655282" | ||
] | ||
} | ||
}, | ||
"context": {}, | ||
"debug": {}, | ||
"place": { | ||
"dcid": "geoId/0655282", | ||
"name": "Palo Alto", | ||
"place_type": "City" | ||
} | ||
} |
185 changes: 185 additions & 0 deletions
185
server/integration_tests/test_data/demo_fallback/query_1/debug_info.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
{ | ||
"clustering_classification": "<None>", | ||
"comparison_classification": "<None>", | ||
"contained_in_classification": "<None>", | ||
"correlation_classification": "<None>", | ||
"counters": { | ||
"failed_populate_main_place": [ | ||
"geoId/0655282" | ||
], | ||
"filtered_svs": [], | ||
"num_chart_candidates": 1, | ||
"num_populate_fallbacks": 1, | ||
"processed_fulfillment_types": [ | ||
"simple", | ||
"overview" | ||
] | ||
}, | ||
"data_spec": [ | ||
{ | ||
"classifications": [ | ||
{ | ||
"type": 11 | ||
} | ||
], | ||
"places": [ | ||
{ | ||
"dcid": "geoId/0655282", | ||
"name": "Palo Alto", | ||
"place_type": "City" | ||
} | ||
], | ||
"query": "Number of Shakespeare fans in Palo Alto", | ||
"query_type": 9, | ||
"ranked_charts": [ | ||
{ | ||
"attr": { | ||
"block_id": 1, | ||
"chart_type": "", | ||
"class": 0, | ||
"description": "", | ||
"include_percapita": false, | ||
"place_type": null, | ||
"ranking_types": [], | ||
"source_topic": "", | ||
"title": "" | ||
}, | ||
"chart_type": 4, | ||
"event": null, | ||
"places": [ | ||
{ | ||
"dcid": "geoId/0655282", | ||
"name": "Palo Alto", | ||
"place_type": "City" | ||
} | ||
], | ||
"svs": [] | ||
} | ||
], | ||
"svs": [] | ||
} | ||
], | ||
"event_classification": "<None>", | ||
"main_place_dcid": "geoId/0655282", | ||
"main_place_name": "Palo Alto", | ||
"original_query": "Number of Shakespeare fans in Palo Alto", | ||
"overview_classification": "<None>", | ||
"places_detected": [ | ||
"palo alto" | ||
], | ||
"query_with_places_removed": "number of shakespeare fans", | ||
"ranking_classification": "<None>", | ||
"status": "", | ||
"sv_matching": { | ||
"CosineScore": [ | ||
0.3691325783729553, | ||
0.29036542773246765, | ||
0.2894546687602997, | ||
0.2783313989639282, | ||
0.272920161485672, | ||
0.2691501975059509, | ||
0.2653329074382782, | ||
0.26523518562316895, | ||
0.2610829472541809, | ||
0.2539288103580475 | ||
], | ||
"SV": [ | ||
"Count_HeavySnowEvent", | ||
"Count_Person_Male", | ||
"Count_CriminalIncidents_IsHateCrime", | ||
"Count_EarthquakeEvent", | ||
"Count_Person_5To9Years", | ||
"Count_CriminalActivities_Robbery", | ||
"Count_HeavyRainEvent", | ||
"Count_Worker_NAICSArtsEntertainmentRecreation", | ||
"Count_DroughtEvent", | ||
"Count_FloodEvent" | ||
], | ||
"SV_to_Sentences": { | ||
"Count_CriminalActivities_Robbery": [ | ||
"Number of heists (0.2691501975059509)" | ||
], | ||
"Count_CriminalIncidents_IsHateCrime": [ | ||
"Number of hate crimes (0.2894546687602997)", | ||
"Number of Hate Crime Incidents (0.25507885217666626)", | ||
"Number of hate crime incidents (0.25507885217666626)" | ||
], | ||
"Count_DroughtEvent": [ | ||
"Number of Droughts (0.2610829472541809)", | ||
"Number of droughts (0.2610829174518585)" | ||
], | ||
"Count_EarthquakeEvent": [ | ||
"Number of tremors (0.2783313989639282)", | ||
"Number of temblors (0.27476659417152405)", | ||
"Number of quakes (0.27175652980804443)", | ||
"Number of Earthquakes (0.25374898314476013)" | ||
], | ||
"Count_FloodEvent": [ | ||
"Number of Floods (0.2539288103580475)", | ||
"Number of floods (0.2539288103580475)" | ||
], | ||
"Count_HeavyRainEvent": [ | ||
"Number of heavy rains (0.2653329074382782)", | ||
"Number of Heavy Rains (0.2653329074382782)" | ||
], | ||
"Count_HeavySnowEvent": [ | ||
"Number of blizzards (0.3691325783729553)" | ||
], | ||
"Count_Person_5To9Years": [ | ||
"Number of 5 to 9 year old people (0.272920161485672)" | ||
], | ||
"Count_Person_Male": [ | ||
"Number of Males (0.29036542773246765)" | ||
], | ||
"Count_Worker_NAICSArtsEntertainmentRecreation": [ | ||
"Employment numbers in entertainment and recreation (0.26523518562316895)", | ||
"number of arts, entertainment, and recreation workers (0.25554004311561584)", | ||
"Population of Person: Arts, Entertainment, And Recreation (NAICS/71) (0.25426241755485535)" | ||
] | ||
} | ||
}, | ||
"svs_to_sentences": { | ||
"Count_CriminalActivities_Robbery": [ | ||
"Number of heists (0.2691501975059509)" | ||
], | ||
"Count_CriminalIncidents_IsHateCrime": [ | ||
"Number of hate crimes (0.2894546687602997)", | ||
"Number of Hate Crime Incidents (0.25507885217666626)", | ||
"Number of hate crime incidents (0.25507885217666626)" | ||
], | ||
"Count_DroughtEvent": [ | ||
"Number of Droughts (0.2610829472541809)", | ||
"Number of droughts (0.2610829174518585)" | ||
], | ||
"Count_EarthquakeEvent": [ | ||
"Number of tremors (0.2783313989639282)", | ||
"Number of temblors (0.27476659417152405)", | ||
"Number of quakes (0.27175652980804443)", | ||
"Number of Earthquakes (0.25374898314476013)" | ||
], | ||
"Count_FloodEvent": [ | ||
"Number of Floods (0.2539288103580475)", | ||
"Number of floods (0.2539288103580475)" | ||
], | ||
"Count_HeavyRainEvent": [ | ||
"Number of heavy rains (0.2653329074382782)", | ||
"Number of Heavy Rains (0.2653329074382782)" | ||
], | ||
"Count_HeavySnowEvent": [ | ||
"Number of blizzards (0.3691325783729553)" | ||
], | ||
"Count_Person_5To9Years": [ | ||
"Number of 5 to 9 year old people (0.272920161485672)" | ||
], | ||
"Count_Person_Male": [ | ||
"Number of Males (0.29036542773246765)" | ||
], | ||
"Count_Worker_NAICSArtsEntertainmentRecreation": [ | ||
"Employment numbers in entertainment and recreation (0.26523518562316895)", | ||
"number of arts, entertainment, and recreation workers (0.25554004311561584)", | ||
"Population of Person: Arts, Entertainment, And Recreation (NAICS/71) (0.25426241755485535)" | ||
] | ||
}, | ||
"temporal_classification": "<None>", | ||
"time_delta_classification": "<None>" | ||
} |
Oops, something went wrong.