shunk031 commited on
Commit
cd8ab15
·
unverified ·
1 Parent(s): 0829fbf

Update dataset URLs and version to 1.2.0 (#20)

Browse files

* Update dataset URLs and version to 1.2.0

* Update dataset URLs and bump version to 1.2.0

* Remove unnecessary newline in URL definitions

* Add type assertions for dataset loading and implement version consistency test

* Update README to reflect version changes and link to release history

* Fix typo in release history link in README

Files changed (5) hide show
  1. JGLUE.py +9 -9
  2. README.md +4 -0
  3. pyproject.toml +1 -1
  4. tests/JGLUE_test.py +23 -0
  5. uv.lock +1 -1
JGLUE.py CHANGED
@@ -121,20 +121,20 @@ _URLS = {
121
  },
122
  },
123
  "JSTS": {
124
- "train": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.1.0/datasets/jsts-v1.1/train-v1.1.json",
125
- "valid": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.1.0/datasets/jsts-v1.1/valid-v1.1.json",
126
  },
127
  "JNLI": {
128
- "train": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.1.0/datasets/jnli-v1.1/train-v1.1.json",
129
- "valid": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.1.0/datasets/jnli-v1.1/valid-v1.1.json",
130
  },
131
  "JSQuAD": {
132
- "train": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.1.0/datasets/jsquad-v1.1/train-v1.1.json",
133
- "valid": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.1.0/datasets/jsquad-v1.1/valid-v1.1.json",
134
  },
135
  "JCommonsenseQA": {
136
- "train": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.1.0/datasets/jcommonsenseqa-v1.1/train-v1.1.json",
137
- "valid": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.1.0/datasets/jcommonsenseqa-v1.1/valid-v1.1.json",
138
  },
139
  }
140
 
@@ -530,7 +530,7 @@ def preprocess_for_marc_ja(
530
 
531
 
532
  class JGLUE(ds.GeneratorBasedBuilder):
533
- JGLUE_VERSION = ds.Version("1.1.0")
534
  JCOLA_VERSION = ds.Version("1.0.0")
535
 
536
  BUILDER_CONFIG_CLASS = JGLUEConfig
 
121
  },
122
  },
123
  "JSTS": {
124
+ "train": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.2.0/datasets/jsts-v1.2/train-v1.2.json",
125
+ "valid": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.2.0/datasets/jsts-v1.2/valid-v1.2.json",
126
  },
127
  "JNLI": {
128
+ "train": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.2.0/datasets/jnli-v1.2/train-v1.2.json",
129
+ "valid": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.2.0/datasets/jnli-v1.2/valid-v1.2.json",
130
  },
131
  "JSQuAD": {
132
+ "train": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.2.0/datasets/jsquad-v1.2/train-v1.2.json",
133
+ "valid": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.2.0/datasets/jsquad-v1.2/valid-v1.2.json",
134
  },
135
  "JCommonsenseQA": {
136
+ "train": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.2.0/datasets/jcommonsenseqa-v1.2/train-v1.2.json",
137
+ "valid": "https://raw.githubusercontent.com/yahoojapan/JGLUE/refs/tags/v1.2.0/datasets/jcommonsenseqa-v1.2/valid-v1.2.json",
138
  },
139
  }
140
 
 
530
 
531
 
532
  class JGLUE(ds.GeneratorBasedBuilder):
533
+ JGLUE_VERSION = ds.Version("1.2.0")
534
  JCOLA_VERSION = ds.Version("1.0.0")
535
 
536
  BUILDER_CONFIG_CLASS = JGLUEConfig
