Datasets:
tau
/

Modalities:
Text
Libraries:
Datasets
yuvalkirstain commited on
Commit
1d42c5e
·
1 Parent(s): c6ded99

word level datasets

Browse files
Files changed (2) hide show
  1. configs/super_glue.py +24 -12
  2. fs.py +19 -9
configs/super_glue.py CHANGED
@@ -3,22 +3,11 @@ from typing import Optional, Union
3
  from configs.fs import FSConfig
4
 
5
 
6
- class BoolQConfig(FSConfig):
7
- def __init__(self, **kwargs):
8
- super().__init__(**kwargs)
9
-
10
  @property
11
  def id_key(self) -> str:
12
  return "idx"
13
 
14
- @property
15
- def source_key(self) -> str:
16
- return "passage"
17
-
18
- @property
19
- def question_key(self) -> Union[str, None]:
20
- return "question"
21
-
22
  @property
23
  def target_key(self) -> str:
24
  return "label"
@@ -34,3 +23,26 @@ class BoolQConfig(FSConfig):
34
  @property
35
  def test_file(self) -> str:
36
  return "test.jsonl"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  from configs.fs import FSConfig
4
 
5
 
6
+ class SuperGLUEConfig(FSConfig):
 
 
 
7
  @property
8
  def id_key(self) -> str:
9
  return "idx"
10
 
 
 
 
 
 
 
 
 
11
  @property
12
  def target_key(self) -> str:
13
  return "label"
 
23
  @property
24
  def test_file(self) -> str:
25
  return "test.jsonl"
26
+
27
+
28
+ class BoolQConfig(SuperGLUEConfig):
29
+
30
+ @property
31
+ def source_key(self) -> str:
32
+ return "passage"
33
+
34
+ @property
35
+ def question_key(self) -> Union[str, None]:
36
+ return "question"
37
+
38
+
39
+ class RTEConfig(SuperGLUEConfig):
40
+
41
+ # TODO HACK - we treat premise == source, hypothesis == question
42
+ @property
43
+ def source_key(self) -> str:
44
+ return "premise"
45
+
46
+ @property
47
+ def question_key(self) -> Union[str, None]:
48
+ return "hypothesis"
fs.py CHANGED
@@ -10,13 +10,31 @@ from citations_and_descriptions import (
10
  )
11
  from configs.arxiv import ArxivConfig
12
  from configs.scrolls import ScrollsConfig
13
- from configs.super_glue import BoolQConfig
14
 
15
 
16
  class FS(datasets.GeneratorBasedBuilder):
17
  """The SCROLLS benchmark."""
18
  DEFAULT_WRITER_BATCH_SIZE = 1000 # because Narrative QA is a rather large dataset
19
  BUILDER_CONFIGS = [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  ScrollsConfig(
21
  additional_features=["id"],
22
  name="summ_screen_fd_debug",
@@ -41,14 +59,6 @@ class FS(datasets.GeneratorBasedBuilder):
41
  citation=_ARXIV_DESCRIPTION,
42
  url="https://github.com/armancohan/long-summarization"
43
  ),
44
- BoolQConfig(
45
- additional_features=[],
46
- name="boolq",
47
- description="", # TODO
48
- data_url="https://dl.fbaipublicfiles.com/glue/superglue/data/v2/BoolQ.zip",
49
- citation=_ARXIV_DESCRIPTION,
50
- url="" # TODO
51
- )
52
  ]
53
 
54
  def _info(self):
 
10
  )
11
  from configs.arxiv import ArxivConfig
12
  from configs.scrolls import ScrollsConfig
13
+ from configs.super_glue import BoolQConfig, RTEConfig
14
 
15
 
16
  class FS(datasets.GeneratorBasedBuilder):
17
  """The SCROLLS benchmark."""
18
  DEFAULT_WRITER_BATCH_SIZE = 1000 # because Narrative QA is a rather large dataset
19
  BUILDER_CONFIGS = [
20
+ # word level
21
+ BoolQConfig(
22
+ additional_features=[],
23
+ name="boolq",
24
+ description="", # TODO
25
+ data_url="https://dl.fbaipublicfiles.com/glue/superglue/data/v2/BoolQ.zip",
26
+ citation="", # TODO
27
+ url="" # TODO
28
+ ),
29
+ RTEConfig(
30
+ additional_features=[],
31
+ name="rte",
32
+ description="", # TODO
33
+ data_url="https://dl.fbaipublicfiles.com/glue/superglue/data/v2/RTE.zip",
34
+ citation="", # TODO
35
+ url=""
36
+ ),
37
+ # paragraph level
38
  ScrollsConfig(
39
  additional_features=["id"],
40
  name="summ_screen_fd_debug",
 
59
  citation=_ARXIV_DESCRIPTION,
60
  url="https://github.com/armancohan/long-summarization"
61
  ),
 
 
 
 
 
 
 
 
62
  ]
63
 
64
  def _info(self):