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
gaoqiong
lm-evaluation-harness
Commits
3eb3d8b7
Commit
3eb3d8b7
authored
Apr 27, 2022
by
Zdenek Kasner
Browse files
e2e_nlg_cleaned: Exclude QA prompts for now
parent
256a800a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
lm_eval/tasks/e2e_nlg_cleaned.py
lm_eval/tasks/e2e_nlg_cleaned.py
+10
-1
No files found.
lm_eval/tasks/e2e_nlg_cleaned.py
View file @
3eb3d8b7
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
Semantic Noise Matters for Neural Natural Language Generation
Semantic Noise Matters for Neural Natural Language Generation
http://arxiv.org/abs/1911.03905
http://arxiv.org/abs/1911.03905
A cleaned version of the dataset from the E2E NLG Challenge. The dataset contains MR with restaurant attributes and corresponding descriptions.
A cleaned version of the dataset from the E2E NLG Challenge.
The dataset contains MR with restaurant attributes and corresponding descriptions.
Homepage: https://github.com/tuetschek/e2e-cleaning
Homepage: https://github.com/tuetschek/e2e-cleaning
"""
"""
...
@@ -59,6 +60,14 @@ class E2E_NLG_Cleaned(PromptSourceTask):
...
@@ -59,6 +60,14 @@ class E2E_NLG_Cleaned(PromptSourceTask):
def
stopping_criteria
(
self
):
def
stopping_criteria
(
self
):
return
'
\n
'
return
'
\n
'
def
max_generation_length
(
self
):
# TODO check
return
512
def
invalid_doc_for_prompt
(
self
,
doc
)
->
bool
:
"""The QA prompts are not applicable to all the examples, we want to filter these out."""
return
self
.
prompt
.
name
.
endswith
(
"_qa"
)
def
doc_to_text
(
self
,
doc
)
->
str
:
def
doc_to_text
(
self
,
doc
)
->
str
:
# if the response is not defined in PS, the text will be an empty string
# if the response is not defined in PS, the text will be an empty string
text
=
self
.
prompt
.
apply
(
doc
)[
0
]
text
=
self
.
prompt
.
apply
(
doc
)[
0
]
...
...
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