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
00abc99a
Unverified
Commit
00abc99a
authored
Oct 23, 2020
by
Stella Biderman
Committed by
GitHub
Oct 23, 2020
Browse files
Merge pull request #51 from anishthite/master
add Wikitext2 + wikitext103 data
parents
b0db32bc
262fe250
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
lm_eval/tasks/wikitext.py
lm_eval/tasks/wikitext.py
+30
-0
No files found.
lm_eval/tasks/wikitext.py
0 → 100644
View file @
00abc99a
import
numpy
as
np
from
scipy.stats
import
pearsonr
,
spearmanr
from
sklearn.metrics
import
f1_score
,
matthews_corrcoef
from
tqdm
import
auto
as
tqdm_lib
from
.
common
import
NLP_TASK
,
simple_accuracy_metric
,
yesno
class
WikiText103
(
NLP_TASK
):
NLP_PATH
=
"wikitext"
NLP_NAME
=
"wikitext-103-raw-v1"
def
fewshot_description
(
self
):
return
""
def
doc_to_text
(
self
,
doc
,
include_target
=
True
):
return
doc
[
'text'
]
def
evaluate
(
self
,
docs
,
lm
,
provide_description
,
num_fewshot
):
pass
class
WikiText2
(
NLP_TASK
):
NLP_PATH
=
"wikitext"
NLP_NAME
=
"wikitext-2-raw-v1"
def
fewshot_description
(
self
):
return
""
def
doc_to_text
(
self
,
doc
,
include_target
=
True
):
return
doc
[
'text'
]
def
evaluate
(
self
,
docs
,
lm
,
provide_description
,
num_fewshot
):
pass
\ No newline at end of file
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