ccdv commited on
Commit
4d9ded8
1 Parent(s): ecfa25a

add summarization

Browse files
Files changed (2) hide show
  1. QR-AN.py +10 -4
  2. README.md +11 -2
QR-AN.py CHANGED
@@ -92,6 +92,11 @@ class QRANDataset(datasets.GeneratorBasedBuilder):
92
  name="qran_full",
93
  version=datasets.Version("1.0.0"),
94
  description="QRAN Dataset: A classification task of French Parliament questions-answers",
 
 
 
 
 
95
  )
96
  ]
97
 
@@ -103,16 +108,14 @@ class QRANDataset(datasets.GeneratorBasedBuilder):
103
  features=datasets.Features(
104
  {
105
  "text": datasets.Value("string"),
106
- #"question": datasets.Value("string"),
107
- #"answer": datasets.Value("string"),
108
  #"label_name": datasets.Value("string"),
109
  "label": datasets.features.ClassLabel(names=_LABELS),
110
  }
111
  ),
112
  supervised_keys=None,
113
  citation=_CITATION,
114
- task_templates=[TextClassification(
115
- text_column="text", label_column="label")],
116
  )
117
 
118
  def _split_generators(self, dl_manager):
@@ -140,6 +143,9 @@ class QRANDataset(datasets.GeneratorBasedBuilder):
140
  answer, question = data["answer"], data["question"]
141
  label = self._LABELS_DICT[data["label_name"]]
142
 
 
 
 
143
  if self.config.name == "qran_answer":
144
  text = answer
145
  elif self.config.name == "qran_question":
 
92
  name="qran_full",
93
  version=datasets.Version("1.0.0"),
94
  description="QRAN Dataset: A classification task of French Parliament questions-answers",
95
+ ),
96
+ QRANConfig(
97
+ name="qran_generation",
98
+ version=datasets.Version("1.0.0"),
99
+ description="QRAN Dataset: A generation task of French Parliament questions-answers",
100
  )
101
  ]
102
 
 
108
  features=datasets.Features(
109
  {
110
  "text": datasets.Value("string"),
111
+ "question": datasets.Value("string"),
112
+ "answer": datasets.Value("string"),
113
  #"label_name": datasets.Value("string"),
114
  "label": datasets.features.ClassLabel(names=_LABELS),
115
  }
116
  ),
117
  supervised_keys=None,
118
  citation=_CITATION,
 
 
119
  )
120
 
121
  def _split_generators(self, dl_manager):
 
143
  answer, question = data["answer"], data["question"]
144
  label = self._LABELS_DICT[data["label_name"]]
145
 
146
+ if self.config.name == "qran_generation":
147
+ yield id_, {"question": question, "answer": answer}
148
+
149
  if self.config.name == "qran_answer":
150
  text = answer
151
  elif self.config.name == "qran_question":
README.md CHANGED
@@ -1,18 +1,27 @@
1
  ---
2
  languages: fr
3
- task_categories: text-classification
4
  task_ids:
5
  - multi-class-classification
6
  - topic-classification
 
 
 
 
7
  size_categories: 10K<n<100K
8
  ---
9
 
10
- **QR-AN Dataset: a classification dataset of french Parliament questions-answers.**
11
 
12
  This is a dataset for theme/topic classification, made of questions and answers from https://www2.assemblee-nationale.fr/recherche/resultats_questions . \
13
 
14
  It contains 188 unbalanced classes, 80k questions-answers divided into 3 splits: train (60k), val (10k) and test (10k). \
15
 
 
 
 
 
 
 
16
  Compatible with [run_glue.py](https://github.com/huggingface/transformers/tree/master/examples/pytorch/text-classification) script:
17
  ```
18
  export MODEL_NAME=camembert-base
 
1
  ---
2
  languages: fr
 
3
  task_ids:
4
  - multi-class-classification
5
  - topic-classification
6
+ - summarization
7
+ task_categories:
8
+ - text-classification
9
+ - conditional-text-generation
10
  size_categories: 10K<n<100K
11
  ---
12
 
13
+ **QR-AN Dataset: a classification and generation dataset of french Parliament questions-answers.**
14
 
15
  This is a dataset for theme/topic classification, made of questions and answers from https://www2.assemblee-nationale.fr/recherche/resultats_questions . \
16
 
17
  It contains 188 unbalanced classes, 80k questions-answers divided into 3 splits: train (60k), val (10k) and test (10k). \
18
 
19
+ Can be used for generation with 'qran-generation'
20
+ 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:
21
+ ```python
22
+ "ccdv/cass-summarization": ("question", "answer")
23
+ ```
24
+
25
  Compatible with [run_glue.py](https://github.com/huggingface/transformers/tree/master/examples/pytorch/text-classification) script:
26
  ```
27
  export MODEL_NAME=camembert-base