diff --git a/website/src/components/Survey/LabelRadioGroup.tsx b/website/src/components/Survey/LabelRadioGroup.tsx index 617b05b9..7e58b86f 100644 --- a/website/src/components/Survey/LabelRadioGroup.tsx +++ b/website/src/components/Survey/LabelRadioGroup.tsx @@ -1,4 +1,18 @@ -import { Box, Button, Flex, useColorMode } from "@chakra-ui/react"; +import { + Box, + Button, + Flex, + IconButton, + Popover, + PopoverArrow, + PopoverBody, + PopoverCloseButton, + PopoverContent, + PopoverTrigger, + Text, + useColorMode, +} from "@chakra-ui/react"; +import { InformationCircleIcon } from "@heroicons/react/20/solid"; import { useId, useState } from "react"; import { colors } from "src/styles/Theme/colors"; @@ -8,6 +22,17 @@ interface LabelRadioGroupProps { isEditable?: boolean; } +const label_messages: { [label: string]: { description: string; explanation: string[] } } = { + spam: { + description: "The message is spam?", + explanation: [ + 'We consider the following unwanted content as spam: trolling, intentional undermining of our purpose, illegal material, material that violates our code of conduct, and other things that are inappropriate for our dataset. We collect these under the common heading of "spam".', + "This is not an assessment of whether this message is the best possible answer. Especially for prompts or user-replies, we very much want to retain all kinds of responses in the dataset, so that the assistant can learn to reply appropriately.", + "Please mark this text as spam only if it is clearly unsuited to be part of our dataset, as outlined above, and try not to make any subjective value-judgements beyond that.", + ], + }, +}; + export const LabelRadioGroup = (props: LabelRadioGroupProps) => { const [labelValues, setLabelValues] = useState(Array.from({ length: props.labelIDs.length }).map(() => 0)); const [interactionFlag, setInteractionFlag] = useState(false); @@ -17,7 +42,7 @@ export const LabelRadioGroup = (props: LabelRadioGroupProps) => { {props.labelIDs.map((labelId, idx) => ( { const newState = labelValues.slice(); @@ -45,7 +70,7 @@ interface ButtonState { } interface LabelRadioItemProps { - labelId: string; + labelText: { description: string; explanation?: string[] }; labelValue: number; clickHandler: (newVal: number) => unknown; states: ButtonState[]; @@ -63,7 +88,27 @@ const LabelRadioItem = (props: LabelRadioItemProps) => { {props.states.map((item, idx) => ( diff --git a/website/src/components/Tasks/LabelTask.tsx b/website/src/components/Tasks/LabelTask.tsx index 758ee127..636e9cde 100644 --- a/website/src/components/Tasks/LabelTask.tsx +++ b/website/src/components/Tasks/LabelTask.tsx @@ -66,7 +66,7 @@ export const LabelTask = ({ )} - {valid_labels.length === 1 ? ( + {task.mode === "simple" ? ( ) : ( diff --git a/website/src/components/Tasks/Task.tsx b/website/src/components/Tasks/Task.tsx index 0c728a6d..05410d4e 100644 --- a/website/src/components/Tasks/Task.tsx +++ b/website/src/components/Tasks/Task.tsx @@ -27,7 +27,7 @@ export const Task = ({ frontendId, task, trigger, mutate }) => { const replyContent = useRef(null); const [showUnchangedWarning, setShowUnchangedWarning] = useState(false); - const taskType = TaskTypes.find((taskType) => taskType.type === task.type); + const taskType = TaskTypes.find((taskType) => taskType.type === task.type && taskType.mode === task.mode); const { trigger: sendRejection } = useSWRMutation("/api/reject_task", post, { onSuccess: async () => { diff --git a/website/src/components/Tasks/TaskTypes.tsx b/website/src/components/Tasks/TaskTypes.tsx index 6f0bd2e1..ddb59a59 100644 --- a/website/src/components/Tasks/TaskTypes.tsx +++ b/website/src/components/Tasks/TaskTypes.tsx @@ -11,6 +11,7 @@ export interface TaskInfo { category: TaskCategory; pathname: string; type: string; + mode?: string; overview?: string; instruction?: string; update_type: string; @@ -90,7 +91,7 @@ export const TaskTypes: TaskInfo[] = [ unchanged_title: "Order Unchanged", unchanged_message: "You have not changed the order of the prompts. Are you sure you would like to continue?", }, - // label + // label (fuill) { label: "Label Initial Prompt", desc: "Provide labels for a prompt.", @@ -98,6 +99,7 @@ export const TaskTypes: TaskInfo[] = [ pathname: "/label/label_initial_prompt", overview: "Provide labels for the following prompt", type: "label_initial_prompt", + mode: "full", update_type: "text_labels", }, { @@ -107,6 +109,7 @@ export const TaskTypes: TaskInfo[] = [ pathname: "/label/label_prompter_reply", overview: "Given the following discussion, provide labels for the final promp", type: "label_prompter_reply", + mode: "full", update_type: "text_labels", }, { @@ -116,6 +119,38 @@ export const TaskTypes: TaskInfo[] = [ pathname: "/label/label_assistant_reply", overview: "Given the following discussion, provide labels for the final prompt.", type: "label_assistant_reply", + mode: "full", + update_type: "text_labels", + }, + // label (simple) + { + label: "Classify Initial Prompt", + desc: "Provide labels for a prompt.", + category: TaskCategory.Label, + pathname: "/label/label_initial_prompt", + overview: "Read the following prompt and then answer the question about it.", + type: "label_initial_prompt", + mode: "simple", + update_type: "text_labels", + }, + { + label: "Classify Prompter Reply", + desc: "Provide labels for a prompt.", + category: TaskCategory.Label, + pathname: "/label/label_prompter_reply", + overview: "Read the following conversation and then answer the question about the last prompt in the disscusion.", + type: "label_prompter_reply", + mode: "simple", + update_type: "text_labels", + }, + { + label: "Classify Assistant Reply", + desc: "Provide labels for a prompt.", + category: TaskCategory.Label, + pathname: "/label/label_assistant_reply", + overview: "Read the following conversation and then answer the question about the last prompt in the disscusion.", + type: "label_assistant_reply", + mode: "simple", update_type: "text_labels", }, ];