Datasets:
Tasks:
Text Classification
Modalities:
Text
Sub-tasks:
semantic-similarity-classification
Languages:
English
Size:
10K - 100K
License:
Update phrase_similarity.py
Browse files- phrase_similarity.py +14 -6
phrase_similarity.py
CHANGED
@@ -27,22 +27,28 @@ logger = datasets.logging.get_logger(__name__)
|
|
27 |
|
28 |
|
29 |
_CITATION = """\
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
31 |
"""
|
32 |
|
33 |
_DESCRIPTION = """\
|
34 |
-
|
35 |
"""
|
36 |
|
37 |
-
_HOMEPAGE = ""
|
38 |
|
39 |
-
_LICENSE = "CC-BY-4.0"
|
40 |
|
41 |
_URL = "https://auburn.edu/~tmp0038/PiC/"
|
42 |
_SPLITS = {
|
43 |
"train": "train-v1.0.json",
|
44 |
"dev": "dev-v1.0.json",
|
45 |
"test": "test-v1.0.json",
|
|
|
46 |
}
|
47 |
|
48 |
_PS = "PS"
|
@@ -65,7 +71,7 @@ class PhraseSimilarity(datasets.GeneratorBasedBuilder):
|
|
65 |
BUILDER_CONFIGS = [
|
66 |
PSConfig(
|
67 |
name=_PS,
|
68 |
-
version=datasets.Version("1.0.
|
69 |
description="The PiC Dataset for Phrase Similarity"
|
70 |
)
|
71 |
]
|
@@ -94,7 +100,8 @@ class PhraseSimilarity(datasets.GeneratorBasedBuilder):
|
|
94 |
urls_to_download = {
|
95 |
"train": os.path.join(_URL, self.config.name, _SPLITS["train"]),
|
96 |
"dev": os.path.join(_URL, self.config.name, _SPLITS["dev"]),
|
97 |
-
"test": os.path.join(_URL, self.config.name, _SPLITS["test"])
|
|
|
98 |
}
|
99 |
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
100 |
|
@@ -102,6 +109,7 @@ class PhraseSimilarity(datasets.GeneratorBasedBuilder):
|
|
102 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
103 |
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
|
104 |
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
|
|
|
105 |
]
|
106 |
|
107 |
def _generate_examples(self, filepath):
|
|
|
27 |
|
28 |
|
29 |
_CITATION = """\
|
30 |
+
@article{pham2022PiC,
|
31 |
+
title={PiC: A Phrase-in-Context Dataset for Phrase Understanding and Semantic Search},
|
32 |
+
author={Pham, Thang M and Yoon, Seunghyun and Bui, Trung and Nguyen, Anh},
|
33 |
+
journal={arXiv preprint arXiv:2207.09068},
|
34 |
+
year={2022}
|
35 |
+
}
|
36 |
"""
|
37 |
|
38 |
_DESCRIPTION = """\
|
39 |
+
Phrase in Context is a curated benchmark for phrase understanding and semantic search, consisting of three tasks of increasing difficulty: Phrase Similarity (PS), Phrase Retrieval (PR) and Phrase Sense Disambiguation (PSD). The datasets are annotated by 13 linguistic experts on Upwork and verified by two groups: ~1000 AMT crowdworkers and another set of 5 linguistic experts. PiC benchmark is distributed under CC-BY-NC 4.0.
|
40 |
"""
|
41 |
|
42 |
+
_HOMEPAGE = "https://phrase-in-context.github.io/"
|
43 |
|
44 |
+
_LICENSE = "CC-BY-NC-4.0"
|
45 |
|
46 |
_URL = "https://auburn.edu/~tmp0038/PiC/"
|
47 |
_SPLITS = {
|
48 |
"train": "train-v1.0.json",
|
49 |
"dev": "dev-v1.0.json",
|
50 |
"test": "test-v1.0.json",
|
51 |
+
"test_hard": "test-hard-v1.0.json",
|
52 |
}
|
53 |
|
54 |
_PS = "PS"
|
|
|
71 |
BUILDER_CONFIGS = [
|
72 |
PSConfig(
|
73 |
name=_PS,
|
74 |
+
version=datasets.Version("1.0.1"),
|
75 |
description="The PiC Dataset for Phrase Similarity"
|
76 |
)
|
77 |
]
|
|
|
100 |
urls_to_download = {
|
101 |
"train": os.path.join(_URL, self.config.name, _SPLITS["train"]),
|
102 |
"dev": os.path.join(_URL, self.config.name, _SPLITS["dev"]),
|
103 |
+
"test": os.path.join(_URL, self.config.name, _SPLITS["test"]),
|
104 |
+
"test_hard": os.path.join(_URL, self.config.name, _SPLITS["test_hard"])
|
105 |
}
|
106 |
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
107 |
|
|
|
109 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
110 |
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
|
111 |
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
|
112 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test_hard"]}),
|
113 |
]
|
114 |
|
115 |
def _generate_examples(self, filepath):
|