Skip to content

Commit

Permalink
fix: user-km and skill tests for dream_kg (#595)
Browse files Browse the repository at this point in the history
* default values for unused variables in user-km for dream_kg distribution

* missing tests for travel-italy-skill in dream_kg
  • Loading branch information
annakorz authored Nov 28, 2023
1 parent ad9f06f commit 0b90160
Show file tree
Hide file tree
Showing 4 changed files with 381 additions and 0 deletions.
8 changes: 8 additions & 0 deletions assistant_dists/dream_kg/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ services:
TERMINUSDB_SERVER_TEAM: admin
TERMINUSDB_SERVER_DB: user_knowledge_db
USER_KM_SERVICE_CONFIG: index_load_path.json
GENERATIVE_SERVICE_URL: http://openai-api-chatgpt:8145/respond
GENERATIVE_SERVICE_CONFIG: openai-chatgpt.json
GENERATIVE_SERVICE_TIMEOUT: 5
SENTENCE_RANKER_URL: http://sentence-ranker:8128/respond
SENTENCE_RANKER_TIMEOUT: 5
RELEVANT_KNOWLEDGE_THRESHOLD: 0.5
ENVVARS_TO_SEND: OPENAI_API_KEY
USE_KG_DATA: 0
context: ./
dockerfile: annotators/user_knowledge_memorizer/Dockerfile
command: flask run -h 0.0.0.0 -p 8027
Expand Down
Empty file.
319 changes: 319 additions & 0 deletions skills/dff_travel_italy_skill/tests/lets_talk_in.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,319 @@
{
"human_utter_index_batch": [
0
],
"dialog_batch": [
{
"human_utterances": [
{
"text": "let's talk about italy.",
"annotations": {
"asr": {
"asr_confidence": "undefined"
},
"spelling_preprocessing": "let's talk about italy",
"badlisted_words": {
"bad_words": false
},
"spacy_nounphrases": [
"books"
],
"sentseg": {
"punct_sent": "let's talk about italy.",
"segments": [
"let's talk about italy."
]
},
"intent_catcher": {
"cant_do": {
"confidence": 0.0,
"detected": 0
},
"choose_topic": {
"confidence": 0.0,
"detected": 0
},
"doing_well": {
"confidence": 0.0,
"detected": 0
},
"dont_understand": {
"confidence": 0.0,
"detected": 0
},
"exit": {
"confidence": 0.0,
"detected": 0
},
"lets_chat_about": {
"confidence": 1.0,
"detected": 1
},
"no": {
"confidence": 0.0,
"detected": 0
},
"opinion_request": {
"confidence": 0.0,
"detected": 0
},
"repeat": {
"confidence": 0.0,
"detected": 0
},
"stupid": {
"confidence": 0.0,
"detected": 0
},
"tell_me_a_story": {
"confidence": 0.0,
"detected": 0
},
"tell_me_more": {
"confidence": 0.0,
"detected": 0
},
"topic_switching": {
"confidence": 0.0,
"detected": 0
},
"weather_forecast_intent": {
"confidence": 0.0,
"detected": 0
},
"what_are_you_talking_about": {
"confidence": 0.0,
"detected": 0
},
"what_can_you_do": {
"confidence": 0.0,
"detected": 0
},
"what_is_your_job": {
"confidence": 0.0,
"detected": 0
},
"what_is_your_name": {
"confidence": 0.0,
"detected": 0
},
"what_time": {
"confidence": 0.0,
"detected": 0
},
"where_are_you_from": {
"confidence": 0.0,
"detected": 0
},
"who_made_you": {
"confidence": 0.0,
"detected": 0
},
"yes": {
"confidence": 0.0,
"detected": 0
}
},
"midas_classification": [
{
"appreciation": 0.0017878437647596002,
"command": 0.9731636047363281,
"comment": 0.0012271953746676445,
"complaint": 0.0019538358319550753,
"dev_command": 0.007522969506680965,
"neg_answer": 0.0012253294698894024,
"open_question_factual": 0.0013211232144385576,
"open_question_opinion": 0.0017928575398400426,
"opinion": 0.001923633273690939,
"other_answers": 0.0007157829240895808,
"pos_answer": 0.003168173599988222,
"statement": 0.0020507643930613995,
"yes_no_question": 0.00214685732498765
}
],
"combined_classification": {
"cobot_dialogact_intents": {
"Information_RequestIntent": 0.9999673366546631
},
"cobot_dialogact_topics": {
"Entertainment_Books": 0.9999250173568726
},
"cobot_topics": {
"Music": 0.9999924898147583
},
"emotion_classification": {
"neutral": 0.9999861717224121
},
"factoid_classification": {
"is_conversational": 0.9999961853027344
},
"sentiment_classification": {
"neutral": 0.9999853372573853
},
"toxic_classification": {
"not_toxic": 0.9999828338623047
}
},
"midas_predictor": {
"command": 0.06747467438494935,
"opinion": 0.22919681620839363,
"pos_answer": 0.1676917510853835,
"statement": 0.47503617945007237,
"yes_no_question": 0.060600578871201155
},
"topic_recommendation": [
"dff_movie_skill",
"dff_travel_skill",
"dff_music_skill"
],
"entity_detection": {
"entities": [
"books"
],
"labelled_entities": [
{
"label": "misc",
"offsets": [
17,
22
],
"text": "books"
}
]
},
"ner": [
[]
],
"entity_linking": [],
"fact_retrieval": {
"facts": [],
"topic_facts": []
},
"fact_random": {
"facts": [],
"response": "let's talk about italy."
},
"kbqa": {
"answer": "",
"confidence": 0.0,
"qa_system": "kbqa"
},
"sentrewrite": {
"clusters": [],
"modified_sents": [
"let's talk about italy."
]
},
"wiki_parser": {
"animals_skill_entities_info": {},
"entities_info": {},
"topic_skill_entities_info": {},
"utt_num": 1,
"wiki_skill_entities_info": {}
},
"news_api_annotator": [
{
"entity": "all",
"news": {
"content": "Major Serhiy Volyna, commander of Ukraine's 36th Separate Marine Brigade, issued a desperate plea to world leaders in a Facebook video posted from the besieged city of Mariupol.\n\"This is our appeal to the world. This could be the last appeal of our l... [959 chars]",
"description": "Major Serhiy Volyna, commander of Ukraine's 36th Separate Marine Brigade, issued a desperate plea to world leaders in a Facebook video posted from the besieged city of Mariupol. \"This is our appeal to the world.",
"image": "https://image.cnbcfm.com/api/v1/image/107047718-16502885112022-04-18t112625z_827114355_rc2npt9buj3j_rtrmadp_0_ukraine-crisis-mariupol.jpeg?v=1650288631&w=1920&h=1080",
"publishedAt": "2022-04-20T08:45:00Z",
"source": {
"name": "CNBC",
"url": "https://www.cnbc.com"
},
"title": "Latest news on Russia and the war in Ukraine",
"url": "https://www.cnbc.com/2022/04/20/russia-ukraine-live-updates.html"
},
"which": "all"
},
{
"entity": "books",
"news": {
"content": "Punjab Kings (PBKS) opener Shikhar Dhawan is likely to etch his name in the record books of IPL on Wednesday when his side faces his former team Delhi Capitals in Mumbai. Dhawan is the most prolific batter in the Punjab team who can provide the perfe... [2085 chars]",
"description": "Punjab Kings (PBKS) opener Shikhar Dhawan is likely to etch his name in the record books of IPL on Wednesday when his side faces his former team Delhi Capitals in Mumbai.",
"image": "https://cricketaddictor.com/wp-content/uploads/2018/03/maxresdefault.jpg",
"publishedAt": "2022-04-20T05:53:37Z",
"source": {
"name": "Cricket Addictor",
"url": "https://cricketaddictor.com"
},
"title": "DC vs PBKS: Shikhar Dhawan 11 Runs Away To Join Virat Kohli In The Elite List",
"url": "https://cricketaddictor.com/indian-premier-league-ipl-2022/dc-vs-pbks-shikhar-dhawan-11-runs-away-to-join-virat-kohli-in-the-elite-list/"
},
"which": "human"
}
],
"conceptnet": {
"books": {
"SymbolOf": [
"knowledge",
"life",
"education"
],
"HasProperty": [
"heavy",
"expensive",
"good than book"
],
"Causes": [
"knowledge",
"learn",
"you learn"
],
"CausesDesire": [
"read",
"read book",
"learn"
]
}
}
}
}
],
"bot_utterances": []
}
],
"dff_travel_italy_skill_state_batch": [
{}
],
"dff_shared_state_batch": [
{
"cross_states": {},
"cross_links": {}
}
],
"entities_batch": [
{
"book": {
"bot_attitude": null,
"bot_encounters": [],
"human_attitude": "like",
"human_encounters": [
{
"full_name": "books",
"human_utterance_index": 0,
"previous_skill_name": "pre_start"
}
],
"name": "book"
}
}
],
"used_links_batch": [
{}
],
"age_group_batch": [
"unknown"
],
"disliked_skills_batch": [
[]
],
"prompts_goals_batch": [
{}
],
"clarification_request_flag_batch": [
false
]
}
54 changes: 54 additions & 0 deletions skills/dff_travel_italy_skill/tests/lets_talk_out.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[
[
"What's your favourite place in Italy?",
1.0,
{
"dff_travel_italy_skill_state": {
"shared_memory": {},
"previous_human_utter_index": 0,
"history": {
"0": [
"travel_italy_general",
"italy_start"
]
},
"current_turn_dff_suspended": false,
"context": {
"id": "fc152029-8b47-4fe4-9a60-348939d4a2ef",
"labels": {
"0": [
"travel_italy_general",
"italy_start"
]
},
"requests": {
"0": "let's talk about italy."
},
"responses": {
"0": "What's your favourite place in Italy?"
},
"misc": {
"flags": {
"italy_travel_skill_active": true
}
},
"validation": false,
"actor_state": {}
}
},
"dff_shared_state": {
"cross_states": {},
"cross_links": {}
},
"used_links": {},
"age_group": "unknown",
"disliked_skills": [],
"prompts_goals": {}
},
{},
{
"can_continue": "must",
"is_final_answer": "true"
}
]
]

0 comments on commit 0b90160

Please sign in to comment.