kiamehr74 commited on
Commit
af6aadf
·
1 Parent(s): f35b9c1

path bug fixed

Browse files
Files changed (1) hide show
  1. CoarseWSD-20.py +20 -11
CoarseWSD-20.py CHANGED
@@ -67,19 +67,28 @@ class CWSD20(datasets.GeneratorBasedBuilder):
67
 
68
  def _split_generators(self, dl_manager):
69
  """Returns SplitGenerators."""
70
- train_ex_path = os.path.join(_URL, self.config.name,
71
- "train.data.txt")
72
- test_ex_path = os.path.join(_URL, self.config.name,
73
- "test.data.txt")
74
- train_lb_path = os.path.join(_URL, self.config.name,
75
- "train.gold.txt")
76
- test_lb_path = os.path.join(_URL, self.config.name,
77
- "test.gold.txt")
78
-
 
 
 
 
 
 
 
 
 
79
  return [datasets.SplitGenerator(name=datasets.Split.TRAIN,
80
- gen_kwargs={"ex": train_ex_path, "lb":train_lb_path }),
81
  datasets.SplitGenerator(name=datasets.Split.TEST,
82
- gen_kwargs={"ex": test_ex_path, "lb":test_lb_path })]
83
 
84
  def _generate_examples(self, ex, lb):
85
  """Yields examples."""
 
67
 
68
  def _split_generators(self, dl_manager):
69
  """Returns SplitGenerators."""
70
+ dl = {
71
+ "train_ex":dl_manager.download_and_extract(
72
+ url_or_urls=os.path.join(_URL, self.config.name,
73
+ "train.data.txt")
74
+ ),
75
+ "train_lb":dl_manager.download_and_extract(
76
+ url_or_urls=os.path.join(_URL, self.config.name,
77
+ "train.gold.txt")
78
+ ),
79
+ "test_ex":dl_manager.download_and_extract(
80
+ url_or_urls=os.path.join(_URL, self.config.name,
81
+ "test.data.txt")
82
+ ),
83
+ "test_lb":dl_manager.download_and_extract(
84
+ url_or_urls=os.path.join(_URL, self.config.name,
85
+ "test.gold.txt")
86
+ )
87
+ }
88
  return [datasets.SplitGenerator(name=datasets.Split.TRAIN,
89
+ gen_kwargs={"ex": dl["train_ex"], "lb":dl["train_lb"] }),
90
  datasets.SplitGenerator(name=datasets.Split.TEST,
91
+ gen_kwargs={"ex": dl["test_ex"], "lb":dl["test_lb"] })]
92
 
93
  def _generate_examples(self, ex, lb):
94
  """Yields examples."""