Datasets:

Languages:
Arabic
Multilinguality:
monolingual
Size Categories:
1K<n<10K
Language Creators:
found
Annotations Creators:
found
Source Datasets:
original
Tags:
License:
albertvillanova HF staff commited on
Commit
97632ec
1 Parent(s): b759b14

Delete loading script

Browse files
Files changed (1) hide show
  1. ajgt_twitter_ar.py +0 -105
ajgt_twitter_ar.py DELETED
@@ -1,105 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- # Lint as: python3
17
- """Arabic Jordanian General Tweets."""
18
-
19
-
20
- import os
21
-
22
- import openpyxl # noqa: requires this pandas optional dependency for reading xlsx files
23
- import pandas as pd
24
-
25
- import datasets
26
- from datasets.tasks import TextClassification
27
-
28
-
29
- _DESCRIPTION = """\
30
- Arabic Jordanian General Tweets (AJGT) Corpus consisted of 1,800 tweets \
31
- annotated as positive and negative. Modern Standard Arabic (MSA) or Jordanian dialect.
32
- """
33
-
34
- _CITATION = """\
35
- @inproceedings{alomari2017arabic,
36
- title={Arabic tweets sentimental analysis using machine learning},
37
- author={Alomari, Khaled Mohammad and ElSherif, Hatem M and Shaalan, Khaled},
38
- booktitle={International Conference on Industrial, Engineering and Other Applications of Applied Intelligent Systems},
39
- pages={602--610},
40
- year={2017},
41
- organization={Springer}
42
- }
43
- """
44
-
45
- _URL = "https://raw.githubusercontent.com/komari6/Arabic-twitter-corpus-AJGT/master/"
46
-
47
-
48
- class AjgtConfig(datasets.BuilderConfig):
49
- """BuilderConfig for Ajgt."""
50
-
51
- def __init__(self, **kwargs):
52
- """BuilderConfig for Ajgt.
53
-
54
- Args:
55
- **kwargs: keyword arguments forwarded to super.
56
- """
57
- super(AjgtConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
58
-
59
-
60
- class AjgtTwitterAr(datasets.GeneratorBasedBuilder):
61
- """Ajgt dataset."""
62
-
63
- BUILDER_CONFIGS = [
64
- AjgtConfig(
65
- name="plain_text",
66
- description="Plain text",
67
- )
68
- ]
69
-
70
- def _info(self):
71
- return datasets.DatasetInfo(
72
- description=_DESCRIPTION,
73
- features=datasets.Features(
74
- {
75
- "text": datasets.Value("string"),
76
- "label": datasets.features.ClassLabel(
77
- names=[
78
- "Negative",
79
- "Positive",
80
- ]
81
- ),
82
- }
83
- ),
84
- supervised_keys=None,
85
- homepage="https://github.com/komari6/Arabic-twitter-corpus-AJGT",
86
- citation=_CITATION,
87
- task_templates=[TextClassification(text_column="text", label_column="label")],
88
- )
89
-
90
- def _split_generators(self, dl_manager):
91
- urls_to_download = {
92
- "train": os.path.join(_URL, "AJGT.xlsx"),
93
- }
94
- downloaded_files = dl_manager.download(urls_to_download)
95
- return [
96
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
97
- ]
98
-
99
- def _generate_examples(self, filepath):
100
- """Generate examples."""
101
- with open(filepath, "rb") as f:
102
- df = pd.read_excel(f, engine="openpyxl")
103
- for id_, record in df.iterrows():
104
- tweet, sentiment = record["Feed"], record["Sentiment"]
105
- yield str(id_), {"text": tweet, "label": sentiment}