README.md CHANGED
@@ -43,6 +43,10 @@ task_ids:
43
  This dataset loading script is developed on [GitHub](https://github.com/shunk031/huggingface-datasets_JGLUE).
44
  Please feel free to open an [issue](https://github.com/shunk031/huggingface-datasets_JGLUE/issues/new/choose) or [pull request](https://github.com/shunk031/huggingface-datasets_JGLUE/pulls).
45
 
 
 
 
 
46
  ## Table of Contents
47
  - [Table of Contents](#table-of-contents)
48
  - [Dataset Description](#dataset-description)
 
43
  This dataset loading script is developed on [GitHub](https://github.com/shunk031/huggingface-datasets_JGLUE).
44
  Please feel free to open an [issue](https://github.com/shunk031/huggingface-datasets_JGLUE/issues/new/choose) or [pull request](https://github.com/shunk031/huggingface-datasets_JGLUE/pulls).
45
 
46
+ > [!IMPORTANT]
47
+ > The version of this loading script has been updated to correspond to the version of JGLUE.
48
+ > Please check the release history at [yahoojapan/JGLUE/releases](https://github.com/yahoojapan/JGLUE/releases) and [shunk031/huggingface-datasets_JGLUE/releases](https://github.com/shunk031/huggingface-datasets_JGLUE/releases).
49
+
50
  ## Table of Contents
51
  - [Table of Contents](#table-of-contents)
52
  - [Dataset Description](#dataset-description)
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
  [project]
2
  name = "huggingface-datasets-jglue"
3
- version = "1.1.1"
4
  description = "Dataset loading script for JGLUE: Japanese General Language Understanding Evaluation"
5
  authors = [
6
  { name = "Shunsuke Kitada", email = "[email protected]" },
 
1
  [project]
2
  name = "huggingface-datasets-jglue"
3
+ version = "1.2.0"
4
  description = "Dataset loading script for JGLUE: Japanese General Language Understanding Evaluation"
5
  authors = [
6
  { name = "Shunsuke Kitada", email = "[email protected]" },
tests/JGLUE_test.py CHANGED
@@ -28,6 +28,7 @@ def test_load_dataset(
28
  expected_num_valid: int,
29
  ):
30
  dataset = ds.load_dataset(path=dataset_path, name=dataset_name)
 
31
 
32
  assert dataset["train"].num_rows == expected_num_train
33
  assert dataset["validation"].num_rows == expected_num_valid
@@ -47,6 +48,7 @@ def test_load_marc_ja(
47
  filter_review_id_list_valid=True,
48
  label_conv_review_id_list_valid=True,
49
  )
 
50
 
51
  assert dataset["train"].num_rows == expected_num_train
52
  assert dataset["validation"].num_rows == expected_num_valid
@@ -60,9 +62,30 @@ def test_load_jcola(
60
  expected_num_valid_ood: int = 685,
61
  ):
62
  dataset = ds.load_dataset(path=dataset_path, name=dataset_name)
 
 
63
  assert dataset["train"].num_rows == expected_num_train
64
  assert dataset["validation"].num_rows == expected_num_valid
65
  assert dataset["validation_out_of_domain"].num_rows == expected_num_valid_ood
66
  assert (
67
  dataset["validation_out_of_domain_annotated"].num_rows == expected_num_valid_ood
68
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  expected_num_valid: int,
29
  ):
30
  dataset = ds.load_dataset(path=dataset_path, name=dataset_name)
31
+ assert isinstance(dataset, ds.DatasetDict)
32
 
33
  assert dataset["train"].num_rows == expected_num_train
34
  assert dataset["validation"].num_rows == expected_num_valid
 
48
  filter_review_id_list_valid=True,
49
  label_conv_review_id_list_valid=True,
50
  )
51
+ assert isinstance(dataset, ds.DatasetDict)
52
 
53
  assert dataset["train"].num_rows == expected_num_train
54
  assert dataset["validation"].num_rows == expected_num_valid
 
62
  expected_num_valid_ood: int = 685,
63
  ):
64
  dataset = ds.load_dataset(path=dataset_path, name=dataset_name)
65
+ assert isinstance(dataset, ds.DatasetDict)
66
+
67
  assert dataset["train"].num_rows == expected_num_train
68
  assert dataset["validation"].num_rows == expected_num_valid
69
  assert dataset["validation_out_of_domain"].num_rows == expected_num_valid_ood
70
  assert (
71
  dataset["validation_out_of_domain_annotated"].num_rows == expected_num_valid_ood
72
  )
73
+
74
+
75
+ def test_jglue_version():
76
+ import tomli
77
+
78
+ from JGLUE import JGLUE
79
+
80
+ jglue_version = JGLUE.JGLUE_VERSION
81
+ jglue_major, jglue_minor, _ = jglue_version.tuple
82
+
83
+ with open("pyproject.toml", "rb") as rf:
84
+ pyproject_toml = tomli.load(rf)
85
+
86
+ project_version = ds.Version(pyproject_toml["project"]["version"])
87
+ proj_major, proj_minor, _ = project_version.tuple
88
+
89
+ assert jglue_major == proj_major and jglue_minor == proj_minor, (
90
+ f"JGLUE and project version mismatch: {jglue_version=} != {project_version=}"
91
+ )
uv.lock CHANGED
@@ -661,7 +661,7 @@ http = [
661
 
662
  [[package]]
663
  name = "huggingface-datasets-jglue"
664
- version = "0.1.0"
665
  source = { virtual = "." }
666
  dependencies = [
667
  { name = "beautifulsoup4" },
 
661
 
662
  [[package]]
663
  name = "huggingface-datasets-jglue"
664
+ version = "1.2.0"
665
  source = { virtual = "." }
666
  dependencies = [
667
  { name = "beautifulsoup4" },