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
6e3746cb
Commit
6e3746cb
authored
4 years ago
by
function2
Browse files
Options
Downloads
Patches
Plain Diff
Revert "update eval"
This reverts commit
62a7d11b
.
parent
c761fc7b
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/dst/dstc9/utils.py
+7
-6
7 additions, 6 deletions
convlab2/dst/dstc9/utils.py
with
7 additions
and
6 deletions
convlab2/dst/dstc9/utils.py
+
7
−
6
View file @
6e3746cb
import
json
import
os
import
os
import
json
import
zipfile
import
zipfile
from
copy
import
deepcopy
from
convlab2
import
DATA_ROOT
from
convlab2
import
DATA_ROOT
...
@@ -22,16 +23,16 @@ def prepare_data(subtask, split, data_root=DATA_ROOT):
...
@@ -22,16 +23,16 @@ def prepare_data(subtask, split, data_root=DATA_ROOT):
for
i
in
range
(
0
,
len
(
turns
),
2
):
for
i
in
range
(
0
,
len
(
turns
),
2
):
sys_utt
=
turns
[
i
-
1
][
'
text
'
]
if
i
else
None
sys_utt
=
turns
[
i
-
1
][
'
text
'
]
if
i
else
None
user_utt
=
turns
[
i
][
'
text
'
]
user_utt
=
turns
[
i
][
'
text
'
]
dialog_
state
=
{}
state
=
{}
for
domain_name
,
domain
in
turns
[
i
+
1
][
'
metadata
'
].
items
():
for
domain_name
,
domain
in
turns
[
i
+
1
][
'
metadata
'
].
items
():
if
domain_name
in
[
'
警察机关
'
,
'
医院
'
,
'
公共汽车
'
]:
if
domain_name
in
[
'
警察机关
'
,
'
医院
'
,
'
公共汽车
'
]:
continue
continue
state
=
{}
domain_
state
=
{}
for
slots
in
domain
.
values
():
for
slots
in
domain
.
values
():
for
slot_name
,
value
in
slots
.
items
():
for
slot_name
,
value
in
slots
.
items
():
state
[
slot_name
]
=
value
domain_
state
[
slot_name
]
=
value
dialog_
state
[
domain_name
]
=
state
state
[
domain_name
]
=
domain_
state
dialog_data
.
append
((
sys_utt
,
user_utt
,
dialog_
state
))
dialog_data
.
append
((
sys_utt
,
user_utt
,
state
))
data
[
dialog_id
]
=
dialog_data
data
[
dialog_id
]
=
dialog_data
else
:
else
:
for
dialog_id
,
dialog
in
test_data
.
items
():
for
dialog_id
,
dialog
in
test_data
.
items
():
...
...
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