Datasets:
Upload knessetCorpus.py
Browse files- knessetCorpus.py +8 -7
knessetCorpus.py
CHANGED
@@ -5,7 +5,8 @@ from huggingface_hub import hf_hub_url
|
|
5 |
|
6 |
import datasets
|
7 |
|
8 |
-
|
|
|
9 |
_KnessetCorpus_CITATION = "@misc{goldin2024knesset, title={The Knesset Corpus: An Annotated Corpus of Hebrew Parliamentary Proceedings}, author={Gili Goldin and Nick Howell and Noam Ordan and Ella Rabinovich and Shuly Wintner}, year={2024}, eprint={2405.18115}, archivePrefix={arXiv}, primaryClass={cs.CL} }"
|
10 |
|
11 |
_KnessetCorpus_DESCRIPTION = """
|
@@ -134,7 +135,7 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
134 |
name="all_features_sentences",
|
135 |
description=_AllFeaturesSentences_DESCRIPTION,
|
136 |
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"],
|
137 |
-
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(
|
138 |
citation=_KnessetCorpus_CITATION,
|
139 |
),
|
140 |
KnessetCorpusConfig(
|
@@ -154,14 +155,14 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
154 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
155 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
156 |
data_urls=[
|
157 |
-
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(
|
158 |
citation=_KnessetCorpus_CITATION,
|
159 |
),
|
160 |
KnessetCorpusConfig(
|
161 |
name="committees_all_features_sentences",
|
162 |
description=_AllFeaturesSentences_DESCRIPTION,
|
163 |
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"],
|
164 |
-
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(
|
165 |
citation=_KnessetCorpus_CITATION,
|
166 |
),
|
167 |
KnessetCorpusConfig(
|
@@ -180,7 +181,7 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
180 |
"faction_popular_initials", "faction_active_periods", "faction_knesset_numbers",
|
181 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
182 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
183 |
-
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(
|
184 |
citation=_KnessetCorpus_CITATION,
|
185 |
),
|
186 |
KnessetCorpusConfig(
|
@@ -200,14 +201,14 @@ class KnessetCorpus(datasets.GeneratorBasedBuilder):
|
|
200 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
201 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
202 |
data_urls=[
|
203 |
-
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(
|
204 |
citation=_KnessetCorpus_CITATION,
|
205 |
),
|
206 |
KnessetCorpusConfig(
|
207 |
name="plenary_all_features_sentences",
|
208 |
description=_AllFeaturesSentences_DESCRIPTION,
|
209 |
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"],
|
210 |
-
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(
|
211 |
citation=_KnessetCorpus_CITATION,
|
212 |
)]
|
213 |
|
|
|
5 |
|
6 |
import datasets
|
7 |
|
8 |
+
num_plenary_shard = 28
|
9 |
+
num_of_committee_shards = 90
|
10 |
_KnessetCorpus_CITATION = "@misc{goldin2024knesset, title={The Knesset Corpus: An Annotated Corpus of Hebrew Parliamentary Proceedings}, author={Gili Goldin and Nick Howell and Noam Ordan and Ella Rabinovich and Shuly Wintner}, year={2024}, eprint={2405.18115}, archivePrefix={arXiv}, primaryClass={cs.CL} }"
|
11 |
|
12 |
_KnessetCorpus_DESCRIPTION = """
|
|
|
135 |
name="all_features_sentences",
|
136 |
description=_AllFeaturesSentences_DESCRIPTION,
|
137 |
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"],
|
138 |
+
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(num_plenary_shard)] + [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(num_of_committee_shards)],
|
139 |
citation=_KnessetCorpus_CITATION,
|
140 |
),
|
141 |
KnessetCorpusConfig(
|
|
|
155 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
156 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
157 |
data_urls=[
|
158 |
+
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(num_plenary_shard)] + [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(num_plenary_shard)],#TODO update num of shards
|
159 |
citation=_KnessetCorpus_CITATION,
|
160 |
),
|
161 |
KnessetCorpusConfig(
|
162 |
name="committees_all_features_sentences",
|
163 |
description=_AllFeaturesSentences_DESCRIPTION,
|
164 |
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"],
|
165 |
+
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(num_of_committee_shards)],
|
166 |
citation=_KnessetCorpus_CITATION,
|
167 |
),
|
168 |
KnessetCorpusConfig(
|
|
|
181 |
"faction_popular_initials", "faction_active_periods", "faction_knesset_numbers",
|
182 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
183 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
184 |
+
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(num_of_committee_shards)],
|
185 |
citation=_KnessetCorpus_CITATION,
|
186 |
),
|
187 |
KnessetCorpusConfig(
|
|
|
201 |
"faction_coalition_or_opposition_memberships", "faction_political_orientation",
|
202 |
"faction_other_names", "faction_notes", "faction_wiki_link"],
|
203 |
data_urls=[
|
204 |
+
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(num_plenary_shard)],
|
205 |
citation=_KnessetCorpus_CITATION,
|
206 |
),
|
207 |
KnessetCorpusConfig(
|
208 |
name="plenary_all_features_sentences",
|
209 |
description=_AllFeaturesSentences_DESCRIPTION,
|
210 |
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"],
|
211 |
+
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(num_plenary_shard)],
|
212 |
citation=_KnessetCorpus_CITATION,
|
213 |
)]
|
214 |
|