hpprc commited on
Commit
6b1df67
1 Parent(s): a3aff80

:+1: fix config name

Browse files
Files changed (2) hide show
  1. README.md +88 -40
  2. jsick.py +6 -6
README.md CHANGED
@@ -33,6 +33,8 @@ task_ids:
33
  - [Table of Contents](#table-of-contents)
34
  - [Dataset Description](#dataset-description)
35
  - [Dataset Summary](#dataset-summary)
 
 
36
  - [Languages](#languages)
37
  - [Dataset Structure](#dataset-structure)
38
  - [Data Instances](#data-instances)
@@ -40,7 +42,7 @@ task_ids:
40
  - [stress](#stress)
41
  - [Data Fields](#data-fields)
42
  - [base](#base-1)
43
- - [original](#original)
44
  - [Data Splits](#data-splits)
45
  - [Annotations](#annotations)
46
  - [Additional Information](#additional-information)
@@ -59,10 +61,26 @@ task_ids:
59
 
60
  From official [GitHub](https://github.com/verypluming/JSICK):
61
 
62
- Japanese Sentences Involving Compositional Knowledge (JSICK) Dataset.
 
63
  JSICK is the Japanese NLI and STS dataset by manually translating the English dataset [SICK (Marelli et al., 2014)](https://aclanthology.org/L14-1314/) into Japanese.
64
  We hope that our dataset will be useful in research for realizing more advanced models that are capable of appropriately performing multilingual compositional inference.
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  ### Languages
67
 
68
  The language data in JSICK is in Japanese and English.
@@ -81,11 +99,11 @@ dataset: ds.DatasetDict = ds.load_dataset("hpprc/jsick")
81
  print(dataset)
82
  # DatasetDict({
83
  # train: Dataset({
84
- # features: ['id', 'premise', 'hypothesis', 'label', 'score', 'sentence_A_En', 'sentence_B_En', 'entailment_label_En', 'relatedness_score_En', 'corr_entailment_labelAB_En', 'corr_entailment_labelBA_En', 'image_ID', 'original_caption', 'semtag_short', 'semtag_long'],
85
  # num_rows: 4500
86
  # })
87
  # test: Dataset({
88
- # features: ['id', 'premise', 'hypothesis', 'label', 'score', 'sentence_A_En', 'sentence_B_En', 'entailment_label_En', 'relatedness_score_En', 'corr_entailment_labelAB_En', 'corr_entailment_labelBA_En', 'image_ID', 'original_caption', 'semtag_short', 'semtag_long'],
89
  # num_rows: 4927
90
  # })
91
  # })
@@ -106,21 +124,22 @@ print(dataset)
106
  An example of looks as follows:
107
 
108
  ```json
109
- {'id': 1,
110
- 'premise': '子供たちのグループが庭で遊んでいて、後ろの方には年を取った男性が立っている',
111
- 'hypothesis': '庭にいる男の子たちのグループが遊んでいて、男性が後ろの方に立っている',
112
- 'label': 1,
113
- 'score': 3.700000047683716,
114
- 'sentence_A_En': 'A group of kids is playing in a yard and an old man is standing in the background',
115
- 'sentence_B_En': 'A group of boys in a yard is playing and a man is standing in the background',
116
- 'entailment_label_En': 1,
117
- 'relatedness_score_En': 4.5,
118
- 'corr_entailment_labelAB_En': 'nan',
119
- 'corr_entailment_labelBA_En': 'nan',
120
- 'image_ID': '3155657768_b83a7831e5.jpg',
121
- 'original_caption': 'A group of children playing in a yard , a man in the background .',
122
- 'semtag_short': 'nan',
123
- 'semtag_long': 'nan',
 
124
  }
125
  ```
126
 
@@ -129,7 +148,18 @@ An example of looks as follows:
129
  An example of looks as follows:
130
 
131
  ```json
132
- {'id': '5818_de_d', 'premise': '女性火の近くダンスをしている', 'hypothesis': '火の近くでダンスをしている女性は一人もいない', 'label': 2, 'score': 4.0, 'sentence_A_Ja_origin': '女性が火の近くでダンスをしている', 'entailment_label_origin': 2, 'relatedness_score_Ja_origin': 3.700000047683716, 'rephrase_type': 'd', 'case_particles': 'de'}
 
 
 
 
 
 
 
 
 
 
 
133
  ```
134
 
135
  ### Data Fields
@@ -138,33 +168,51 @@ An example of looks as follows:
138
 
139
  A version adopting the column names of a typical NLI dataset.
140
 
141
- - `id`: The number of the sentence pair.
142
- - `premise`: The premise (sentence_A_Ja).
143
- - `hypothesis`: The hypothesis (sentence_B_Ja).
144
- - `label`: The correct label for this sentence pair (either `entailment` or `non-entailment`); in the setting described in the paper, non-entailment = neutral + contradiction (entailment_label_Ja).
145
- - `heuristics`: The heuristics (structural pattern) tag. The tags are: subsequence, constituent, full-overlap, order-subset, and mixed-subset.
146
- - `number_of_NPs`: The number of noun phrase in a sentence.
147
- - `semtag`: The linguistic phenomena tag.
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
- #### original
150
 
151
- The original version retaining the unaltered column names.
152
 
153
- - `id`: The number of the sentence pair.
154
- - `sentence_A_Ja`: The premise.
155
- - `sentence_B_Ja`: The hypothesis.
156
- - `entailment_label_Ja`: The correct label for this sentence pair (either `entailment` or `non-entailment`); in the setting described in the paper, non-entailment = neutral + contradiction
157
- - `heuristics`: The heuristics (structural pattern) tag. The tags are: subsequence, constituent, full-overlap, order-subset, and mixed-subset.
158
- - `number_of_NPs`: The number of noun phrase in a sentence.
159
- - `semtag`: The linguistic phenomena tag.
 
 
 
 
 
160
 
161
 
162
  ### Data Splits
163
 
164
- | name | train | validation | test |
165
- | -------- | -----: | ---------: | ---: |
166
- | base | 13,680 | | 720 |
167
- | original | 13,680 | | 720 |
 
 
168
 
169
 
170
 
 
33
  - [Table of Contents](#table-of-contents)
34
  - [Dataset Description](#dataset-description)
35
  - [Dataset Summary](#dataset-summary)
36
+ - [Japanese Sentences Involving Compositional Knowledge (JSICK) Dataset.](#japanese-sentences-involving-compositional-knowledge-jsick-dataset)
37
+ - [JSICK-stress Test set](#jsick-stress-test-set)
38
  - [Languages](#languages)
39
  - [Dataset Structure](#dataset-structure)
40
  - [Data Instances](#data-instances)
 
42
  - [stress](#stress)
43
  - [Data Fields](#data-fields)
44
  - [base](#base-1)
45
+ - [stress](#stress-1)
46
  - [Data Splits](#data-splits)
47
  - [Annotations](#annotations)
48
  - [Additional Information](#additional-information)
 
61
 
62
  From official [GitHub](https://github.com/verypluming/JSICK):
63
 
64
+ #### Japanese Sentences Involving Compositional Knowledge (JSICK) Dataset.
65
+
66
  JSICK is the Japanese NLI and STS dataset by manually translating the English dataset [SICK (Marelli et al., 2014)](https://aclanthology.org/L14-1314/) into Japanese.
67
  We hope that our dataset will be useful in research for realizing more advanced models that are capable of appropriately performing multilingual compositional inference.
68
 
69
+
70
+ #### JSICK-stress Test set
71
+
72
+ The JSICK-stress test set is a dataset to investigate whether models capture word order and case particles in Japanese.
73
+ The JSICK-stress test set is provided by transforming syntactic structures of sentence pairs in JSICK, where we analyze whether models are attentive to word order and case particles to predict entailment labels and similarity scores.
74
+
75
+ The JSICK test set contains 1666, 797, and 1006 sentence pairs (A, B) whose premise sentences A (the column `sentence_A_Ja_origin`) include the basic word order involving
76
+ ga-o (nominative-accusative), ga-ni (nominative-dative), and ga-de (nominative-instrumental/locative) relations, respectively.
77
+
78
+ We provide the JSICK-stress test set by transforming syntactic structures of these pairs by the following three ways:
79
+ - `scrum_ga_o`: a scrambled pair, where the word order of premise sentences A is scrambled into o-ga, ni-ga, and de-ga order, respectively.
80
+ - `ex_ga_o`: a rephrased pair, where the only case particles (ga, o, ni, de) in the premise A are swapped
81
+ - `del_ga_o`: a rephrased pair, where the only case particles (ga, o, ni) in the premise A are deleted
82
+
83
+
84
  ### Languages
85
 
86
  The language data in JSICK is in Japanese and English.
 
99
  print(dataset)
100
  # DatasetDict({
101
  # train: Dataset({
102
+ # features: ['id', 'premise', 'hypothesis', 'label', 'score', 'premise_en', 'hypothesis_en', 'label_en', 'score_en', 'corr_entailment_labelAB_En', 'corr_entailment_labelBA_En', 'image_ID', 'original_caption', 'semtag_short', 'semtag_long'],
103
  # num_rows: 4500
104
  # })
105
  # test: Dataset({
106
+ # features: ['id', 'premise', 'hypothesis', 'label', 'score', 'premise_en', 'hypothesis_en', 'label_en', 'score_en', 'corr_entailment_labelAB_En', 'corr_entailment_labelBA_En', 'image_ID', 'original_caption', 'semtag_short', 'semtag_long'],
107
  # num_rows: 4927
108
  # })
109
  # })
 
124
  An example of looks as follows:
125
 
126
  ```json
127
+ {
128
+ 'id': 1,
129
+ 'premise': '子供たちのグループが庭で遊んでいて、後ろの方には年を取った男性が立っている',
130
+ 'hypothesis': '庭にいる男の子たちのグループが遊んでいて、男性が後ろの方に立っている',
131
+ 'label': 1, // (neutral)
132
+ 'score': 3.700000047683716,
133
+ 'premise_en': 'A group of kids is playing in a yard and an old man is standing in the background',
134
+ 'hypothesis_en': 'A group of boys in a yard is playing and a man is standing in the background',
135
+ 'label_en': 1, // (neutral)
136
+ 'score_en': 4.5,
137
+ 'corr_entailment_labelAB_En': 'nan',
138
+ 'corr_entailment_labelBA_En': 'nan',
139
+ 'image_ID': '3155657768_b83a7831e5.jpg',
140
+ 'original_caption': 'A group of children playing in a yard , a man in the background .',
141
+ 'semtag_short': 'nan',
142
+ 'semtag_long': 'nan',
143
  }
144
  ```
145
 
 
148
  An example of looks as follows:
149
 
150
  ```json
151
+ {
152
+ 'id': '5818_de_d',
153
+ 'premise': '女性火の近くダンスをしている',
154
+ 'hypothesis': '火の近くでダンスをしている女性は一人もいない',
155
+ 'label': 2, // (contradiction)
156
+ 'score': 4.0,
157
+ 'sentence_A_Ja_origin': '女性が火の近くでダンスをしている',
158
+ 'entailment_label_origin': 2,
159
+ 'relatedness_score_Ja_origin': 3.700000047683716,
160
+ 'rephrase_type': 'd',
161
+ 'case_particles': 'de'
162
+ }
163
  ```
164
 
165
  ### Data Fields
 
168
 
169
  A version adopting the column names of a typical NLI dataset.
170
 
171
+ | Name | Description |
172
+ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
173
+ | id | ids (the same with original SICK) |
174
+ | premise | first sentence in Japanese |
175
+ | hypothesis | second sentence in Japanese |
176
+ | label | entailment label in Japanese |
177
+ | score | relatedness score in the range [1-5] in Japanese |
178
+ | premise_en | first sentence in English |
179
+ | hypothesis_en | second sentence in English |
180
+ | label_en | original entailment label in English |
181
+ | score_en | original relatedness score in the range [1-5] in English |
182
+ | semtag_short | linguistic phenomena tags in Japanese |
183
+ | semtag_long | details of linguistic phenomena tags in Japanese |
184
+ | image_ID | original image in [8K ImageFlickr dataset](https://www.kaggle.com/datasets/adityajn105/flickr8k) |
185
+ | original_caption | original caption in [8K ImageFlickr dataset](https://www.kaggle.com/datasets/adityajn105/flickr8k) |
186
+ | corr_entailment_labelAB_En | corrected entailment label from A to B in English by [(Karouli et al., 2017)](http://vcvpaiva.github.io/includes/pubs/2017-iwcs.pdf) |
187
+ | corr_entailment_labelBA_En | corrected entailment label from B to A in English by [(Karouli et al., 2017)](http://vcvpaiva.github.io/includes/pubs/2017-iwcs.pdf) |
188
+
189
+
190
+ #### stress
191
 
 
192
 
 
193
 
194
+ | Name | Description |
195
+ | --------------------------- | ------------------------------------------------------------------------------------------------- |
196
+ | id | ids (the same with original SICK) |
197
+ | premise | first sentence in Japanese |
198
+ | hypothesis | second sentence in Japanese |
199
+ | label | entailment label in Japanese |
200
+ | score | relatedness score in the range [1-5] in Japanese |
201
+ | sentence_A_Ja_origin | the original premise sentences A from the JSICK test set. |
202
+ | entailment_label_origin | the original entailment labels |
203
+ | relatedness_score_Ja_origin | the original relatedness scores |
204
+ | rephrase_type | the type of transformation applied to the syntactic structures of the sentence pairs |
205
+ | case_particles | the grammatical particles in Japanese that indicate the function or role of a noun in a sentence. |
206
 
207
 
208
  ### Data Splits
209
 
210
+ | name | train | validation | test |
211
+ | --------------- | ----: | ---------: | ---: |
212
+ | base | 4500 | | 4927 |
213
+ | original | 4500 | | 4927 |
214
+ | stress | | | 900 |
215
+ | stress-original | | | 900 |
216
 
217
 
218
 
jsick.py CHANGED
@@ -41,12 +41,12 @@ class JSICKDataset(ds.GeneratorBasedBuilder):
41
  ds.BuilderConfig(
42
  name="base",
43
  version=VERSION,
44
- description="hoge",
45
  ),
46
  ds.BuilderConfig(
47
  name="original",
48
  version=VERSION,
49
- description="hoge",
50
  ),
51
  ds.BuilderConfig(
52
  name="stress",
@@ -119,7 +119,7 @@ class JSICKDataset(ds.GeneratorBasedBuilder):
119
  }
120
  )
121
 
122
- elif self.config.name == "stress_original":
123
  features = ds.Features(
124
  {
125
  "pair_ID": ds.Value("string"),
@@ -146,13 +146,13 @@ class JSICKDataset(ds.GeneratorBasedBuilder):
146
  def _split_generators(self, dl_manager: ds.DownloadManager):
147
  if self.config.name in ["base", "original"]:
148
  url = _URLS["base"]
149
- elif self.config.name in ["stress", "stress_original"]:
150
  url = _URLS["stress"]
151
 
152
  data_path = dl_manager.download_and_extract(url)
153
  df: pd.DataFrame = pd.read_table(data_path, sep="\t", header=0)
154
 
155
- if self.config.name in ["stress", "stress_original"]:
156
  df = df[
157
  [
158
  "pair_ID",
@@ -195,7 +195,7 @@ class JSICKDataset(ds.GeneratorBasedBuilder):
195
  ),
196
  ]
197
 
198
- elif self.config.name in ["stress", "stress_original"]:
199
  return [
200
  ds.SplitGenerator(
201
  name=ds.Split.TEST,
 
41
  ds.BuilderConfig(
42
  name="base",
43
  version=VERSION,
44
+ description="A version adopting the column names of a typical NLI dataset.",
45
  ),
46
  ds.BuilderConfig(
47
  name="original",
48
  version=VERSION,
49
+ description="The original version retaining the unaltered column names.",
50
  ),
51
  ds.BuilderConfig(
52
  name="stress",
 
119
  }
120
  )
121
 
122
+ elif self.config.name == "stress-original":
123
  features = ds.Features(
124
  {
125
  "pair_ID": ds.Value("string"),
 
146
  def _split_generators(self, dl_manager: ds.DownloadManager):
147
  if self.config.name in ["base", "original"]:
148
  url = _URLS["base"]
149
+ elif self.config.name in ["stress", "stress-original"]:
150
  url = _URLS["stress"]
151
 
152
  data_path = dl_manager.download_and_extract(url)
153
  df: pd.DataFrame = pd.read_table(data_path, sep="\t", header=0)
154
 
155
+ if self.config.name in ["stress", "stress-original"]:
156
  df = df[
157
  [
158
  "pair_ID",
 
195
  ),
196
  ]
197
 
198
+ elif self.config.name in ["stress", "stress-original"]:
199
  return [
200
  ds.SplitGenerator(
201
  name=ds.Split.TEST,