"official/projects/yt8m/modeling/yt8m_model.py" did not exist on "a44be35fa6475e905955b5aeb95089737403ec22"
wikitext.py 828 Bytes
Newer Older
Anish Thite's avatar
Anish Thite committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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