7ebc7bda3484804caec37ce58045ac0822767100,parlai/tasks/wrapper/agents.py,LabelToTextTeacher,act,#LabelToTextTeacher#,78

Before Change


            labels = act["labels"]
            assert len(labels) == 1
            new_act.force_set("text", labels[0])
            new_act.force_set("labels", [""])
        elif "eval_labels" in act:
            labels = act["eval_labels"]
            assert len(labels) == 1
            new_act.force_set("text", labels[0])

After Change


            labels_type = "labels" if "labels" in act else "eval_labels"
            labels = act[labels_type]
            if len(labels) != 1:
                raise ValueError("LabelToTextTeacher can only be used with one label!")
            new_act.force_set("text", labels[0])
            new_act.force_set(labels_type, [""])
        else:
            assert "text" not in act and act["episode_done"] is True
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: facebookresearch/ParlAI
Commit Name: 7ebc7bda3484804caec37ce58045ac0822767100
Time: 2020-07-27
Author: dianaglzrico@gmail.com
File Name: parlai/tasks/wrapper/agents.py
Class Name: LabelToTextTeacher
Method Name: act


Project Name: facebookresearch/ParlAI
Commit Name: 1f1822153e2f32a107a21bae414d0b012ea15608
Time: 2020-04-29
Author: roller@fb.com
File Name: parlai/agents/local_human/local_human.py
Class Name: LocalHumanAgent
Method Name: act


Project Name: facebookresearch/ParlAI
Commit Name: 1f1822153e2f32a107a21bae414d0b012ea15608
Time: 2020-04-29
Author: roller@fb.com
File Name: parlai/agents/safe_local_human/safe_local_human.py
Class Name: SafeLocalHumanAgent
Method Name: act