Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Wizard crowdsourcing spelling #4052

Merged
merged 2 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def poor_knowledge_selection(messages, persona, stemmer, knwldg_ovlp_thrshld):
if msg['id'] != 'Wizard':
continue

selections = msg.get('task_data', {}).get('selected_text_candaidtes')
selections = msg.get('task_data', {}).get('selected_text_candidates')
if not selections or selections[0][0]:
continue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Example use:

python compile_results.py --task-name wizard-of-internet --output-folder=/dataset/wizard-internet

"""

from typing import Dict, Union
Expand Down Expand Up @@ -102,7 +101,7 @@ def get_context(self):
return {'Persona': context_data['form_responses'][0]['response']}
return {
CONTENTS: context_data.get('text_candidates', ''),
SELECTED_CONTENTS: context_data.get('selected_text_candaidtes', ''),
SELECTED_CONTENTS: context_data.get('selected_text_candidates', ''),
}
# Must be SEARCH_AGENT
return {CONTENTS: context_data['search_results']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function CustomTextResponse({
task_data: {
search_query: searchQuery,
text_candidates: searchResults,
selected_text_candaidtes: selectedSearchResults,
selected_text_candidates: selectedSearchResults,
}
}).then(() => {
setTextValue("");
Expand Down
4 changes: 2 additions & 2 deletions parlai/crowdsourcing/projects/wizard_of_internet/worlds.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _has_selected_sentence_from_search_results(action: Union[Dict, Message]):
Whether there is any knowledges selected with this message.
"""
k_task = 'task_data'
k_selected = 'selected_text_candaidtes'
k_selected = 'selected_text_candidates'
if (k_task in action) and (k_selected in action[k_task]):
# Boolean value that user has not selected any option
return not action[k_task][k_selected][0][0]
Expand Down Expand Up @@ -508,7 +508,7 @@ def reason_to_reject(self):
task_data = msg.get('task_data')
if not (task_data and isinstance(task_data, dict)):
continue
sel_options = task_data.get('selected_text_candaidtes')
sel_options = task_data.get('selected_text_candidates')
if not sel_options or len(sel_options) == 1: # No choices
continue
if not sel_options[0][0]:
Expand Down