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

Add a randomize_conversations to ACUTE blueprint + use #3528

Merged
merged 7 commits into from Apr 17, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions parlai/crowdsourcing/tasks/acute_eval/conf/example.yaml
Expand Up @@ -13,6 +13,7 @@ mephisto:
s1_choice: "I would prefer to talk to <Speaker 1>"
s2_choice: "I would prefer to talk to <Speaker 2>"
subtasks_per_unit: 5
randomize_conversations: True
task:
allowed_concurrent: 1
assignment_duration_in_seconds: 600
Expand Down
Expand Up @@ -7,3 +7,4 @@ mephisto:
num_self_chats: 5
root_dir: ${task_dir}/task_config
task: blended_skill_talk
randomize_conversations: True
6 changes: 6 additions & 0 deletions parlai/crowdsourcing/tasks/acute_eval/fast_acute_blueprint.py
Expand Up @@ -81,6 +81,12 @@ class FastAcuteBlueprintArgs(AcuteEvalBlueprintArgs):
default=False,
metadata={'help': "Use any existing self-chat files without prompting"},
)
randomize_conversations: bool = field(
default=True,
metadata={
'help': "Randomize conversations used for match-ups or take conversations in order"
},
)


@register_mephisto_abstraction()
Expand Down
13 changes: 8 additions & 5 deletions parlai/crowdsourcing/tasks/acute_eval/fast_eval.py
Expand Up @@ -329,12 +329,15 @@ def _build_conversation_pairs(
self.fast_acute_args.matchups_per_pair
* self.fast_acute_args.sufficient_matchups_multiplier
)
# Write random pairs of conversations
# Write pairs of conversations
for model_pair in self.combos:
for _ in range(pairs_per_model):
conversation_indices = [
random.choice(range(len(conversations[m]))) for m in model_pair
]
for i in range(pairs_per_model):
if self.fast_acute_args.randomize_conversations:
conversation_indices = [
random.choice(range(len(conversations[m]))) for m in model_pair
]
else:
conversation_indices = [i for _ in model_pair]
pair = []
pair_ids = []
for i, c_id in enumerate(conversation_indices):
Expand Down