zhsy commited on
Commit
fa9315a
1 Parent(s): 8806a49

Update viznet.py

Browse files
Files changed (1) hide show
  1. viznet.py +8 -5
viznet.py CHANGED
@@ -17,10 +17,12 @@ class Viznet(datasets.GeneratorBasedBuilder):
17
  name="pairs",
18
  features={
19
  "source": datasets.Value("string"),
20
- "label": datasets.Value("string"),
21
  },
22
- data_url="https://huggingface.co/datasets/matchbench/viznet/resolve/main/viznet.zip"
23
  ),
 
 
24
  ]
25
 
26
  def _info(self):
@@ -38,7 +40,7 @@ class Viznet(datasets.GeneratorBasedBuilder):
38
  "source": os.path.join(path,
39
  f"viznet/{split}-source.json"),
40
  "label": os.path.join(path,
41
- f"viznet/{split}-source.json")
42
  }
43
  )
44
  for split in [
@@ -47,6 +49,7 @@ class Viznet(datasets.GeneratorBasedBuilder):
47
  datasets.Split.TEST
48
  ]
49
  ]
 
50
 
51
  def _generate_examples(self, source, label):
52
  if self.config.name == "pairs":
@@ -57,6 +60,6 @@ class Viznet(datasets.GeneratorBasedBuilder):
57
  assert len(source) == len(label)
58
  for i in range(len(source)):
59
  yield i, {
60
- "source": json.dumps(source[i]),
61
- "label": json.dumps(label[i]),
62
  }
 
17
  name="pairs",
18
  features={
19
  "source": datasets.Value("string"),
20
+ "label": datasets.Sequence(datasets.Value("string")),
21
  },
22
+ data_url="https://huggingface.co/datasets/matchbench/viznet/resolve/main/viznet.tar.gz"
23
  ),
24
+ ViznetConfig(name="source", features={"column1": datasets.Value("string")}, data_url=None),
25
+ ViznetConfig(name="target", features={"column1": datasets.Value("string")}, data_url=None),
26
  ]
27
 
28
  def _info(self):
 
40
  "source": os.path.join(path,
41
  f"viznet/{split}-source.json"),
42
  "label": os.path.join(path,
43
+ f"viznet/{split}-label.json")
44
  }
45
  )
46
  for split in [
 
49
  datasets.Split.TEST
50
  ]
51
  ]
52
+ return []
53
 
54
  def _generate_examples(self, source, label):
55
  if self.config.name == "pairs":
 
60
  assert len(source) == len(label)
61
  for i in range(len(source)):
62
  yield i, {
63
+ "source": source[i],
64
+ "label": label[i],
65
  }