Update semi-rel.py
Browse files- semi-rel.py +2 -2
semi-rel.py
CHANGED
@@ -73,14 +73,14 @@ class semiRel(datasets.GeneratorBasedBuilder):
|
|
73 |
"path_file": dl_manager.download_and_extract(self.config.data_url), "split": "target", })]
|
74 |
|
75 |
def _generate_examples(self, path_file, split):
|
76 |
-
if split in [
|
77 |
with open(path_file, "r") as f:
|
78 |
file = json.load(f)
|
79 |
for i in range(len(file)):
|
80 |
yield i, {
|
81 |
"content": file[i]
|
82 |
}
|
83 |
-
elif split in [
|
84 |
file = pd.read_csv(path_file)
|
85 |
for i, row in file.iterrows():
|
86 |
yield i, {
|
|
|
73 |
"path_file": dl_manager.download_and_extract(self.config.data_url), "split": "target", })]
|
74 |
|
75 |
def _generate_examples(self, path_file, split):
|
76 |
+
if split in ['target']:
|
77 |
with open(path_file, "r") as f:
|
78 |
file = json.load(f)
|
79 |
for i in range(len(file)):
|
80 |
yield i, {
|
81 |
"content": file[i]
|
82 |
}
|
83 |
+
elif split in ['source']:
|
84 |
file = pd.read_csv(path_file)
|
85 |
for i, row in file.iterrows():
|
86 |
yield i, {
|