Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
asahi417 commited on
Commit
24ca5f7
1 Parent(s): 322d5f7

fix readme

Browse files
add_new_analogy.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+ from datasets import load_dataset
4
+
5
+ # create analogy from `relbert/semeval2012_relational_similarity`
6
+ data = load_dataset("relbert/semeval2012_relational_similarity", split="validation")
7
+ analogy_data = [{
8
+ "stem": i['positives'][0], "choice": i["negatives"] + [i['positives'][1]], "answer": 2, "prefix": i["relation_type"]
9
+ } for i in data]
10
+ os.makedirs("dataset/semeval2012_relational_similarity", exist_ok=True)
11
+ with open("dataset/semeval2012_relational_similarity/valid.jsonl", "w") as f:
12
+ f.write("\n".join([json.dumps(i) for i in analogy_data]))
analogy_questions.py CHANGED
@@ -1,10 +1,11 @@
1
  import json
 
2
  import datasets
3
 
4
  logger = datasets.logging.get_logger(__name__)
5
  _DESCRIPTION = """[Analogy Question](https://aclanthology.org/2021.acl-long.280/)"""
6
  _NAME = "analogy_questions"
7
- _VERSION = "1.0.0"
8
  _CITATION = """
9
  @inproceedings{ushio-etal-2021-bert,
10
  title = "{BERT} is to {NLP} what {A}lex{N}et is to {CV}: Can Pre-Trained Language Models Identify Analogies?",
@@ -32,7 +33,8 @@ _URLS = {
32
  'sat': [f'{_URL}/sat/test.jsonl'],
33
  'sat_full': [f'{_URL}/sat/test.jsonl', f'{_URL}/sat/valid.jsonl'],
34
  'u2': [f'{_URL}/u2/test.jsonl'],
35
- 'u4': [f'{_URL}/u4/test.jsonl']
 
36
  },
37
  str(datasets.Split.VALIDATION): {
38
  'bats': [f'{_URL}/bats/valid.jsonl'],
@@ -40,11 +42,12 @@ _URLS = {
40
  'sat': [f'{_URL}/sat/valid.jsonl'],
41
  'sat_full': [],
42
  'u2': [f'{_URL}/u2/valid.jsonl'],
43
- 'u4': [f'{_URL}/u4/valid.jsonl']
 
44
  }
45
  }
46
 
47
- _DATASET = list(_URLS[list(_URLS.keys())[0]].keys())
48
 
49
 
50
  class AnalogyQuestionConfig(datasets.BuilderConfig):
 
1
  import json
2
+ from itertools import chain
3
  import datasets
4
 
5
  logger = datasets.logging.get_logger(__name__)
6
  _DESCRIPTION = """[Analogy Question](https://aclanthology.org/2021.acl-long.280/)"""
7
  _NAME = "analogy_questions"
8
+ _VERSION = "1.0.1"
9
  _CITATION = """
10
  @inproceedings{ushio-etal-2021-bert,
11
  title = "{BERT} is to {NLP} what {A}lex{N}et is to {CV}: Can Pre-Trained Language Models Identify Analogies?",
 
33
  'sat': [f'{_URL}/sat/test.jsonl'],
34
  'sat_full': [f'{_URL}/sat/test.jsonl', f'{_URL}/sat/valid.jsonl'],
35
  'u2': [f'{_URL}/u2/test.jsonl'],
36
+ 'u4': [f'{_URL}/u4/test.jsonl'],
37
+ "semeval2012_relational_similarity": []
38
  },
39
  str(datasets.Split.VALIDATION): {
40
  'bats': [f'{_URL}/bats/valid.jsonl'],
 
42
  'sat': [f'{_URL}/sat/valid.jsonl'],
43
  'sat_full': [],
44
  'u2': [f'{_URL}/u2/valid.jsonl'],
45
+ 'u4': [f'{_URL}/u4/valid.jsonl'],
46
+ "semeval2012_relational_similarity": [f'{_URL}/u4/valid.jsonl']
47
  }
48
  }
49
 
50
+ _DATASET = sorted(list(set(list(chain(*[list(i.keys()) for i in _URLS.values()])))))
51
 
52
 
53
  class AnalogyQuestionConfig(datasets.BuilderConfig):
conceptnet_high_confidence ADDED
@@ -0,0 +1 @@
 
 
1
+ Subproject commit c5ee5cdc9dd012e3ebe34aed0a2c1fc546b02a84
dataset/semeval2012_relational_similarity/valid.jsonl ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"stem": ["fruit", "grape"], "choice": [["wheat", "bread"], ["bush", "astilbe"], ["tree", "oak"]], "answer": 2, "prefix": "1/a"}
2
+ {"stem": ["lubricant", "oil"], "choice": [["girl", "person"], ["cat", "animal"], ["tool", "screwdriver"]], "answer": 2, "prefix": "1/b"}
3
+ {"stem": ["mammal", "gorilla"], "choice": [["father", "family"], ["worker", "librarian"], ["currency", "dollar"]], "answer": 2, "prefix": "1/c"}
4
+ {"stem": ["animals", "cats"], "choice": [["fords", "cars"], ["libraries", "books"], ["cutlery", "forks"]], "answer": 2, "prefix": "1/d"}
5
+ {"stem": ["state", "Virginia"], "choice": [["Ireland", "country"], ["computer", "Dell"], ["country", "Egypt"]], "answer": 2, "prefix": "1/e"}
6
+ {"stem": ["crossbones", "poison"], "choice": [["camera", "distrust"], ["alarm", "action"], ["badge", "authority"]], "answer": 2, "prefix": "10/a"}
7
+ {"stem": ["tear", "sadness"], "choice": [["friendliness", "wink"], ["burp", "gas"], ["laugh", "happiness"]], "answer": 2, "prefix": "10/b"}
8
+ {"stem": ["ideal", "fairytale"], "choice": [["menu", "chef"], ["food", "meal"], ["achievement", "trophy"]], "answer": 2, "prefix": "10/c"}
9
+ {"stem": ["directions", "route"], "choice": [["football", "playbook"], ["course", "destination"], ["choreography", "performance"]], "answer": 2, "prefix": "10/d"}
10
+ {"stem": ["biology", "life"], "choice": [["dance", "movements"], ["geography", "maps"], ["mathematics", "numbers"]], "answer": 2, "prefix": "10/e"}
11
+ {"stem": ["wrapper", "package"], "choice": [["boy", "gender"], ["hair", "wig"], ["makeup", "blemish"]], "answer": 2, "prefix": "10/f"}
12
+ {"stem": ["bird", "wings"], "choice": [["toe", "foot"], ["motor", "boat"], ["egg", "yolk"]], "answer": 2, "prefix": "2/a"}
13
+ {"stem": ["army", "soldier"], "choice": [["child", "youth"], ["soldier", "troop"], ["army", "soldiers"]], "answer": 2, "prefix": "2/b"}
14
+ {"stem": ["pound", "ounce"], "choice": [["scene", "movie"], ["cell", "body"], ["feet", "inches"]], "answer": 2, "prefix": "2/c"}
15
+ {"stem": ["funeral", "coffin"], "choice": [["prayer", "reverence"], ["funeral", "family"], ["school", "students"]], "answer": 2, "prefix": "2/d"}
16
+ {"stem": ["stretching", "exercising"], "choice": [["kitchen", "house"], ["cooking", "eating"], ["stitching", "sewing"]], "answer": 2, "prefix": "2/e"}
17
+ {"stem": ["ship", "deck"], "choice": [["coast", "east"], ["mailbox", "flag"], ["hill", "top"]], "answer": 2, "prefix": "2/f"}
18
+ {"stem": ["desk", "wood"], "choice": [["parrot", "bird"], ["wall", "plaster"], ["ocean", "water"]], "answer": 2, "prefix": "2/g"}
19
+ {"stem": ["words", "letters"], "choice": [["gas", "refinery"], ["mammal", "hair"], ["library", "books"]], "answer": 2, "prefix": "2/h"}
20
+ {"stem": ["deaf", "hearing"], "choice": [["animals", "soul"], ["water", "calories"], ["infinite", "end"]], "answer": 2, "prefix": "2/i"}
21
+ {"stem": ["husband", "bachelorhood"], "choice": [["sin", "clergyman"], ["tree", "leaves"], ["corpse", "life"]], "answer": 2, "prefix": "2/j"}
22
+ {"stem": ["make", "manufacture"], "choice": [["flammable", "inflammable"], ["ugly", "hideous"], ["kid", "child"]], "answer": 2, "prefix": "3/a"}
23
+ {"stem": ["sapling", "tree"], "choice": [["run", "zoom"], ["pots", "pans"], ["road", "highway"]], "answer": 2, "prefix": "3/b"}
24
+ {"stem": ["fear", "panic"], "choice": [["arrogance", "confident"], ["messy", "sloppy"], ["sadness", "depression"]], "answer": 2, "prefix": "3/c"}
25
+ {"stem": ["persuade", "force"], "choice": [["coerce", "persuade"], ["imply", "generalize"], ["discard", "litter"]], "answer": 2, "prefix": "3/d"}
26
+ {"stem": ["fawn", "deer"], "choice": [["adult", "baby"], ["girlfriend", "wife"], ["baby", "adult"]], "answer": 2, "prefix": "3/e"}
27
+ {"stem": ["wagon", "trailer"], "choice": [["spoon", "bowl"], ["bottle", "cylinder"], ["sword", "knife"]], "answer": 2, "prefix": "3/f"}
28
+ {"stem": ["stallion", "mare"], "choice": [["cup", "lid"], ["record", "cassette"], ["mother", "father"]], "answer": 2, "prefix": "3/g"}
29
+ {"stem": ["shorten", "distance"], "choice": [["food", "season"], ["obese", "body"], ["dim", "light"]], "answer": 2, "prefix": "3/h"}
30
+ {"stem": ["fat", "thin"], "choice": [["harmony", "unorganized"], ["shy", "outgoing"], ["full", "empty"]], "answer": 2, "prefix": "4/a"}
31
+ {"stem": ["bad", "good"], "choice": [["love", "apathy"], ["dull", "bright"], ["big", "small"]], "answer": 2, "prefix": "4/b"}
32
+ {"stem": ["peace", "war"], "choice": [["poop", "eat"], ["swim", "drown"], ["attract", "repel"]], "answer": 2, "prefix": "4/c"}
33
+ {"stem": ["above", "below"], "choice": [["tip", "root"], ["sad", "happy"], ["top", "bottom"]], "answer": 2, "prefix": "4/d"}
34
+ {"stem": ["social", "reclusive"], "choice": [["red", "blue"], ["sexy", "ugly"], ["lazy", "productive"]], "answer": 2, "prefix": "4/e"}
35
+ {"stem": ["rage", "happiness"], "choice": [["white", "gray"], ["late", "timely"], ["gigantic", "short"]], "answer": 2, "prefix": "4/f"}
36
+ {"stem": ["powerful", "meek"], "choice": [["thick", "thin"], ["raucous", "melodic"], ["good", "wrong"]], "answer": 2, "prefix": "4/g"}
37
+ {"stem": ["crack", "glass"], "choice": [["sleep", "insomnia"], ["deficiency", "health"], ["pimple", "skin"]], "answer": 2, "prefix": "4/h"}
38
+ {"stem": ["paper", "flimsy"], "choice": [["intellectual", "professor"], ["apple", "red"], ["villain", "evil"]], "answer": 2, "prefix": "5/a"}
39
+ {"stem": ["fragrant", "smelled"], "choice": [["burned", "wooden"], ["sickness", "curable"], ["elastic", "stretched"]], "answer": 2, "prefix": "5/b"}
40
+ {"stem": ["winner", "victory"], "choice": [["skinny", "athlete"], ["grace", "ballerina"], ["millionaire", "wealth"]], "answer": 2, "prefix": "5/c"}
41
+ {"stem": ["starving", "hunger"], "choice": [["brittle", "bones"], ["ignorant", "bliss"], ["happy", "contentment"]], "answer": 2, "prefix": "5/d"}
42
+ {"stem": ["pastor", "preach"], "choice": [["crash", "wave"], ["bag", "contain"], ["fire", "burn"]], "answer": 2, "prefix": "5/e"}
43
+ {"stem": ["dead", "rot"], "choice": [["burn", "hot"], ["austere", "scold"], ["unstable", "fall"]], "answer": 2, "prefix": "5/f"}
44
+ {"stem": ["sleep", "restful"], "choice": [["jump", "high"], ["walk", "slow"], ["crying", "emotional"]], "answer": 2, "prefix": "5/g"}
45
+ {"stem": ["listen", "audible"], "choice": [["apple", "picker"], ["hunter", "game"], ["eat", "edible"]], "answer": 2, "prefix": "5/h"}
46
+ {"stem": ["fire", "burnt"], "choice": [["fast", "car"], ["sell", "price"], ["teach", "educated"]], "answer": 2, "prefix": "5/i"}
47
+ {"stem": ["integrity", "dishonest"], "choice": [["object", "tangible"], ["alacrity", "reluctant"], ["fire", "cold"]], "answer": 2, "prefix": "6/a"}
48
+ {"stem": ["heartless", "compassionate"], "choice": [["hungry", "fed"], ["unflappable", "embarrassed"], ["impermeable", "penetrated"]], "answer": 2, "prefix": "6/b"}
49
+ {"stem": ["weakness", "strength"], "choice": [["silence", "dance"], ["ocean", "land"], ["novice", "experience"]], "answer": 2, "prefix": "6/c"}
50
+ {"stem": ["kind", "cruelty"], "choice": [["birth", "pregnant"], ["ecstatic", "angry"], ["employed", "jobless"]], "answer": 2, "prefix": "6/d"}
51
+ {"stem": ["friend", "betray"], "choice": [["reader", "read"], ["die", "immortal"], ["mute", "speak"]], "answer": 2, "prefix": "6/e"}
52
+ {"stem": ["quiet", "yell"], "choice": [["male", "bejewelled"], ["quiet", "obnoxious"], ["shy", "initiate"]], "answer": 2, "prefix": "6/f"}
53
+ {"stem": ["yell", "calmly"], "choice": [["piece", "bunch"], ["intoxicate", "sobriety"], ["lie", "honestly"]], "answer": 2, "prefix": "6/g"}
54
+ {"stem": ["heat", "frozen"], "choice": [["disobedient", "spank"], ["regret", "mistake"], ["fill", "empty"]], "answer": 2, "prefix": "6/h"}
55
+ {"stem": ["writer", "story"], "choice": [["stove", "meals"], ["blender", "slush"], ["spinner", "yarn"]], "answer": 2, "prefix": "7/a"}
56
+ {"stem": ["parent", "child"], "choice": [["tree", "arborist"], ["father", "son"], ["teacher", "student"]], "answer": 2, "prefix": "7/b"}
57
+ {"stem": ["gardener", "shovel"], "choice": [["shovel", "gardener"], ["doctor", "thermometer"], ["surgeon", "scalpel"]], "answer": 2, "prefix": "7/c"}
58
+ {"stem": ["shovel", "snow"], "choice": [["insult", "forgive"], ["bike", "path"], ["play", "instrument"]], "answer": 2, "prefix": "7/d"}
59
+ {"stem": ["give", "receiver"], "choice": [["child", "lecture"], ["borrow", "bank"], ["serve", "customer"]], "answer": 2, "prefix": "7/e"}
60
+ {"stem": ["diploma", "graduate"], "choice": [["sickness", "cough"], ["religion", "disciple"], ["treatment", "patient"]], "answer": 2, "prefix": "7/f"}
61
+ {"stem": ["hair", "brush"], "choice": [["vacuum", "carpet"], ["nail", "screwdriver"], ["blackboard", "chalk"]], "answer": 2, "prefix": "7/g"}
62
+ {"stem": ["student", "certification"], "choice": [["license", "driver"], ["knife", "butcher"], ["queen", "throne"]], "answer": 2, "prefix": "7/h"}
63
+ {"stem": ["fire", "burns"], "choice": [["sweat", "run"], ["disagreement", "anger"], ["injury", "pain"]], "answer": 2, "prefix": "8/a"}
64
+ {"stem": ["dirtiness", "bathe"], "choice": [["dizzy", "drunk"], ["clumsiness", "carefully"], ["tiredness", "rest"]], "answer": 2, "prefix": "8/b"}
65
+ {"stem": ["mouse", "computer"], "choice": [["match", "wood"], ["food", "eat"], ["battery", "flashlight"]], "answer": 2, "prefix": "8/c"}
66
+ {"stem": ["trim", "shorten"], "choice": [["starving", "hungry"], ["light", "illumination"], ["study", "learn"]], "answer": 2, "prefix": "8/d"}
67
+ {"stem": ["student", "graduation"], "choice": [["man", "sex"], ["farmer", "food"], ["students", "graduation"]], "answer": 2, "prefix": "8/e"}
68
+ {"stem": ["coat", "warmth"], "choice": [["euphoria", "heroin"], ["rain", "damp"], ["glue", "adhesion"]], "answer": 2, "prefix": "8/f"}
69
+ {"stem": ["airplane", "fly"], "choice": [["sweep", "broom"], ["cook", "stove"], ["pen", "write"]], "answer": 2, "prefix": "8/g"}
70
+ {"stem": ["moisturize", "dryness"], "choice": [["fast", "slow"], ["good", "bad"], ["vaccine", "virus"]], "answer": 2, "prefix": "8/h"}
71
+ {"stem": ["aquarium", "fish"], "choice": [["milk", "carton"], ["bathroom", "toilet"], ["forest", "trees"]], "answer": 2, "prefix": "9/a"}
72
+ {"stem": ["kitchen", "food"], "choice": [["fish", "aquarium"], ["zoo", "animal"], ["mill", "flour"]], "answer": 2, "prefix": "9/b"}
73
+ {"stem": ["church", "praying"], "choice": [["eating", "restaurant"], ["park", "playing"], ["kitchen", "cooking"]], "answer": 2, "prefix": "9/c"}
74
+ {"stem": ["office", "computer"], "choice": [["ball", "sport"], ["service", "hymnal"], ["casino", "cards"]], "answer": 2, "prefix": "9/d"}
75
+ {"stem": ["equator", "hemisphere"], "choice": [["roof", "gutters"], ["door", "inside"], ["shore", "lake"]], "answer": 2, "prefix": "9/e"}
76
+ {"stem": ["spring", "growth"], "choice": [["moon", "full"], ["vacation", "travel"], ["winter", "sledding"]], "answer": 2, "prefix": "9/f"}
77
+ {"stem": ["infancy", "bottle"], "choice": [["laughter", "parenthood"], ["parenthood", "laughter"], ["childhood", "crayon"]], "answer": 2, "prefix": "9/g"}
78
+ {"stem": ["title", "story"], "choice": [["movie", "preview"], ["paperwork", "appointment"], ["foreword", "novel"]], "answer": 2, "prefix": "9/h"}
79
+ {"stem": ["glove", "hand"], "choice": [["cat", "fur"], ["hand", "glove"], ["bracelet", "wrist"]], "answer": 2, "prefix": "9/i"}