Datasets:
Tasks:
Summarization
Modalities:
Text
Sub-tasks:
news-articles-summarization
Languages:
Hebrew
Size:
100K - 1M
License:
imvladikon
commited on
Commit
•
f01a46e
1
Parent(s):
fce1bd6
Update hebrew_news.py
Browse files- hebrew_news.py +14 -14
hebrew_news.py
CHANGED
@@ -6,6 +6,8 @@ import os.path
|
|
6 |
|
7 |
import datasets
|
8 |
from urllib.parse import urlparse
|
|
|
|
|
9 |
|
10 |
_CITATION = """
|
11 |
"""
|
@@ -66,17 +68,15 @@ class HebrewNews(datasets.GeneratorBasedBuilder):
|
|
66 |
|
67 |
def _generate_examples(self, archive_iter):
|
68 |
for filepath, f in archive_iter:
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
}
|
82 |
-
|
|
|
6 |
|
7 |
import datasets
|
8 |
from urllib.parse import urlparse
|
9 |
+
import io
|
10 |
+
|
11 |
|
12 |
_CITATION = """
|
13 |
"""
|
|
|
68 |
|
69 |
def _generate_examples(self, archive_iter):
|
70 |
for filepath, f in archive_iter:
|
71 |
+
csv_file = io.TextIOWrapper(f, encoding="utf-8")
|
72 |
+
fieldnames = ["articleBody", "description", "headline", "title"]
|
73 |
+
reader = csv.DictReader(csv_file, delimiter=",", fieldnames=fieldnames)
|
74 |
+
next(reader)
|
75 |
+
for idx, row in enumerate(reader):
|
76 |
+
yield idx, {
|
77 |
+
"id": idx,
|
78 |
+
"articleBody": row["articleBody"],
|
79 |
+
"description": row["description"],
|
80 |
+
"headline": row["headline"],
|
81 |
+
"title": row["title"],
|
82 |
+
}
|
|
|
|