evaluateCoQA.py 526 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

from ...base import Dataset
import os
import json
class CoQA(Dataset):
    def training_docs(self):
        pass

    def validation_docs(self):
        pass
    
    def test_docs(self):
        pass
    
    def fewshot_examples(self, k):
        traindocs = list(self.training_docs())
        random.seed(123)
        random.shuffle(traindocs)

        return traindocs[:k]
    
    def fewshot_description(self):
        pass

    def doc_to_text(self, doc, include_target=True):
        json.load(open(doc))