mmarimon commited on
Commit
ac98a6e
1 Parent(s): 33f699c

Upload 5 files

Browse files
Files changed (6) hide show
  1. .gitattributes +1 -0
  2. README.md +183 -0
  3. dev_2k.json +0 -0
  4. paws-ca.py +100 -0
  5. test_2k.json +0 -0
  6. train.json +3 -0
.gitattributes CHANGED
@@ -53,3 +53,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
56
+ train.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ YAML tags: null
3
+ annotations_creators:
4
+ - professional translators
5
+ - machine-generated
6
+ language:
7
+ - ca
8
+ license:
9
+ - other
10
+ multilinguality:
11
+ - monolingual
12
+ pretty_name: paws-ca
13
+ task_categories:
14
+ - text-classification
15
+ tags:
16
+ - paraphrase-identification
17
+ ---
18
+
19
+ # Dataset Card for PAWS-ca: Paraphrase Adversaries from Word Scrambling in Catalan
20
+
21
+ ## Table of Contents
22
+ - [Dataset Description](#dataset-description)
23
+ - [Dataset Summary](#dataset-summary)
24
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
25
+ - [Languages](#languages)
26
+ - [Dataset Structure](#dataset-structure)
27
+ - [Data Instances](#data-instances)
28
+ - [Data Fields](#data-fields)
29
+ - [Data Splits](#data-splits)
30
+ - [Dataset Creation](#dataset-creation)
31
+ - [Curation Rationale](#curation-rationale)
32
+ - [Source Data](#source-data)
33
+ - [Annotations](#annotations)
34
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
35
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
36
+ - [Social Impact of Dataset](#social-impact-of-dataset)
37
+ - [Discussion of Biases](#discussion-of-biases)
38
+ - [Other Known Limitations](#other-known-limitations)
39
+ - [Additional Information](#additional-information)
40
+ - [Dataset Curators](#dataset-curators)
41
+ - [Licensing Information](#licensing-information)
42
+ - [Citation Information](#citation-information)
43
+ - [Contributions](#contributions)
44
+
45
+ ## Dataset Description
46
+
47
+ - **Homepage:** [PAWS-ca](https://zenodo.org/record/)
48
+ - **Point of Contact:** [email protected]
49
+
50
+ ### Dataset Summary
51
+
52
+ The PAWS-ca dataset (Paraphrase Adversaries from Word Scrambling in Catalan) is a translation of the English PAWS dataset into Catalan, commissioned by BSC LangTech Unit.
53
+
54
+ The dataset contains 4,000 human translated PAWS pairs and 49,000 machine translated pairs.
55
+
56
+
57
+ ### Supported Tasks and Leaderboards
58
+
59
+ Paraphrase Identification, Language Model
60
+
61
+ ### Languages
62
+
63
+ The dataset is in Catalan (`ca-CA`).
64
+
65
+ ## Dataset Structure
66
+
67
+ ### Data Instances
68
+
69
+ Three JSON files, one for each split.
70
+
71
+ ### Example:
72
+ <pre>
73
+
74
+ {
75
+ "id": 38
76
+ "sentence1": Holly estava influenciat musicalment per Elton John.
77
+ "sentence2": Holly Holly va ser influenciada musicalment per Elton John.
78
+ "label": 1
79
+ }
80
+
81
+ {
82
+ "id":
83
+ "sentence1": L’equip va respondre als canvis en el següent partit el mateix vespre del 19 de febrer.
84
+ "sentence2": L'equip va respondre als canvis en el mateix partit d’aquell següent 19 de febrer al vespre.
85
+ "label": 0
86
+ }
87
+
88
+ </pre>
89
+
90
+
91
+ ### Data Fields
92
+
93
+ - id: An ID that matches the ID of the source pair of the English PAWS dataset
94
+ - sentence1: The first sentence
95
+ - sentence2: The second sentence
96
+ - label: Label for each pair
97
+
98
+
99
+
100
+ ### Data Splits
101
+
102
+ * paws-ca.train.jsonl: 49,401 examples
103
+ * paws-ca.val.jsonl: 2,000 examples
104
+ * paws-ca.test.jsonl: 2,000 examples
105
+
106
+
107
+ > **Caveat**: please note that the dev and test sets of PAWS-X are both sourced
108
+ > from the dev set of PAWS-Wiki. As a consequence, the same `sentence 1` may
109
+ > appear in both the dev and test sets. Nevertheless our data split guarantees
110
+ > that there is no overlap on sentence pairs (`sentence 1` + `sentence 2`)
111
+ > between dev and test.
112
+
113
+ ## Dataset Creation
114
+
115
+ ### Curation Rationale
116
+
117
+ We created this dataset to contribute to the development of language models in Catalan, a low-resource language.
118
+
119
+ ### Source Data
120
+
121
+ PAWS (Paraphrase Adversaries from Word Scrambling)
122
+
123
+ #### Initial Data Collection and Normalization
124
+
125
+ This dataset is a translation the English PAWS dataset into Catalan, commissioned by BSC LangTech Unit within Projecte AINA.
126
+
127
+ #### Who are the source language producers?
128
+
129
+ For more information on how PAWS was created, refer to the paper (), or visit the [PAWS's webpage]().
130
+
131
+
132
+
133
+ ### Annotations
134
+
135
+ #### Annotation process
136
+
137
+ [N/A]
138
+
139
+
140
+ #### Who are the annotators?
141
+
142
+ This is a translation of the English PAWS dataset and its annotations.
143
+
144
+ ### Personal and Sensitive Information
145
+
146
+ No personal or sensitive information included.
147
+
148
+ ## Considerations for Using the Data
149
+
150
+ ### Social Impact of Dataset
151
+
152
+ We hope this dataset contributes to the development of language models in Catalan, a low-resource language.
153
+
154
+ ### Discussion of Biases
155
+
156
+ [N/A]
157
+
158
+ ### Other Known Limitations
159
+
160
+ [N/A]
161
+
162
+ ## Additional Information
163
+
164
+ ### Dataset Curators
165
+
166
+ Language Technologies Unit at the Barcelona Supercomputing Center ([email protected])
167
+
168
+ This work was funded by the [Departament de la Vicepresidència i de Polítiques Digitals i Territori de la Generalitat de Catalunya](https://politiquesdigitals.gencat.cat/ca/inici/index.html#googtrans(ca|en) within the framework of [Projecte AINA](https://politiquesdigitals.gencat.cat/ca/economia/catalonia-ai/aina).
169
+
170
+
171
+ ### Licensing Information
172
+
173
+ This work is licensed under a ... License
174
+
175
+
176
+ ### Citation Information
177
+
178
+
179
+ DOI
180
+
181
+ ### Contributions
182
+
183
+ [N/A]
dev_2k.json ADDED
The diff for this file is too large to render. See raw diff
 
paws-ca.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Loading script for the PAWS-ca dataset
2
+ import csv
3
+
4
+ import datasets
5
+
6
+
7
+ _CITATION = """
8
+
9
+ _DESCRIPTION = """\
10
+ The PAWS-ca dataset (Paraphrase Adversaries from Word Scrambling in Catalan) is a translation of the English PAWS dataset into Catalan, commissioned by BSC LangTech Unit.
11
+
12
+ This dataset contains 4,000 human translated PAWS pairs and 49,000 machine translated pairs.
13
+
14
+ """
15
+
16
+ _HOMEPAGE = "https://zenodo.org/record/"
17
+
18
+ _URL = "https://huggingface.co/datasets/projecte-aina/paws-ca/resolve/main/"
19
+ _TRAINING_FILE = "train.json"
20
+ _DEV_FILE = "dev_2k.json"
21
+ _TEST_FILE = "test_2k.json"
22
+
23
+
24
+ class PAWSXConfig(datasets.BuilderConfig):
25
+ """BuilderConfig for PAWSX-ca."""
26
+
27
+ def __init__(self, **kwargs):
28
+ """Constructs a PAWSXConfig.
29
+ Args:
30
+ **kwargs: keyword arguments forwarded to super.
31
+ """
32
+ super(PAWSXConfig, self).__init__(version=datasets.Version("1.1.0", ""), **kwargs),
33
+
34
+
35
+ class PAWSX(datasets.GeneratorBasedBuilder):
36
+ """PAWS-ca, a Catalan version of PAWS."""
37
+
38
+ VERSION = datasets.Version("1.1.0")
39
+
40
+ BUILDER_CONFIGS = [
41
+ PAWSXConfig(
42
+ name=config_name,
43
+ description=(f"This config contains samples in {config_name}."),
44
+ )
45
+ for config_name in _DATA_OPTIONS
46
+ ]
47
+
48
+ def _info(self):
49
+ features = datasets.Features(
50
+ {
51
+ "id": datasets.Value("int32"),
52
+ "sentence1": datasets.Value("string"),
53
+ "sentence2": datasets.Value("string"),
54
+ "label": datasets.features.ClassLabel(names=["0", "1"]),
55
+ }
56
+ )
57
+ return datasets.DatasetInfo(
58
+ # This is the description that will appear on the datasets page.
59
+ description=_DESCRIPTION,
60
+ # This defines the different columns of the dataset and their types
61
+ features=features, # Here we define them above because they are different between the two configurations
62
+ # If there's a common (input, target) tuple from the features,
63
+ # specify them here. They'll be used if as_supervised=True in
64
+ # builder.as_dataset.
65
+ supervised_keys=None,
66
+ # Homepage of the dataset for documentation
67
+ homepage=_HOMEPAGE,
68
+ # License for the dataset if available
69
+ license=_LICENSE,
70
+ # Citation for the dataset
71
+ citation=_CITATION,
72
+ )
73
+
74
+ def _split_generators(self, dl_manager):
75
+ """Returns SplitGenerators."""
76
+ urls_to_download = {
77
+ "train": f"{_URL}{_TRAIN_FILE}",
78
+ "val": f"{_URL}{_DEV_FILE}",
79
+ "test": f"{_URL}{_TEST_FILE}",
80
+ }
81
+ downloaded_files = dl_manager.download_and_extract(urls_to_download)
82
+
83
+ return [
84
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
85
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
86
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
87
+ ]
88
+
89
+ def _generate_examples(self, filepath, split):
90
+ with open(filepath, encoding='utf-8') as f:
91
+ for i, line in enumerate(f):
92
+ data = json.loads(line)
93
+ yield i, {
94
+ 'id': data['id'],
95
+ 'sentence1': data['sentence1'],
96
+ 'sentence2': data['sentence2'],
97
+ 'label': str(data['label']),
98
+ }
99
+
100
+
test_2k.json ADDED
The diff for this file is too large to render. See raw diff
 
train.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c98cd4379906c58932784224677d0c02eab0f391af339f2b46668a18875b26a
3
+ size 17390169