Upload knessetCorpus.py
Browse files- knessetCorpus.py +5 -9
knessetCorpus.py
CHANGED
@@ -136,7 +136,7 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
136 |
name="all_features_sentences",
|
137 |
description=_AllFeaturesSentences_DESCRIPTION,
|
138 |
features=[ "_id", "knesset_number", "protocol_name", "protocol_number", "protocol_type", "session_name", "parent_session_name", "@timestamp", "protocol_date", "is_ocr_output", "sentence_id", "speaker_id", "speaker_name", "is_valid_speaker", "is_chairman", "turn_num_in_protocol", "sent_num_in_turn", "sentence_text", "morphological_fields", "factuality_fields", "speaker_first_name", "speaker_last_name", "speaker_is_knesset_member", "speaker_gender", "speaker_email", "speaker_last_updated_date", "speaker_date_of_birth", "speaker_place_of_birth","speaker_year_of_aliya", "speaker_date_of_death", "speaker_mother_tongue", "speaker_religion", "speaker_nationality", "speaker_religious_orientation", "speaker_residence", "speaker_factions_memberships", "speaker_languages", "speaker_sources", "speaker_notes","faction_id", "faction_general_name", "knesset_faction_id", "current_faction_name", "faction_popular_initials", "faction_active_periods", "faction_knesset_numbers","faction_coalition_or_opposition_memberships", "faction_political_orientation", "faction_other_names", "faction_notes", "faction_wiki_link"],
|
139 |
-
data_urls=["https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/
|
140 |
citation=_KnessetCorpus_CITATION,
|
141 |
),
|
142 |
KnessetCorpusConfig(
|
@@ -156,15 +156,14 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
156 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
157 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
158 |
data_urls=[
|
159 |
-
"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/
|
160 |
-
"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/no_morph_plenary_full_sentences.jsonl.bz2"],
|
161 |
citation=_KnessetCorpus_CITATION,
|
162 |
),
|
163 |
KnessetCorpusConfig(
|
164 |
name="committees_all_features_sentences",
|
165 |
description=_AllFeaturesSentences_DESCRIPTION,
|
166 |
features=[ "_id", "knesset_number", "protocol_name", "protocol_number", "protocol_type", "session_name", "parent_session_name", "@timestamp", "protocol_date", "is_ocr_output", "sentence_id", "speaker_id", "speaker_name", "is_valid_speaker", "is_chairman", "turn_num_in_protocol", "sent_num_in_turn", "sentence_text", "morphological_fields", "factuality_fields", "speaker_first_name", "speaker_last_name", "speaker_is_knesset_member", "speaker_gender", "speaker_email", "speaker_last_updated_date", "speaker_date_of_birth", "speaker_place_of_birth","speaker_year_of_aliya", "speaker_date_of_death", "speaker_mother_tongue", "speaker_religion", "speaker_nationality", "speaker_religious_orientation", "speaker_residence", "speaker_factions_memberships", "speaker_languages", "speaker_sources", "speaker_notes","faction_id", "faction_general_name", "knesset_faction_id", "current_faction_name", "faction_popular_initials", "faction_active_periods", "faction_knesset_numbers","faction_coalition_or_opposition_memberships", "faction_political_orientation", "faction_other_names", "faction_notes", "faction_wiki_link"],
|
167 |
-
data_urls=["https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/
|
168 |
citation=_KnessetCorpus_CITATION,
|
169 |
),
|
170 |
KnessetCorpusConfig(
|
@@ -183,9 +182,7 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
183 |
"faction_popular_initials", "faction_active_periods", "faction_knesset_numbers",
|
184 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
185 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
186 |
-
data_urls=[
|
187 |
-
"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/no_morph_committee_full_sentences.jsonl.bz2",
|
188 |
-
"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/no_morph_plenary_full_sentences.jsonl.bz2"],
|
189 |
citation=_KnessetCorpus_CITATION,
|
190 |
),
|
191 |
KnessetCorpusConfig(
|
@@ -205,7 +202,7 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
205 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
206 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
207 |
data_urls=[
|
208 |
-
"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/
|
209 |
citation=_KnessetCorpus_CITATION,
|
210 |
),
|
211 |
KnessetCorpusConfig(
|
@@ -349,7 +346,6 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
349 |
]
|
350 |
|
351 |
def _generate_examples(self, data_files):
|
352 |
-
print(f'data_files:{data_files}')
|
353 |
if "all_features_sentences" in self.config.name:
|
354 |
id_field_name = "sentence_id"
|
355 |
elif self.config.name == "protocols":
|
|
|
136 |
name="all_features_sentences",
|
137 |
description=_AllFeaturesSentences_DESCRIPTION,
|
138 |
features=[ "_id", "knesset_number", "protocol_name", "protocol_number", "protocol_type", "session_name", "parent_session_name", "@timestamp", "protocol_date", "is_ocr_output", "sentence_id", "speaker_id", "speaker_name", "is_valid_speaker", "is_chairman", "turn_num_in_protocol", "sent_num_in_turn", "sentence_text", "morphological_fields", "factuality_fields", "speaker_first_name", "speaker_last_name", "speaker_is_knesset_member", "speaker_gender", "speaker_email", "speaker_last_updated_date", "speaker_date_of_birth", "speaker_place_of_birth","speaker_year_of_aliya", "speaker_date_of_death", "speaker_mother_tongue", "speaker_religion", "speaker_nationality", "speaker_religious_orientation", "speaker_residence", "speaker_factions_memberships", "speaker_languages", "speaker_sources", "speaker_notes","faction_id", "faction_general_name", "knesset_faction_id", "current_faction_name", "faction_popular_initials", "faction_active_periods", "faction_knesset_numbers","faction_coalition_or_opposition_memberships", "faction_political_orientation", "faction_other_names", "faction_notes", "faction_wiki_link"],
|
139 |
+
data_urls=[f"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/plenary_full_sentences_shards_bzip2_files/plenary_full_sentences_shard_{str(i).zfill(2)}.jsonl.bz2" for i in range(27)]+[f"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/plenary_full_sentences_shards_bzip2_files/plenary_full_sentences_shard_{str(i).zfill(2)}.jsonl.bz2" for i in range(27)],#TODO update number of shards
|
140 |
citation=_KnessetCorpus_CITATION,
|
141 |
),
|
142 |
KnessetCorpusConfig(
|
|
|
156 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
157 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
158 |
data_urls=[
|
159 |
+
f"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/plenary_no_morph_sentences_shards_bzip2_files/no_morph_plenary_full_sentences_shard_{str(i).zfill(2)}.jsonl.bz2" for i in range(27)]+[ f"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/committee_no_morph_sentences_shards_bzip2_files/no_morph_committee_full_sentences_shard_{str(i).zfill(2)}.jsonl.bz2" for i in range(27)],#TODO update num of shards
|
|
|
160 |
citation=_KnessetCorpus_CITATION,
|
161 |
),
|
162 |
KnessetCorpusConfig(
|
163 |
name="committees_all_features_sentences",
|
164 |
description=_AllFeaturesSentences_DESCRIPTION,
|
165 |
features=[ "_id", "knesset_number", "protocol_name", "protocol_number", "protocol_type", "session_name", "parent_session_name", "@timestamp", "protocol_date", "is_ocr_output", "sentence_id", "speaker_id", "speaker_name", "is_valid_speaker", "is_chairman", "turn_num_in_protocol", "sent_num_in_turn", "sentence_text", "morphological_fields", "factuality_fields", "speaker_first_name", "speaker_last_name", "speaker_is_knesset_member", "speaker_gender", "speaker_email", "speaker_last_updated_date", "speaker_date_of_birth", "speaker_place_of_birth","speaker_year_of_aliya", "speaker_date_of_death", "speaker_mother_tongue", "speaker_religion", "speaker_nationality", "speaker_religious_orientation", "speaker_residence", "speaker_factions_memberships", "speaker_languages", "speaker_sources", "speaker_notes","faction_id", "faction_general_name", "knesset_faction_id", "current_faction_name", "faction_popular_initials", "faction_active_periods", "faction_knesset_numbers","faction_coalition_or_opposition_memberships", "faction_political_orientation", "faction_other_names", "faction_notes", "faction_wiki_link"],
|
166 |
+
data_urls=[f"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/committee_full_sentences_shards_bzip2_files/committee_full_sentences_shard_{str(i).zfill(2)}.jsonl.bz2" for i in range(27)],#TODO update number of shards
|
167 |
citation=_KnessetCorpus_CITATION,
|
168 |
),
|
169 |
KnessetCorpusConfig(
|
|
|
182 |
"faction_popular_initials", "faction_active_periods", "faction_knesset_numbers",
|
183 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
184 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
185 |
+
data_urls=[ f"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/committee_no_morph_sentences_shards_bzip2_files/no_morph_committee_full_sentences_shard_{str(i).zfill(2)}.jsonl.bz2" for i in range(27)],#TODO update num of shards
|
|
|
|
|
186 |
citation=_KnessetCorpus_CITATION,
|
187 |
),
|
188 |
KnessetCorpusConfig(
|
|
|
202 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
203 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
204 |
data_urls=[
|
205 |
+
f"https://huggingface.co/datasets/HaifaCLGroup/KnessetCorpus/resolve/main/protocols_sentences/plenary_no_morph_sentences_shards_bzip2_files/no_morph_plenary_full_sentences_shard_{str(i).zfill(2)}.jsonl.bz2" for i in range(27)],
|
206 |
citation=_KnessetCorpus_CITATION,
|
207 |
),
|
208 |
KnessetCorpusConfig(
|
|
|
346 |
]
|
347 |
|
348 |
def _generate_examples(self, data_files):
|
|
|
349 |
if "all_features_sentences" in self.config.name:
|
350 |
id_field_name = "sentence_id"
|
351 |
elif self.config.name == "protocols":
|