parquet-converter
commited on
Commit
•
f20cfe7
1
Parent(s):
1059be3
Update parquet files
Browse files- .gitattributes +0 -28
- QR-AN.py +0 -162
- README.md +0 -45
- val_data.txt → qran_answer/qr-an-test.parquet +2 -2
- test_data.txt → qran_answer/qr-an-train.parquet +2 -2
- train_data.txt → qran_answer/qr-an-validation.parquet +2 -2
- qran_full/qr-an-test.parquet +3 -0
- qran_full/qr-an-train.parquet +3 -0
- qran_full/qr-an-validation.parquet +3 -0
- qran_generation/qr-an-test.parquet +3 -0
- qran_generation/qr-an-train.parquet +3 -0
- qran_generation/qr-an-validation.parquet +3 -0
- qran_question/qr-an-test.parquet +3 -0
- qran_question/qr-an-train.parquet +3 -0
- qran_question/qr-an-validation.parquet +3 -0
.gitattributes
DELETED
@@ -1,28 +0,0 @@
|
|
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
|
28 |
-
*.txt filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QR-AN.py
DELETED
@@ -1,162 +0,0 @@
|
|
1 |
-
import json
|
2 |
-
import os
|
3 |
-
|
4 |
-
import datasets
|
5 |
-
from datasets.tasks import TextClassification
|
6 |
-
|
7 |
-
|
8 |
-
_CITATION = None
|
9 |
-
|
10 |
-
|
11 |
-
_DESCRIPTION = """\
|
12 |
-
QR-AN Dataset: a classification dataset on french Parliament debates
|
13 |
-
This is a dataset for theme/topic classification, made of questions and answers from https://www2.assemblee-nationale.fr/recherche/resultats_questions.
|
14 |
-
It contains 188 unbalanced classes, 80k questions-answers divided into 3 splits: train (60k), val (10k) and test (10k).
|
15 |
-
"""
|
16 |
-
|
17 |
-
|
18 |
-
_LABELS = [
|
19 |
-
'administration', 'agriculture', 'agroalimentaire', 'aménagement du territoire', 'anciens combattants et victimes de guerre',
|
20 |
-
'animaux', 'aquaculture et pêche professionnelle', 'architecture', 'archives et bibliothèques', 'armes', 'arts et spectacles',
|
21 |
-
'associations', 'assurance invalidité décès', 'assurance maladie maternité : généralités', 'assurance maladie maternité : prestations',
|
22 |
-
'assurances', 'audiovisuel et communication', 'automobiles et cycles', 'avortement', 'banques et établissements financiers',
|
23 |
-
'bâtiment et travaux publics', 'baux', 'bioéthique', 'bois et forêts', "bourses d'études", 'cérémonies publiques et fêtes légales',
|
24 |
-
'chambres consulaires', 'chasse et pêche', 'chômage : indemnisation', 'collectivités territoriales', 'commerce et artisanat',
|
25 |
-
'commerce extérieur', 'communes', 'consommation', 'contributions indirectes', 'coopération intercommunale', 'copropriété',
|
26 |
-
'corps diplomatique et consulaire', "cours d'eau, étangs et lacs", 'cultes', 'culture', 'déchéances et incapacités',
|
27 |
-
'déchets, pollution et nuisances', 'décorations, insignes et emblèmes', 'défense', 'démographie', 'départements',
|
28 |
-
'donations et successions', 'drogue', 'droit pénal', "droits de l'Homme et libertés publiques", 'eau', 'économie sociale',
|
29 |
-
'éducation physique et sportive', 'élections et référendums', 'élevage', 'emploi', 'énergie et carburants', 'enfants',
|
30 |
-
'enregistrement et timbre', 'enseignement', 'enseignement : personnel', 'enseignement agricole',
|
31 |
-
'enseignement maternel et primaire', 'enseignement maternel et primaire : personnel', 'enseignement privé',
|
32 |
-
'enseignement secondaire', 'enseignement secondaire : personnel', 'enseignement supérieur',
|
33 |
-
'enseignement supérieur : personnel', 'enseignement technique et professionnel',
|
34 |
-
'enseignement technique et professionnel : personnel', 'enseignements artistiques',
|
35 |
-
'entreprises', 'environnement', 'ésotérisme', 'espace', 'établissements de santé', 'État',
|
36 |
-
'état civil', 'étrangers', 'famille', 'femmes', 'finances publiques', "fonction publique de l'État",
|
37 |
-
'fonction publique hospitalière', 'fonction publique territoriale', 'fonctionnaires et agents publics',
|
38 |
-
'formation professionnelle', "Français de l'étranger", 'frontaliers', 'gendarmerie', 'gens du voyage',
|
39 |
-
'grandes écoles', 'handicapés', 'heure légale', 'hôtellerie et restauration', 'impôt de solidarité sur la fortune',
|
40 |
-
'impôt sur le revenu', 'impôt sur les sociétés', 'impôts et taxes', 'impôts locaux', 'industrie', 'informatique',
|
41 |
-
'institutions sociales et médico-sociales', 'jeunes', 'jeux et paris', 'justice', 'langue française', 'logement',
|
42 |
-
'logement : aides et prêts', 'marchés financiers', 'marchés publics', 'matières premières', 'médecines parallèles',
|
43 |
-
'mer et littoral', 'mines et carrières', "ministères et secrétariats d'État", 'mort', 'moyens de paiement', 'nationalité',
|
44 |
-
'ordre public', 'organisations internationales', 'outre-mer', "papiers d'identité", 'Parlement',
|
45 |
-
'partis et mouvements politiques', 'patrimoine culturel', "pensions militaires d'invalidité", 'personnes âgées',
|
46 |
-
'pharmacie et médicaments', 'plus-values : imposition', 'police', 'politique économique', 'politique extérieure',
|
47 |
-
'politique sociale', 'politiques communautaires', 'postes', 'préretraites', 'presse et livres', 'prestations familiales',
|
48 |
-
'produits dangereux', 'professions de santé', 'professions immobilières', 'professions judiciaires et juridiques',
|
49 |
-
'professions libérales', 'professions sociales', 'propriété', 'propriété intellectuelle', 'publicité', 'rapatriés',
|
50 |
-
'recherche', 'régions', 'relations internationales', 'retraites : fonctionnaires civils et militaires',
|
51 |
-
'retraites : généralités', 'retraites : régime agricole', 'retraites : régime général', 'retraites : régimes autonomes et spéciaux',
|
52 |
-
'risques professionnels', 'saisies et sûretés', 'sang et organes humains', 'santé', 'secteur public', 'sécurité publique',
|
53 |
-
'sécurité routière', 'sécurité sociale', 'services', 'sociétés', 'sports', 'syndicats', 'système pénitentiaire', 'taxis',
|
54 |
-
'télécommunications', 'tourisme et loisirs', 'traités et conventions', 'transports', 'transports aériens',
|
55 |
-
'transports ferroviaires', 'transports par eau', 'transports routiers', 'transports urbains', 'travail', 'TVA',
|
56 |
-
'Union européenne', 'urbanisme', 'ventes et échanges', 'voirie'
|
57 |
-
]
|
58 |
-
|
59 |
-
|
60 |
-
class QRANConfig(datasets.BuilderConfig):
|
61 |
-
"""BuilderConfig for QR-AN."""
|
62 |
-
|
63 |
-
def __init__(self, **kwargs):
|
64 |
-
"""BuilderConfig for QR-AN.
|
65 |
-
Args:
|
66 |
-
**kwargs: keyword arguments forwarded to super.
|
67 |
-
"""
|
68 |
-
super(QRANConfig, self).__init__(**kwargs)
|
69 |
-
|
70 |
-
|
71 |
-
class QRANDataset(datasets.GeneratorBasedBuilder):
|
72 |
-
"""QR-AN Dataset: Topic dataset on french Parliament questions-answers."""
|
73 |
-
|
74 |
-
_DOWNLOAD_URL = "https://huggingface.co/datasets/cassandra-themis/QR-AN/resolve/main/"
|
75 |
-
|
76 |
-
_TRAIN_FILE = "train_data.txt"
|
77 |
-
_VAL_FILE = "val_data.txt"
|
78 |
-
_TEST_FILE = "test_data.txt"
|
79 |
-
_LABELS_DICT = {label: i for i, label in enumerate(_LABELS)}
|
80 |
-
|
81 |
-
BUILDER_CONFIGS = [
|
82 |
-
QRANConfig(
|
83 |
-
name="qran_answer",
|
84 |
-
version=datasets.Version("1.0.0"),
|
85 |
-
description="QRAN Dataset: A classification task of French Parliament questions-answers",
|
86 |
-
),
|
87 |
-
QRANConfig(
|
88 |
-
name="qran_question",
|
89 |
-
version=datasets.Version("1.0.0"),
|
90 |
-
description="QRAN Dataset: A classification task of French Parliament questions-answers",
|
91 |
-
),
|
92 |
-
QRANConfig(
|
93 |
-
name="qran_full",
|
94 |
-
version=datasets.Version("1.0.0"),
|
95 |
-
description="QRAN Dataset: A classification task of French Parliament questions-answers",
|
96 |
-
),
|
97 |
-
QRANConfig(
|
98 |
-
name="qran_generation",
|
99 |
-
version=datasets.Version("1.0.0"),
|
100 |
-
description="QRAN Dataset: A generation task of French Parliament questions-answers",
|
101 |
-
)
|
102 |
-
]
|
103 |
-
|
104 |
-
DEFAULT_CONFIG_NAME = "qran_answer"
|
105 |
-
|
106 |
-
def _info(self):
|
107 |
-
if self.config.name == "qran_generation":
|
108 |
-
features = {
|
109 |
-
"question": datasets.Value("string"),
|
110 |
-
"answer": datasets.Value("string"),
|
111 |
-
}
|
112 |
-
else:
|
113 |
-
features = {
|
114 |
-
"text": datasets.Value("string"),
|
115 |
-
"label": datasets.features.ClassLabel(names=_LABELS),
|
116 |
-
}
|
117 |
-
|
118 |
-
return datasets.DatasetInfo(
|
119 |
-
description=_DESCRIPTION,
|
120 |
-
features=datasets.Features(features),
|
121 |
-
supervised_keys=None,
|
122 |
-
citation=_CITATION,
|
123 |
-
)
|
124 |
-
|
125 |
-
|
126 |
-
def _split_generators(self, dl_manager):
|
127 |
-
train_path = dl_manager.download_and_extract(self._TRAIN_FILE)
|
128 |
-
val_path = dl_manager.download_and_extract(self._VAL_FILE)
|
129 |
-
test_path = dl_manager.download_and_extract(self._TEST_FILE)
|
130 |
-
|
131 |
-
return [
|
132 |
-
datasets.SplitGenerator(
|
133 |
-
name=datasets.Split.TRAIN, gen_kwargs={"filepath": train_path}
|
134 |
-
),
|
135 |
-
datasets.SplitGenerator(
|
136 |
-
name=datasets.Split.VALIDATION, gen_kwargs={"filepath": val_path}
|
137 |
-
),
|
138 |
-
datasets.SplitGenerator(
|
139 |
-
name=datasets.Split.TEST, gen_kwargs={"filepath": test_path}
|
140 |
-
),
|
141 |
-
]
|
142 |
-
|
143 |
-
def _generate_examples(self, filepath):
|
144 |
-
"""Generate QRAN examples."""
|
145 |
-
with open(filepath, encoding="utf-8") as f:
|
146 |
-
for id_, row in enumerate(f):
|
147 |
-
data = json.loads(row)
|
148 |
-
answer, question = data["answer"], data["question"]
|
149 |
-
|
150 |
-
label = self._LABELS_DICT[data["label_name"]]
|
151 |
-
|
152 |
-
if self.config.name == "qran_generation":
|
153 |
-
yield id_, {"question": question, "answer": answer}
|
154 |
-
else:
|
155 |
-
if self.config.name == "qran_answer":
|
156 |
-
text = answer
|
157 |
-
elif self.config.name == "qran_question":
|
158 |
-
text = question
|
159 |
-
else:
|
160 |
-
text = question + " " + answer
|
161 |
-
yield id_, {"text": text, "label": label}
|
162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
---
|
2 |
-
language:
|
3 |
-
- fr
|
4 |
-
size_categories: 10K<n<100K
|
5 |
-
task_categories:
|
6 |
-
- summarization
|
7 |
-
- text-classification
|
8 |
-
- text-generation
|
9 |
-
task_ids:
|
10 |
-
- multi-class-classification
|
11 |
-
- topic-classification
|
12 |
-
tags:
|
13 |
-
- conditional-text-generation
|
14 |
-
---
|
15 |
-
|
16 |
-
**QR-AN Dataset: a classification and generation dataset of french Parliament questions-answers.**
|
17 |
-
|
18 |
-
This is a dataset for theme/topic classification, made of questions and answers from https://www2.assemblee-nationale.fr/recherche/resultats_questions . \
|
19 |
-
|
20 |
-
It contains 188 unbalanced classes, 80k questions-answers divided into 3 splits: train (60k), val (10k) and test (10k). \
|
21 |
-
|
22 |
-
Can be used for generation with 'qran_generation'
|
23 |
-
This dataset is compatible with the [`run_summarization.py`](https://github.com/huggingface/transformers/tree/master/examples/pytorch/summarization) script from Transformers if you add this line to the `summarization_name_mapping` variable:
|
24 |
-
```python
|
25 |
-
"ccdv/cass-summarization": ("question", "answer")
|
26 |
-
```
|
27 |
-
|
28 |
-
Compatible with [run_glue.py](https://github.com/huggingface/transformers/tree/master/examples/pytorch/text-classification) script:
|
29 |
-
```
|
30 |
-
export MODEL_NAME=camembert-base
|
31 |
-
export MAX_SEQ_LENGTH=512
|
32 |
-
|
33 |
-
python run_glue.py \
|
34 |
-
--model_name_or_path $MODEL_NAME \
|
35 |
-
--dataset_name cassandra-themis/QR-AN \
|
36 |
-
--do_train \
|
37 |
-
--do_eval \
|
38 |
-
--max_seq_length $MAX_SEQ_LENGTH \
|
39 |
-
--per_device_train_batch_size 8 \
|
40 |
-
--gradient_accumulation_steps 4 \
|
41 |
-
--learning_rate 2e-5 \
|
42 |
-
--num_train_epochs 1 \
|
43 |
-
--max_eval_samples 500 \
|
44 |
-
--output_dir tmp/QR-AN
|
45 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val_data.txt → qran_answer/qr-an-test.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4089c5f2a8e38a1eabf35cd11066643d8402fd5055c3a0bef9cff598dc1b9f18
|
3 |
+
size 14214480
|
test_data.txt → qran_answer/qr-an-train.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e1ee282faf373e8495201c748b59be29cdb6abaabca78ec0f5de1ad92ee99ebf
|
3 |
+
size 90703991
|
train_data.txt → qran_answer/qr-an-validation.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ab294af5784d01be8550c0c3efdfed07432cf1d85895099700ecb3093472ccff
|
3 |
+
size 14304454
|
qran_full/qr-an-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6d384ea5f11a75642f261093362a99623401fc5f1342aea6cfe0539dbe13616a
|
3 |
+
size 21190593
|
qran_full/qr-an-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:acf148efd680257995613ea5e352769df455e990d15fb6ff1a2af6338fc685e8
|
3 |
+
size 135403202
|
qran_full/qr-an-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8956405a350d2c72e2c8566524d21fba05cf1ba94a89e385ebec008be6059592
|
3 |
+
size 21325446
|
qran_generation/qr-an-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5ffdb63cf096f9b2c27279b781818ba756aadcb59e73c08ad97497ee7142e445
|
3 |
+
size 20497182
|
qran_generation/qr-an-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:00abe706239626910a78fd4f36823dc46f2770c9f0153eb639e75a67c31a1743
|
3 |
+
size 130854921
|
qran_generation/qr-an-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4d22f4de5f332ebdef9811192456a0ec58f32db33f7af5eb3bae30f5d32f0b9c
|
3 |
+
size 20611843
|
qran_question/qr-an-test.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:75e88641933e296761a0f316ae01a3ab34c790f27b0687a007c2385358917967
|
3 |
+
size 6344863
|
qran_question/qr-an-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e4013a7f7c7b4df3deca7a8c0486cc50fa0f3f6f11c6bff0d03585c5b9c07e2e
|
3 |
+
size 40419746
|
qran_question/qr-an-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:141eea5dede95e5c15bc2367c264dd5dd0885e2637e67ac87a90489d43575166
|
3 |
+
size 6369382
|