-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataset.py
35 lines (28 loc) · 932 Bytes
/
dataset.py
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
31
32
33
34
35
from typing import Dict, List
class Dataset:
article: str
options: Dict[str, List[str]]
answers: Dict[str, str]
source: str
def __init__(self, article: str, options: Dict[str, List[str]], answers: Dict[str, str], source: str, *args, **kwargs) -> None:
self.article = article
self.options = options
self.answers = answers
self.source = source
for k, v in kwargs.items():
self.__dict__[k] = v
def __str__(self):
return str({
"article": self.article,
"options": self.options,
"answers": self.answers,
"source": self.source,
})
def question_index()->List[int]:
pass
def resolve() -> List[dict]:
pass
if __name__ == "__main__":
d = Dataset(article="1331sdf", options={
"a": [1, 2, 3, 4]}, answers={"a": "a"}, source="sdf")
print(d.resolve())