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

Turn annotation form question #2886

Merged
merged 3 commits into from
Jul 31, 2020
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
3 changes: 2 additions & 1 deletion parlai/mturk/tasks/turn_annotations/bot_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def act(self, timeout=None):
radio_buttons_html = ''
for i in range(1, 6):
radio_buttons_html += f"""<input type="radio" id="radio_rating_{i}" name="radio_final_rating_group" value="{i}" /><span style={radio_css_style}>{i}</span>"""
exceeds_min_turns = f"""<br><br><div>{self.num_turns} chat turns finished! Please rate your partner on a scale of 1-5, how much would you enjoy talking to this partner over the course of a long conversation? (1: not at all, 5: a lot)</div>
final_scoring_question = self.opt['final_rating_question']
exceeds_min_turns = f"""<br><br><div>{self.num_turns} chat turns finished! {final_scoring_question}</div>
{radio_buttons_html}
<br>Then, please click the "Done" button to end the chat."""
final_message_text += exceeds_min_turns
Expand Down
2 changes: 2 additions & 0 deletions parlai/mturk/tasks/turn_annotations/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

WAITING_MSG = 'Please wait while we match you with another worker...'

FINAL_RATING_QUESTION = 'Please rate your partner on a scale of 1-5.'

ANNOTATIONS_INTRO = """<br><br><span style="font-style:italic;">Does this comment from your partner have any of the following attributes? (Check all that apply)<br>"""

ANNOTATIONS_CONFIG = [
Expand Down
11 changes: 8 additions & 3 deletions parlai/mturk/tasks/turn_annotations/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
from parlai.core.agents import create_agent_from_shared
from parlai.mturk.core.mturk_manager import MTurkManager
from parlai.core.params import ParlaiParser
from constants import (
from parlai.mturk.tasks.turn_annotations.constants import (
AGENT_0,
ANNOTATIONS_CONFIG,
TASK_CONFIG,
LEFT_PANE_TEXT,
FINAL_RATING_QUESTION,
)
from worlds import TurnAnnotationsOnboardWorld, TurnAnnotationsChatWorld
from bot_agent import TurkLikeAgent
from parlai.mturk.tasks.turn_annotations.worlds import (
TurnAnnotationsOnboardWorld,
TurnAnnotationsChatWorld,
)
from parlai.mturk.tasks.turn_annotations.bot_agent import TurkLikeAgent


def run_task(override_opt):
Expand Down Expand Up @@ -83,6 +87,7 @@ def run_task(override_opt):
opt['task'] = os.path.basename(directory_path)

opt['left_pane_text'] = LEFT_PANE_TEXT
opt['final_rating_question'] = FINAL_RATING_QUESTION
opt.update(TASK_CONFIG)

# NOTE: you have to set all three of these opts to enforce the MTurk core
Expand Down
6 changes: 3 additions & 3 deletions parlai/mturk/tasks/turn_annotations/worlds.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)
from parlai.mturk.core.worlds import MTurkOnboardWorld

from constants import (
from parlai.mturk.tasks.turn_annotations.constants import (
AGENT_1,
WAITING_MSG,
ONBOARD_TASK_DATA,
Expand All @@ -29,8 +29,8 @@
ONBOARD_SUCCESS,
ANNOTATIONS_CONFIG,
)
from bot_agent import TurkLikeAgent
from utils import Compatibility
from parlai.mturk.tasks.turn_annotations.bot_agent import TurkLikeAgent
from parlai.mturk.tasks.turn_annotations.utils import Compatibility


class TurnAnnotationsOnboardWorld(MTurkOnboardWorld):
Expand Down