Commit
•
76f94b0
1
Parent(s):
53695c2
Convert dataset to Parquet (#2)
Browse files- Convert dataset to Parquet (e84b36c517c037ec6ac254aeebeaf4fba911c093)
- Delete loading script (22d221533ba783824e8b492b16eb0422b3480d0d)
- README.md +8 -4
- data/train-00000-of-00001.parquet +3 -0
- oclar.py +0 -98
README.md
CHANGED
@@ -19,7 +19,6 @@ task_ids:
|
|
19 |
- text-scoring
|
20 |
- sentiment-classification
|
21 |
- sentiment-scoring
|
22 |
-
paperswithcode_id: null
|
23 |
pretty_name: OCLAR
|
24 |
dataset_info:
|
25 |
features:
|
@@ -31,10 +30,15 @@ dataset_info:
|
|
31 |
dtype: int8
|
32 |
splits:
|
33 |
- name: train
|
34 |
-
num_bytes:
|
35 |
num_examples: 3916
|
36 |
-
download_size:
|
37 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
38 |
---
|
39 |
|
40 |
# Dataset Card for OCLAR
|
|
|
19 |
- text-scoring
|
20 |
- sentiment-classification
|
21 |
- sentiment-scoring
|
|
|
22 |
pretty_name: OCLAR
|
23 |
dataset_info:
|
24 |
features:
|
|
|
30 |
dtype: int8
|
31 |
splits:
|
32 |
- name: train
|
33 |
+
num_bytes: 398196
|
34 |
num_examples: 3916
|
35 |
+
download_size: 180384
|
36 |
+
dataset_size: 398196
|
37 |
+
configs:
|
38 |
+
- config_name: default
|
39 |
+
data_files:
|
40 |
+
- split: train
|
41 |
+
path: data/train-*
|
42 |
---
|
43 |
|
44 |
# Dataset Card for OCLAR
|
data/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4f32bb34a4de69303c6410e9484dd5122b91e2a271d92d44061860f7e9802ce7
|
3 |
+
size 180384
|
oclar.py
DELETED
@@ -1,98 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
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 |
-
"""Opinion Corpus for Lebanese Arabic Reviews (OCLAR) Data Set"""
|
16 |
-
|
17 |
-
|
18 |
-
import csv
|
19 |
-
|
20 |
-
import datasets
|
21 |
-
|
22 |
-
|
23 |
-
_CITATION = """
|
24 |
-
@misc{Dua:2019 ,
|
25 |
-
author = "Dua, Dheeru and Graff, Casey",
|
26 |
-
year = "2017",
|
27 |
-
title = "{UCI} Machine Learning Repository",
|
28 |
-
url = "http://archive.ics.uci.edu/ml",
|
29 |
-
institution = "University of California, Irvine, School of Information and Computer Sciences" }
|
30 |
-
|
31 |
-
@InProceedings{AlOmari2019oclar,
|
32 |
-
title = {Sentiment Classifier: Logistic Regression for Arabic Services Reviews in Lebanon},
|
33 |
-
authors={Al Omari, M., Al-Hajj, M., Hammami, N., & Sabra, A.},
|
34 |
-
year={2019}
|
35 |
-
}
|
36 |
-
"""
|
37 |
-
|
38 |
-
_DESCRIPTION = """\
|
39 |
-
The researchers of OCLAR Marwan et al. (2019), they gathered Arabic costumer reviews from Google reviewsa and Zomato
|
40 |
-
website (https://www.zomato.com/lebanon) on wide scope of domain, including restaurants, hotels, hospitals, local shops,
|
41 |
-
etc.The corpus finally contains 3916 reviews in 5-rating scale. For this research purpose, the positive class considers
|
42 |
-
rating stars from 5 to 3 of 3465 reviews, and the negative class is represented from values of 1 and 2 of about
|
43 |
-
451 texts.
|
44 |
-
"""
|
45 |
-
|
46 |
-
_HOMEPAGE = "http://archive.ics.uci.edu/ml/datasets/Opinion+Corpus+for+Lebanese+Arabic+Reviews+%28OCLAR%29#"
|
47 |
-
|
48 |
-
# TODO: Add the licence for the dataset here if you can find it
|
49 |
-
_LICENSE = ""
|
50 |
-
|
51 |
-
_URL = "http://archive.ics.uci.edu/ml/machine-learning-databases/00499/OCLAR%20-%20Opinion%20Corpus%20for%20Lebanese%20Arabic%20Reviews.csv"
|
52 |
-
|
53 |
-
|
54 |
-
class Oclar(datasets.GeneratorBasedBuilder):
|
55 |
-
"""TOpinion Corpus for Lebanese Arabic Reviews (OCLAR) corpus is utilizable for Arabic sentiment classification on
|
56 |
-
services reviews, including hotels, restaurants, shops, and others.
|
57 |
-
"""
|
58 |
-
|
59 |
-
VERSION = datasets.Version("1.1.0")
|
60 |
-
|
61 |
-
def _info(self):
|
62 |
-
return datasets.DatasetInfo(
|
63 |
-
description=_DESCRIPTION,
|
64 |
-
features=datasets.Features(
|
65 |
-
{
|
66 |
-
"pagename": datasets.Value("string"),
|
67 |
-
"review": datasets.Value("string"),
|
68 |
-
"rating": datasets.Value("int8"),
|
69 |
-
}
|
70 |
-
),
|
71 |
-
supervised_keys=None,
|
72 |
-
homepage=_HOMEPAGE,
|
73 |
-
license=_LICENSE,
|
74 |
-
citation=_CITATION,
|
75 |
-
)
|
76 |
-
|
77 |
-
def _split_generators(self, dl_manager):
|
78 |
-
"""Returns SplitGenerators."""
|
79 |
-
data_path = dl_manager.download_and_extract(_URL)
|
80 |
-
return [
|
81 |
-
datasets.SplitGenerator(
|
82 |
-
name=datasets.Split.TRAIN,
|
83 |
-
gen_kwargs={
|
84 |
-
"filepath": data_path,
|
85 |
-
"split": "train",
|
86 |
-
},
|
87 |
-
)
|
88 |
-
]
|
89 |
-
|
90 |
-
def _generate_examples(self, filepath, split):
|
91 |
-
"""Yields examples."""
|
92 |
-
with open(filepath, encoding="utf-8") as csv_file:
|
93 |
-
csv_reader = csv.reader(csv_file, delimiter=",", skipinitialspace=True)
|
94 |
-
next(csv_reader, None) # skipping headers
|
95 |
-
for id_, row in enumerate(csv_reader):
|
96 |
-
pagename, review, rating = row
|
97 |
-
rating = int(rating)
|
98 |
-
yield id_, {"pagename": pagename, "review": review, "rating": rating}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|