Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TUS_public
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
dsml
TUS_public
Commits
1895814d
Unverified
Commit
1895814d
authored
4 years ago
by
Jinchao Li
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add input reqt vals in human eval (#128)
parent
d70c0fc6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
convlab2/human_eval/worlds.py
+25
-4
25 additions, 4 deletions
convlab2/human_eval/worlds.py
with
25 additions
and
4 deletions
convlab2/human_eval/worlds.py
+
25
−
4
View file @
1895814d
...
@@ -86,6 +86,7 @@ APPROPRIATENESS_MSG = 'Now please evaluate the \
...
@@ -86,6 +86,7 @@ APPROPRIATENESS_MSG = 'Now please evaluate the \
be asked to give a reason for the score you choose.</b></span>
'
be asked to give a reason for the score you choose.</b></span>
'
APPROPRIATENESS_REASON_MSG
=
'
Please give a <b>reason for the appropriateness
\
APPROPRIATENESS_REASON_MSG
=
'
Please give a <b>reason for the appropriateness
\
score</b> you gave above. Please try to give concrete examples.
'
score</b> you gave above. Please try to give concrete examples.
'
REQT_MSG
=
'
Please type the values you obtained:
'
import
requests
import
requests
...
@@ -201,10 +202,10 @@ class MultiWozEvalWorld(MTurkTaskWorld):
...
@@ -201,10 +202,10 @@ class MultiWozEvalWorld(MTurkTaskWorld):
def
__init__
(
self
,
opt
,
agent
,
def
__init__
(
self
,
opt
,
agent
,
num_extra_trial
=
2
,
num_extra_trial
=
2
,
max_turn
=
50
,
max_turn
=
50
,
max_resp_time
=
12
0
,
max_resp_time
=
30
0
,
model_agent_opt
=
None
,
model_agent_opt
=
None
,
world_tag
=
''
,
world_tag
=
''
,
agent_timeout_shutdown
=
12
0
):
agent_timeout_shutdown
=
30
0
):
self
.
opt
=
opt
self
.
opt
=
opt
self
.
agent
=
agent
self
.
agent
=
agent
self
.
turn_idx
=
1
self
.
turn_idx
=
1
...
@@ -261,6 +262,8 @@ class MultiWozEvalWorld(MTurkTaskWorld):
...
@@ -261,6 +262,8 @@ class MultiWozEvalWorld(MTurkTaskWorld):
self
.
goal_text
+=
'
</ul>
'
self
.
goal_text
+=
'
</ul>
'
print
(
self
.
goal_text
)
print
(
self
.
goal_text
)
print
(
self
.
goal
)
self
.
final_goal
=
deepcopy
(
self
.
goal
)
self
.
state
=
deepcopy
(
self
.
goal
)
self
.
state
=
deepcopy
(
self
.
goal
)
def
_track_state
(
self
,
inp
):
def
_track_state
(
self
,
inp
):
...
@@ -403,6 +406,23 @@ class MultiWozEvalWorld(MTurkTaskWorld):
...
@@ -403,6 +406,23 @@ class MultiWozEvalWorld(MTurkTaskWorld):
if
'
text
'
in
acts
[
idx
]
and
\
if
'
text
'
in
acts
[
idx
]
and
\
acts
[
idx
][
'
text
'
]
!=
''
:
acts
[
idx
][
'
text
'
]
!=
''
:
self
.
fail_reason
=
acts
[
idx
][
'
text
'
]
self
.
fail_reason
=
acts
[
idx
][
'
text
'
]
else
:
# reqt message
for
domain
in
self
.
goal
:
if
'
reqt
'
in
self
.
goal
[
domain
]:
self
.
final_goal
[
domain
][
'
reqt
'
]
=
dict
()
for
slot
in
self
.
goal
[
domain
][
'
reqt
'
]:
control_msg
[
'
text
'
]
=
REQT_MSG
+
'
<b>
'
+
domain
+
'
-
'
+
slot
+
'
</b>
'
agent
.
observe
(
validate
(
control_msg
))
acts
[
idx
]
=
agent
.
act
(
timeout
=
self
.
max_resp_time
)
while
acts
[
idx
][
'
text
'
]
==
''
:
control_msg
[
'
text
'
]
=
'
Please try again.
'
agent
.
observe
(
validate
(
control_msg
))
acts
[
idx
]
=
agent
.
act
(
timeout
=
self
.
max_resp_time
)
if
'
text
'
in
acts
[
idx
]
and
\
acts
[
idx
][
'
text
'
]
!=
''
:
self
.
final_goal
[
domain
][
'
reqt
'
][
slot
]
=
acts
[
idx
][
'
text
'
]
# print(self.final_goal)
# Language Understanding Check
# Language Understanding Check
control_msg
[
'
text
'
]
=
UNDERSTANDING_MSG
control_msg
[
'
text
'
]
=
UNDERSTANDING_MSG
...
@@ -553,6 +573,7 @@ class MultiWozEvalWorld(MTurkTaskWorld):
...
@@ -553,6 +573,7 @@ class MultiWozEvalWorld(MTurkTaskWorld):
)
)
)
)
result
=
{
'
goal
'
:
self
.
goal
,
result
=
{
'
goal
'
:
self
.
goal
,
'
final_goal
'
:
self
.
final_goal
,
'
goal_text
'
:
self
.
goal_text
,
'
goal_text
'
:
self
.
goal_text
,
'
dialog
'
:
self
.
dialog
,
'
dialog
'
:
self
.
dialog
,
'
workers
'
:
self
.
agent
.
worker_id
,
'
workers
'
:
self
.
agent
.
worker_id
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment