Valahaar
commited on
Commit
•
6f1c0e7
1
Parent(s):
c1bd660
added challenge support + data
Browse files
data/wmt/all/challenge/adversarial/de.jsonl.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3dda84eb03b9738d118eb2be78e246106900493c0ae07819ad60815134a8058
|
3 |
+
size 14
|
data/wmt/all/challenge/adversarial/en.jsonl.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d3dda84eb03b9738d118eb2be78e246106900493c0ae07819ad60815134a8058
|
3 |
+
size 14
|
data/wmt/all/challenge/wsd_bias/de.jsonl.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ad092ca26b5c6e6f7f97802176f5be11f22e6e4661fa6e9c2deb71b922c1df36
|
3 |
+
size 528479
|
data/wmt/all/challenge/wsd_bias/en.jsonl.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:db9a94add0144587212201bed27e957355d7cea6e0adbc2c29b0c1abcbedffc0
|
3 |
+
size 473875
|
wsdmt.py
CHANGED
@@ -10,20 +10,23 @@ def _order_langs(lang1, lang2):
|
|
10 |
|
11 |
|
12 |
class WSDMTConfig(datasets.BuilderConfig):
|
13 |
-
def __init__(self, *args, corpus, lang1, lang2, variety='base', **kwargs):
|
14 |
lang1, lang2 = _order_langs(lang1, lang2)
|
|
|
15 |
super().__init__(
|
16 |
*args,
|
17 |
-
name=f"{corpus}@{lang1}-{lang2}@{variety}",
|
18 |
**kwargs,
|
19 |
)
|
20 |
self.lang1 = lang1
|
21 |
self.lang2 = lang2
|
22 |
self.corpus = corpus
|
23 |
self.variety = variety
|
|
|
24 |
|
25 |
def path_for(self, split, lang):
|
26 |
-
|
|
|
27 |
|
28 |
|
29 |
POS_TAGS = """ADJ
|
@@ -112,10 +115,14 @@ class WSDMTDataset(datasets.GeneratorBasedBuilder):
|
|
112 |
)
|
113 |
|
114 |
def _split_generators(self, dl_manager: DownloadManager):
|
115 |
-
splits_file = dl_manager.download(f'data/{self.config.corpus}/splits.txt')
|
116 |
|
117 |
-
|
118 |
-
split_names = [
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
urls = {
|
121 |
split: {
|
|
|
10 |
|
11 |
|
12 |
class WSDMTConfig(datasets.BuilderConfig):
|
13 |
+
def __init__(self, *args, corpus, lang1, lang2, variety='base', challenge=False, **kwargs):
|
14 |
lang1, lang2 = _order_langs(lang1, lang2)
|
15 |
+
|
16 |
super().__init__(
|
17 |
*args,
|
18 |
+
name=f"{corpus}{'#challenge' if challenge is not None else ''}@{lang1}-{lang2}@{variety}",
|
19 |
**kwargs,
|
20 |
)
|
21 |
self.lang1 = lang1
|
22 |
self.lang2 = lang2
|
23 |
self.corpus = corpus
|
24 |
self.variety = variety
|
25 |
+
self.challenge = challenge
|
26 |
|
27 |
def path_for(self, split, lang):
|
28 |
+
split_path = ('challenge/' if self.challenge is not None else '') + split
|
29 |
+
return f"data/{self.corpus}/{self.variety}/{split_path}/{lang}.jsonl.bz2"
|
30 |
|
31 |
|
32 |
POS_TAGS = """ADJ
|
|
|
115 |
)
|
116 |
|
117 |
def _split_generators(self, dl_manager: DownloadManager):
|
|
|
118 |
|
119 |
+
if self.config.challenge:
|
120 |
+
split_names = ['wsd_bias', 'adversarial']
|
121 |
+
else:
|
122 |
+
splits_file = dl_manager.download(f'data/{self.config.corpus}/splits.txt')
|
123 |
+
|
124 |
+
with open(splits_file) as f:
|
125 |
+
split_names = [line.rstrip() for line in f]
|
126 |
|
127 |
urls = {
|
128 |
split: {
|