Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Megatron-LM
Commits
23302cb2
Commit
23302cb2
authored
Dec 07, 2021
by
zihanl
Browse files
add comments
parent
aaa7aa32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
tasks/knwl_dialo/preprocessing.py
tasks/knwl_dialo/preprocessing.py
+5
-2
No files found.
tasks/knwl_dialo/preprocessing.py
View file @
23302cb2
...
@@ -268,18 +268,21 @@ def get_database(test_datapath, train_datapath, data_type):
...
@@ -268,18 +268,21 @@ def get_database(test_datapath, train_datapath, data_type):
turns
=
splits
[
1
].
split
(
" [SEP] "
)[
-
3
:]
turns
=
splits
[
1
].
split
(
" [SEP] "
)[
-
3
:]
knowledge
=
splits
[
2
]
knowledge
=
splits
[
2
]
response
=
splits
[
3
]
response
=
splits
[
3
]
# filtering data samples
# filtering data samples
if
knowledge
==
"no_passages_used"
:
if
knowledge
==
"no_passages_used"
:
# when no knowledge is used
continue
continue
if
data_type
!=
"wow_seen"
and
(
"("
in
knowledge
or
")"
in
knowledge
):
if
data_type
!=
"wow_seen"
and
(
"("
in
knowledge
or
")"
in
knowledge
):
# when brackets existing in the knowledge
continue
continue
if
data_type
!=
"wow_seen"
and
topic
not
in
knowledge
:
if
data_type
!=
"wow_seen"
and
topic
not
in
knowledge
:
# when topic does not exist in the knowledge
continue
continue
# get the instance
# get the instance
last_turn
=
turns
[
-
1
]
last_turn
=
turns
[
-
1
]
if
data_type
==
"woi"
:
instance
=
"( "
+
last_turn
+
" ) "
+
topic
+
" => "
+
knowledge
instance
=
"( "
+
last_turn
+
" ) "
+
topic
+
" => "
+
knowledge
# construct dialog example
# construct dialog example
dialog_example
=
""
dialog_example
=
""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment