Commit
·
5aaa650
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +139 -0
- dataset_infos.json +1 -0
- dummy/accountList/1.0.0/dummy_data.zip +3 -0
- dummy/countryTopicAnnotation/1.0.0/dummy_data.zip +3 -0
- dummy/parallelTweets/1.0.0/dummy_data.zip +3 -0
- tweets_ar_en_parallel.py +149 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
- no-annotation
|
5 |
+
language_creators:
|
6 |
+
- found
|
7 |
+
languages:
|
8 |
+
- ar
|
9 |
+
- en
|
10 |
+
licenses:
|
11 |
+
- apache-2-0
|
12 |
+
multilinguality:
|
13 |
+
- translation
|
14 |
+
size_categories:
|
15 |
+
- 100K<n<1M
|
16 |
+
source_datasets:
|
17 |
+
- original
|
18 |
+
task_categories:
|
19 |
+
- other
|
20 |
+
task_ids:
|
21 |
+
- other-other-machine-translation
|
22 |
+
---
|
23 |
+
|
24 |
+
# Dataset Card for [Dataset Name]
|
25 |
+
|
26 |
+
## Table of Contents
|
27 |
+
- [Dataset Description](#dataset-description)
|
28 |
+
- [Dataset Summary](#dataset-summary)
|
29 |
+
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
30 |
+
- [Languages](#languages)
|
31 |
+
- [Dataset Structure](#dataset-structure)
|
32 |
+
- [Data Instances](#data-instances)
|
33 |
+
- [Data Fields](#data-instances)
|
34 |
+
- [Data Splits](#data-instances)
|
35 |
+
- [Dataset Creation](#dataset-creation)
|
36 |
+
- [Curation Rationale](#curation-rationale)
|
37 |
+
- [Source Data](#source-data)
|
38 |
+
- [Annotations](#annotations)
|
39 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
40 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
41 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
42 |
+
- [Discussion of Biases](#discussion-of-biases)
|
43 |
+
- [Other Known Limitations](#other-known-limitations)
|
44 |
+
- [Additional Information](#additional-information)
|
45 |
+
- [Dataset Curators](#dataset-curators)
|
46 |
+
- [Licensing Information](#licensing-information)
|
47 |
+
- [Citation Information](#citation-information)
|
48 |
+
|
49 |
+
## Dataset Description
|
50 |
+
|
51 |
+
- **Homepage:** [Bilingual Corpus of Arabic-English Parallel Tweets](https://alt.qcri.org/resources/bilingual_corpus_of_parallel_tweets)
|
52 |
+
- **Repository:**
|
53 |
+
- **Paper:** [Aclweb](https://www.aclweb.org/anthology/2020.bucc-1.3/)
|
54 |
+
- **Leaderboard:**
|
55 |
+
- **Point of Contact:**
|
56 |
+
|
57 |
+
### Dataset Summary
|
58 |
+
|
59 |
+
[More Information Needed]
|
60 |
+
|
61 |
+
### Supported Tasks and Leaderboards
|
62 |
+
|
63 |
+
[More Information Needed]
|
64 |
+
|
65 |
+
### Languages
|
66 |
+
|
67 |
+
[More Information Needed]
|
68 |
+
|
69 |
+
## Dataset Structure
|
70 |
+
|
71 |
+
### Data Instances
|
72 |
+
|
73 |
+
[More Information Needed]
|
74 |
+
|
75 |
+
### Data Fields
|
76 |
+
|
77 |
+
[More Information Needed]
|
78 |
+
|
79 |
+
### Data Splits
|
80 |
+
|
81 |
+
[More Information Needed]
|
82 |
+
|
83 |
+
## Dataset Creation
|
84 |
+
|
85 |
+
### Curation Rationale
|
86 |
+
|
87 |
+
[More Information Needed]
|
88 |
+
|
89 |
+
### Source Data
|
90 |
+
|
91 |
+
#### Initial Data Collection and Normalization
|
92 |
+
|
93 |
+
[More Information Needed]
|
94 |
+
|
95 |
+
#### Who are the source language producers?
|
96 |
+
|
97 |
+
[More Information Needed]
|
98 |
+
|
99 |
+
### Annotations
|
100 |
+
|
101 |
+
#### Annotation process
|
102 |
+
|
103 |
+
[More Information Needed]
|
104 |
+
|
105 |
+
#### Who are the annotators?
|
106 |
+
|
107 |
+
[More Information Needed]
|
108 |
+
|
109 |
+
### Personal and Sensitive Information
|
110 |
+
|
111 |
+
[More Information Needed]
|
112 |
+
|
113 |
+
## Considerations for Using the Data
|
114 |
+
|
115 |
+
### Social Impact of Dataset
|
116 |
+
|
117 |
+
[More Information Needed]
|
118 |
+
|
119 |
+
### Discussion of Biases
|
120 |
+
|
121 |
+
[More Information Needed]
|
122 |
+
|
123 |
+
### Other Known Limitations
|
124 |
+
|
125 |
+
[More Information Needed]
|
126 |
+
|
127 |
+
## Additional Information
|
128 |
+
|
129 |
+
### Dataset Curators
|
130 |
+
|
131 |
+
[More Information Needed]
|
132 |
+
|
133 |
+
### Licensing Information
|
134 |
+
|
135 |
+
[More Information Needed]
|
136 |
+
|
137 |
+
### Citation Information
|
138 |
+
|
139 |
+
[More Information Needed]
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"parallelTweets": {"description": " Twitter users often post parallel tweets\u2014tweets that contain the same content but are\n written in different languages. Parallel tweets can be an important resource for developing\n machine translation (MT) systems among other natural language processing (NLP) tasks. This\n resource is a result of a generic method for collecting parallel tweets. Using the method,\n we compiled a bilingual corpus of English-Arabic parallel tweets and a list of Twitter accounts\n who post English-Arabic tweets regularly. Additionally, we annotate a subset of Twitter accounts\n with their countries of origin and topic of interest, which provides insights about the population\n who post parallel tweets.\n", "citation": " @inproceedings{Mubarak2020bilingualtweets,\ntitle={Constructing a Bilingual Corpus of Parallel Tweets},\nauthor={Mubarak, Hamdy and Hassan, Sabit and Abdelali, Ahmed},\nbooktitle={Proceedings of 13th Workshop on Building and Using Comparable Corpora (BUCC)},\naddress={Marseille, France},\nyear={2020}\n}\n", "homepage": "https://alt.qcri.org/resources/bilingual_corpus_of_parallel_tweets", "license": "", "features": {"ArabicTweetID": {"dtype": "int64", "id": null, "_type": "Value"}, "EnglishTweetID": {"dtype": "int64", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "tweets_ar_en_parallel", "config_name": "parallelTweets", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 2667296, "num_examples": 166706, "dataset_name": "tweets_ar_en_parallel"}}, "download_checksums": {"https://alt.qcri.org/wp-content/uploads/2020/08/Bilingual-Corpus-of-Arabic-English-Parallel-Tweets.zip": {"num_bytes": 2937626, "checksum": "a2a20772745825c2e0180699083517128519975d85ec30f451aa5450209996e4"}}, "download_size": 2937626, "post_processing_size": null, "dataset_size": 2667296, "size_in_bytes": 5604922}, "accountList": {"description": " Twitter users often post parallel tweets\u2014tweets that contain the same content but are\n written in different languages. Parallel tweets can be an important resource for developing\n machine translation (MT) systems among other natural language processing (NLP) tasks. This\n resource is a result of a generic method for collecting parallel tweets. Using the method,\n we compiled a bilingual corpus of English-Arabic parallel tweets and a list of Twitter accounts\n who post English-Arabic tweets regularly. Additionally, we annotate a subset of Twitter accounts\n with their countries of origin and topic of interest, which provides insights about the population\n who post parallel tweets.\n", "citation": " @inproceedings{Mubarak2020bilingualtweets,\ntitle={Constructing a Bilingual Corpus of Parallel Tweets},\nauthor={Mubarak, Hamdy and Hassan, Sabit and Abdelali, Ahmed},\nbooktitle={Proceedings of 13th Workshop on Building and Using Comparable Corpora (BUCC)},\naddress={Marseille, France},\nyear={2020}\n}\n", "homepage": "https://alt.qcri.org/resources/bilingual_corpus_of_parallel_tweets", "license": "", "features": {"account": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "builder_name": "tweets_ar_en_parallel", "config_name": "accountList", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 20108, "num_examples": 1389, "dataset_name": "tweets_ar_en_parallel"}}, "download_checksums": {"https://alt.qcri.org/wp-content/uploads/2020/08/Bilingual-Corpus-of-Arabic-English-Parallel-Tweets.zip": {"num_bytes": 2937626, "checksum": "a2a20772745825c2e0180699083517128519975d85ec30f451aa5450209996e4"}}, "download_size": 2937626, "post_processing_size": null, "dataset_size": 20108, "size_in_bytes": 2957734}, "countryTopicAnnotation": {"description": " Twitter users often post parallel tweets\u2014tweets that contain the same content but are\n written in different languages. Parallel tweets can be an important resource for developing\n machine translation (MT) systems among other natural language processing (NLP) tasks. This\n resource is a result of a generic method for collecting parallel tweets. Using the method,\n we compiled a bilingual corpus of English-Arabic parallel tweets and a list of Twitter accounts\n who post English-Arabic tweets regularly. Additionally, we annotate a subset of Twitter accounts\n with their countries of origin and topic of interest, which provides insights about the population\n who post parallel tweets.\n", "citation": " @inproceedings{Mubarak2020bilingualtweets,\ntitle={Constructing a Bilingual Corpus of Parallel Tweets},\nauthor={Mubarak, Hamdy and Hassan, Sabit and Abdelali, Ahmed},\nbooktitle={Proceedings of 13th Workshop on Building and Using Comparable Corpora (BUCC)},\naddress={Marseille, France},\nyear={2020}\n}\n", "homepage": "https://alt.qcri.org/resources/bilingual_corpus_of_parallel_tweets", "license": "", "features": {"account": {"dtype": "string", "id": null, "_type": "Value"}, "country": {"num_classes": 12, "names": ["QA", "BH", "AE", "OM", "SA", "PL", "JO", "IQ", "Other", "EG", "KW", "SY"], "names_file": null, "id": null, "_type": "ClassLabel"}, "topic": {"num_classes": 12, "names": ["Gov", "Culture", "Education", "Sports", "Travel", "Events", "Business", "Science", "Politics", "Health", "Governoment", "Media"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "tweets_ar_en_parallel", "config_name": "countryTopicAnnotation", "version": {"version_str": "1.0.0", "description": "", "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 6036, "num_examples": 200, "dataset_name": "tweets_ar_en_parallel"}}, "download_checksums": {"https://alt.qcri.org/wp-content/uploads/2020/08/Bilingual-Corpus-of-Arabic-English-Parallel-Tweets.zip": {"num_bytes": 2937626, "checksum": "a2a20772745825c2e0180699083517128519975d85ec30f451aa5450209996e4"}}, "download_size": 2937626, "post_processing_size": null, "dataset_size": 6036, "size_in_bytes": 2943662}}
|
dummy/accountList/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4683b40fca092fe560763dc9a8cfeeac17f711b07b6fa5c8ce04cd0b75f74b52
|
3 |
+
size 2039
|
dummy/countryTopicAnnotation/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4683b40fca092fe560763dc9a8cfeeac17f711b07b6fa5c8ce04cd0b75f74b52
|
3 |
+
size 2039
|
dummy/parallelTweets/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c06e1d7766a973a450aa02dbb405b40913e5be83e2655c95f8892ccbeb460693
|
3 |
+
size 2039
|
tweets_ar_en_parallel.py
ADDED
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Bilingual Corpus of Arabic-English Parallel Tweets"""
|
2 |
+
|
3 |
+
from __future__ import absolute_import, division, print_function
|
4 |
+
|
5 |
+
import os
|
6 |
+
|
7 |
+
import pandas as pd
|
8 |
+
|
9 |
+
import datasets
|
10 |
+
|
11 |
+
|
12 |
+
_CITATION = """\
|
13 |
+
@inproceedings{Mubarak2020bilingualtweets,
|
14 |
+
title={Constructing a Bilingual Corpus of Parallel Tweets},
|
15 |
+
author={Mubarak, Hamdy and Hassan, Sabit and Abdelali, Ahmed},
|
16 |
+
booktitle={Proceedings of 13th Workshop on Building and Using Comparable Corpora (BUCC)},
|
17 |
+
address={Marseille, France},
|
18 |
+
year={2020}
|
19 |
+
}
|
20 |
+
"""
|
21 |
+
|
22 |
+
_DESCRIPTION = """\
|
23 |
+
Twitter users often post parallel tweets—tweets that contain the same content but are
|
24 |
+
written in different languages. Parallel tweets can be an important resource for developing
|
25 |
+
machine translation (MT) systems among other natural language processing (NLP) tasks. This
|
26 |
+
resource is a result of a generic method for collecting parallel tweets. Using the method,
|
27 |
+
we compiled a bilingual corpus of English-Arabic parallel tweets and a list of Twitter accounts
|
28 |
+
who post English-Arabic tweets regularly. Additionally, we annotate a subset of Twitter accounts
|
29 |
+
with their countries of origin and topic of interest, which provides insights about the population
|
30 |
+
who post parallel tweets.
|
31 |
+
"""
|
32 |
+
|
33 |
+
_URL = "https://alt.qcri.org/resources/bilingual_corpus_of_parallel_tweets"
|
34 |
+
|
35 |
+
_DATA_URL = "https://alt.qcri.org/wp-content/uploads/2020/08/Bilingual-Corpus-of-Arabic-English-Parallel-Tweets.zip"
|
36 |
+
|
37 |
+
|
38 |
+
class ParallelTweetsConfig(datasets.BuilderConfig):
|
39 |
+
"""BuilderConfig for Arabic-English Parallel Tweets"""
|
40 |
+
|
41 |
+
def __init__(self, description, data_url, citation, url, **kwrags):
|
42 |
+
"""
|
43 |
+
Args:
|
44 |
+
description: `string`, brief description of the dataset
|
45 |
+
data_url: `dictionary`, dict with url for each split of data.
|
46 |
+
citation: `string`, citation for the dataset.
|
47 |
+
url: `string`, url for information about the dataset.
|
48 |
+
**kwrags: keyword arguments frowarded to super
|
49 |
+
"""
|
50 |
+
super(ParallelTweetsConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwrags)
|
51 |
+
self.description = description
|
52 |
+
self.data_url = data_url
|
53 |
+
self.citation = citation
|
54 |
+
self.url = url
|
55 |
+
|
56 |
+
|
57 |
+
class TweetsArEnParallel(datasets.GeneratorBasedBuilder):
|
58 |
+
BUILDER_CONFIGS = [
|
59 |
+
ParallelTweetsConfig(name=name, description=_DESCRIPTION, data_url=_DATA_URL, citation=_CITATION, url=_URL)
|
60 |
+
for name in ["parallelTweets", "accountList", "countryTopicAnnotation"]
|
61 |
+
]
|
62 |
+
BUILDER_CONFIG_CLASS = ParallelTweetsConfig
|
63 |
+
|
64 |
+
def _info(self):
|
65 |
+
features = {}
|
66 |
+
if self.config.name == "parallelTweets":
|
67 |
+
features["ArabicTweetID"] = datasets.Value("int64")
|
68 |
+
features["EnglishTweetID"] = datasets.Value("int64")
|
69 |
+
if self.config.name == "accountList":
|
70 |
+
features["account"] = datasets.Value("string")
|
71 |
+
if self.config.name == "countryTopicAnnotation":
|
72 |
+
features["account"] = datasets.Value("string")
|
73 |
+
countries = ["QA", "BH", "AE", "OM", "SA", "PL", "JO", "IQ", "Other", "EG", "KW", "SY"]
|
74 |
+
features["country"] = datasets.features.ClassLabel(names=countries)
|
75 |
+
topics = [
|
76 |
+
"Gov",
|
77 |
+
"Culture",
|
78 |
+
"Education",
|
79 |
+
"Sports",
|
80 |
+
"Travel",
|
81 |
+
"Events",
|
82 |
+
"Business",
|
83 |
+
"Science",
|
84 |
+
"Politics",
|
85 |
+
"Health",
|
86 |
+
"Governoment",
|
87 |
+
"Media",
|
88 |
+
]
|
89 |
+
features["topic"] = datasets.features.ClassLabel(names=topics)
|
90 |
+
return datasets.DatasetInfo(
|
91 |
+
description=_DESCRIPTION,
|
92 |
+
features=datasets.Features(features),
|
93 |
+
homepage=self.config.url,
|
94 |
+
citation=_CITATION,
|
95 |
+
)
|
96 |
+
|
97 |
+
def _split_generators(self, dl_manager):
|
98 |
+
dl_dir = dl_manager.download_and_extract(self.config.data_url)
|
99 |
+
dl_dir = os.path.join(dl_dir, "ArEnParallelTweets")
|
100 |
+
if self.config.name == "parallelTweets":
|
101 |
+
return [
|
102 |
+
datasets.SplitGenerator(
|
103 |
+
name=datasets.Split.TEST,
|
104 |
+
gen_kwargs={
|
105 |
+
"datafile": os.path.join(dl_dir, "parallelTweets.csv"),
|
106 |
+
"split": datasets.Split.TEST,
|
107 |
+
},
|
108 |
+
),
|
109 |
+
]
|
110 |
+
|
111 |
+
if self.config.name == "accountList":
|
112 |
+
return [
|
113 |
+
datasets.SplitGenerator(
|
114 |
+
name=datasets.Split.TEST,
|
115 |
+
gen_kwargs={
|
116 |
+
"datafile": os.path.join(dl_dir, "accountList.csv"),
|
117 |
+
"split": datasets.Split.TEST,
|
118 |
+
},
|
119 |
+
),
|
120 |
+
]
|
121 |
+
if self.config.name == "countryTopicAnnotation":
|
122 |
+
return [
|
123 |
+
datasets.SplitGenerator(
|
124 |
+
name=datasets.Split.TEST,
|
125 |
+
gen_kwargs={
|
126 |
+
"datafile": os.path.join(dl_dir, "countryTopicAnnotation.csv"),
|
127 |
+
"split": datasets.Split.TEST,
|
128 |
+
},
|
129 |
+
),
|
130 |
+
]
|
131 |
+
|
132 |
+
def _generate_examples(self, **args):
|
133 |
+
filename = args["datafile"]
|
134 |
+
if self.config.name == "parallelTweets":
|
135 |
+
df = pd.read_csv(filename)
|
136 |
+
for id_, row in df.iterrows():
|
137 |
+
yield id_, {"ArabicTweetID": row["ArabicTweetID"], "EnglishTweetID": row["EnglishTweetID"]}
|
138 |
+
|
139 |
+
if self.config.name == "accountList":
|
140 |
+
df = pd.read_csv(filename, names=["account"])
|
141 |
+
for id_, row in df.iterrows():
|
142 |
+
yield id_, {
|
143 |
+
"account": row["account"],
|
144 |
+
}
|
145 |
+
|
146 |
+
if self.config.name == "countryTopicAnnotation":
|
147 |
+
df = pd.read_csv(filename)
|
148 |
+
for id_, row in df.iterrows():
|
149 |
+
yield id_, {"account": row["Account"], "country": row["Country"], "topic": row["Topic"]}
|