Use train dictionary for val data
Browse files- wikidata_rubq.py +4 -1
wikidata_rubq.py
CHANGED
@@ -130,7 +130,10 @@ class WikidataRuBQ(datasets.GeneratorBasedBuilder):
|
|
130 |
return name
|
131 |
|
132 |
def _generate_examples(self, filepath, lang, vocab_path, split, data_dir):
|
133 |
-
|
|
|
|
|
|
|
134 |
|
135 |
with open(direct_path, 'rb') as handle:
|
136 |
direct_vocab = pickle.load(handle)
|
|
|
130 |
return name
|
131 |
|
132 |
def _generate_examples(self, filepath, lang, vocab_path, split, data_dir):
|
133 |
+
if split == 'test':
|
134 |
+
direct_path = os.path.join(data_dir, f"test_direct_vocab_wikidata_en.pkl")
|
135 |
+
else:
|
136 |
+
direct_path = os.path.join(data_dir, f"train_direct_vocab_wikidata_en.pkl")
|
137 |
|
138 |
with open(direct_path, 'rb') as handle:
|
139 |
direct_vocab = pickle.load(handle)
|