Datasets:

Modalities:
Text
Languages:
English
Size:
< 1K
ArXiv:
Libraries:
Datasets
License:
asahi417 commited on
Commit
6c1379c
1 Parent(s): ad24528
Files changed (3) hide show
  1. README.md +76 -0
  2. data.jsonl +45 -0
  3. scientific_and_creative_analogy.py +73 -0
README.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license:
5
+ - other
6
+ multilinguality:
7
+ - monolingual
8
+ size_categories:
9
+ - 1<n<1K
10
+ pretty_name: Relation Mapping
11
+ ---
12
+ # Dataset Card for "relbert/scientific_and_creative_analogy"
13
+ ## Dataset Description
14
+ - **Repository:** [https://github.com/taczin/SCAN_analogies](https://github.com/taczin/SCAN_analogies)
15
+ - **Paper:** [https://arxiv.org/abs/2211.15268](https://arxiv.org/abs/2211.15268)
16
+ - **Dataset:** Relation Mapping
17
+
18
+ ### Dataset Summary
19
+ A dataset for relation mapping task, which is a task to choose optimal combination of word pairs (see more detail in the [paper](https://www.jair.org/index.php/jair/article/view/10583)).
20
+
21
+
22
+ Relation mapping `M` is the set of bijective map in between two sets of terms (`A` and `B`):
23
+ ```
24
+ [set `A`]: ("solar system", "sun", "planet", "mass", "attracts", "revolves", "gravity")
25
+ [set `B`]: ("atom", "nucleus", "electron", "charge", "attracts", "revolves", "electromagnetism")
26
+
27
+ [Relation Mapping `M`]
28
+ * "solar system" -> "atom"
29
+ * "sun" -> "nucleus"
30
+ * "planet" -> "electron"
31
+ * "mass" -> "charge"
32
+ * "attracts" -> "attracts"
33
+ * "revolves" -> "revolves"
34
+ * "gravity" -> "electromagnetism"
35
+ ```
36
+
37
+ ***[Relation Mapping Problem](https://www.jair.org/index.php/jair/article/view/10583)*** is the task to identify the mapping `M` given the sets of terms `A` and `B`.
38
+
39
+
40
+ ## Dataset Structure
41
+ ### Data Instances
42
+ An example looks as follows.
43
+ ```
44
+ {
45
+ "id": "0",
46
+ "reference": ["buying an item", "accepting a belief"],
47
+ "source": ["buying an item", "buyer", "merchandise", "buying", "selling", "returning", "valuable", "worthless"],
48
+ "target": ["accepting a belief", "believer", "belief", "accepting", "advocating", "rejecting", "true", "false"],
49
+ "target_random": ["rejecting", "true", "false", "accepting a belief", "believer", "advocating", "belief", "accepting"],
50
+ "type": "metaphor"
51
+ }
52
+ ```
53
+
54
+ - `source`: A list of terms, which is the source of the relation mapping from.
55
+ - `target_random`: A list of terms, where we want to find a mapping from `source` to.
56
+ - `target`: A correctly ordered `target_random` that aligns with the `source`.
57
+
58
+ Given `source` and `target_random`, the task is to predict the correct order of `target_random` so that it matches `target`.
59
+ In average 7 terms are in the set, so the total number of possible order is 5040.
60
+
61
+
62
+ ### Data Splits
63
+ | name |test|
64
+ |---------|----:|
65
+ |relation_mapping| 45 |
66
+
67
+
68
+ ### Citation Information
69
+ ```
70
+ @article{czinczoll2022scientific,
71
+ title={Scientific and Creative Analogies in Pretrained Language Models},
72
+ author={Czinczoll, Tamara and Yannakoudakis, Helen and Mishra, Pushkar and Shutova, Ekaterina},
73
+ journal={arXiv preprint arXiv:2211.15268},
74
+ year={2022}
75
+ }
76
+ ```
data.jsonl ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"id": 0, "reference": ["buying an item", "accepting a belief"], "source": ["buying an item", "buyer", "merchandise", "buying", "selling", "returning", "valuable", "worthless"], "target": ["accepting a belief", "believer", "belief", "accepting", "advocating", "rejecting", "true", "false"], "target_random": ["rejecting", "true", "false", "accepting a belief", "believer", "advocating", "belief", "accepting"], "type": "metaphor"}
2
+ {"id": 1, "reference": ["hunger", "ambition"], "source": ["hunger", "food", "food", "satiation", "satiation", "scarcity", "starvation"], "target": ["ambition", "recognition", "nourishment", "achievement", "complacency", "competition", "failure"], "target_random": ["ambition", "failure", "competition", "complacency", "achievement", "nourishment", "recognition"], "type": "metaphor"}
3
+ {"id": 2, "reference": ["war", "argument"], "source": ["war", "soldier", "destroy", "fighting", "defeat", "attacks", "weapon", "battleground", "combatant", "position", "attack", "maneuver", "retreat", "surrender", "victory"], "target": ["argument", "debater", "refute", "arguing", "acceptance", "criticizes", "logic", "topic", "debater", "claim", "criticize", "rhetoric", "retraction", "loss", "win"], "target_random": ["acceptance", "logic", "criticizes", "debater", "claim", "refute", "argument", "retraction", "rhetoric", "arguing", "topic", "loss", "criticize", "win", "debater"], "type": "metaphor"}
4
+ {"id": 3, "reference": ["solar system", "atom"], "source": ["solar system", "sun", "planet", "mass", "attracts", "revolves", "gravity"], "target": ["atom", "nucleus", "electron", "charge", "attracts", "revolves", "electromagnetism"], "target_random": ["revolves", "nucleus", "charge", "electron", "atom", "electromagnetism", "attracts"], "type": "science"}
5
+ {"id": 4, "reference": ["slot machine", "bacterial mutation"], "source": ["slot machine", "slot machines", "reels", "spinning", "winning", "losing"], "target": ["bacterial mutation", "bacteria", "genes", "mutating", "reproducing", "dying"], "target_random": ["reproducing", "bacterial mutation", "mutating", "dying", "genes", "bacteria"], "type": "science"}
6
+ {"id": 5, "reference": ["hunt", "business"], "source": ["hunt", "prey", "prey", "prey", "field", "hunter", "weapon", "enemy", "battlefield", "weapon", "weapon", "weapon", "soldier", "trophy", "trophy", "trophy", "general", "army", "army"], "target": ["business", "client", "money", "profit", "market", "businessman", "product", "competitor", "market", "money", "product", "lawyer", "employee", "income", "profit", "client", "ceo", "company", "workers"], "target_random": ["ceo", "product", "business", "workers", "market", "income", "competitor", "money", "client", "lawyer", "employee", "company", "profit", "market", "client", "profit", "money", "businessman", "product"], "type": "metaphor"}
7
+ {"id": 6, "reference": ["mountain", "career"], "source": ["mountain", "ascent", "descent", "climb", "lift", "guide", "climber", "ascent", "descent", "climb", "lift", "guide", "climber", "ascent", "descent", "climb", "climber", "fuel", "fuel", "transport", "baggage", "traveller", "traveller", "destination", "car", "guide ", "ticket"], "target": ["career", "success", "failure", "work", "job", "boss", "worker", "success", "failure", "work", "job", "boss", "worker", "success", "failure", "work", "worker", "education", "skill", "job", "experience", "colleague", "worker", "retirement", "office", "boss", "funding"], "target_random": ["colleague", "success", "worker", "skill", "office", "work", "failure", "work", "success", "job", "education", "job", "job", "worker", "career", "experience", "boss", "work", "failure", "boss", "retirement", "worker", "failure", "worker", "success", "boss", "funding"], "type": "metaphor"}
8
+ {"id": 7, "reference": ["virus", "code"], "source": ["virus", "virus", "reproduction", "infection", "eradication", "vaccine"], "target": ["code", "malware", "replication", "installation", "removal", "antivirus"], "target_random": ["malware", "antivirus", "removal", "replication", "installation", "code"], "type": "science"}
9
+ {"id": 8, "reference": ["race", "competition"], "source": ["race", "racer", "racer", "track", "speed", "setback"], "target": ["competition", "competitor", "business", "market", "success", "failure"], "target_random": ["failure", "market", "competition", "business", "success", "competitor"], "type": "metaphor"}
10
+ {"id": 9, "reference": ["beast", "crime"], "source": ["beast", "beast", "prey", "capture", "cage", "hunt", "killing", "outbreak", "epidemic", "inoculation", "prevention", "precursor", "virus", "assessment", "quarantine", "diagnosis", "surgery", "patient"], "target": ["crime", "criminal", "victim", "arrest", "jail", "investigation", "execution", "spree", "spread", "information", "education", "poverty", "criminal", "trial", "prison", "sentence", "punishment", "society"], "target_random": ["spree", "information", "punishment", "crime", "prison", "execution", "criminal", "jail", "sentence", "education", "poverty", "investigation", "arrest", "criminal", "spread", "society", "trial", "victim"], "type": "metaphor"}
11
+ {"id": 10, "reference": ["battle", "debate"], "source": ["battle", "soldier", "ground", "ground", "weapon", "weapon", "weapon", "battlefield", "battlefield", "victorious", "tactic"], "target": ["debate", "opponent", "opinion", "stance", "argument", "knowledge", "intellect", "topic", "issue", "convincing", "argumentation"], "target_random": ["intellect", "topic", "argumentation", "convincing", "debate", "knowledge", "issue", "opponent", "argument", "stance", "opinion"], "type": "metaphor"}
12
+ {"id": 11, "reference": ["impediments to travel", "difficulties"], "source": ["impediments to travel", "obstructions", "destination", "route", "traveller", "travelling", "companion", "arriving"], "target": ["difficulties", "difficulties", "goal", "plan", "person", "problem solving", "partner", "succeeding"], "target_random": ["goal", "succeeding", "partner", "plan", "person", "difficulties", "difficulties", "problem solving"], "type": "metaphor"}
13
+ {"id": 12, "reference": ["journey", "education"], "source": ["journey", "stop", "station", "vehicle", "vehicle", "vehicle", "vehicle", "landscape", "destination", "traveller", "guide", "driver", "fuel", "conductor"], "target": ["education", "exam", "class", "lecture", "reading", "textbook", "book", "knowledge", "skill", "student", "teacher", "professor", "scholarship", "examiner"], "target_random": ["student", "teacher", "education", "lecture", "professor", "reading", "examiner", "textbook", "class", "knowledge", "book", "scholarship", "exam", "skill"], "type": "metaphor"}
14
+ {"id": 13, "reference": ["husbandry", "faith"], "source": ["husbandry", "herder", "sheep", "mastery", "slaughter", "herd"], "target": ["faith", "pope", "follower", "omniscience", "atonement", "congregation"], "target_random": ["omniscience", "faith", "congregation", "follower", "atonement", "pope"], "type": "metaphor"}
15
+ {"id": 14, "reference": ["building", "family"], "source": ["building", "foundation", "cement"], "target": ["family", "love", "understanding"], "target_random": ["family", "understanding", "love"], "type": "metaphor"}
16
+ {"id": 15, "reference": ["billiard balls", "gas molecules"], "source": ["billiard balls", "balls", "billiards", "speed", "table", "bouncing", "moving", "slow", "fast"], "target": ["gas molecules", "molecules", "gas", "temperature", "container", "pressing", "moving", "cold", "hot"], "target_random": ["pressing", "container", "temperature", "cold", "gas", "hot", "molecules", "gas molecules", "moving"], "type": "science"}
17
+ {"id": 16, "reference": ["household", "government"], "source": ["household", "house", "father", "servant", "father", "father", "housekeeper"], "target": ["government", "parliament", "president", "politician", "governor", "mayor", "secretary"], "target_random": ["parliament", "secretary", "government", "politician", "mayor", "governor", "president"], "type": "metaphor"}
18
+ {"id": 17, "reference": ["water flow", "heat transfer"], "source": ["water flow", "flows", "pressure", "water tower", "bucket", "filling", "emptying", "hydrodynamics"], "target": ["heat transfer", "transfers", "temperature", "burner", "kettle", "heating", "cooling", "thermodynamics"], "target_random": ["burner", "heat transfer", "cooling", "kettle", "thermodynamics", "temperature", "transfers", "heating"], "type": "science"}
19
+ {"id": 18, "reference": ["object", "idea"], "source": ["object", "hold", "weigh", "heavy", "light", "eating", "digestion", "feeding", "feeding", "food", "cooking", "appetite", "flavor", "cooking", "freshness", "staleness", "seasoning", "nutrition"], "target": ["idea", "understand", "analyze", "important", "trivial", "understanding", "comprehension", "teaching", "persuading", "theory", "creativity", "curiosity", "interestingness", "thinking", "originality", "irrelevance", "provocation", "learning"], "target_random": ["comprehension", "learning", "understand", "theory", "teaching", "creativity", "trivial", "irrelevance", "understanding", "idea", "interestingness", "originality", "provocation", "thinking", "important", "analyze", "persuading", "curiosity"], "type": "metaphor"}
20
+ {"id": 19, "reference": ["seeds", "ideas"], "source": ["seeds", "planted", "fruitful", "fruit", "grow", "wither", "blossom"], "target": ["ideas", "inspired", "productive", "product", "develop", "fail", "succeed"], "target_random": ["product", "succeed", "productive", "ideas", "inspired", "fail", "develop"], "type": "metaphor"}
21
+ {"id": 20, "reference": ["battle", "illness"], "source": ["battle", "warrior", "enemy", "weapon", "victory", "surrender", "traveler", "vehicle", "vehicle", "station", "station", "path", "milestone", "destination", "destination", "fuel"], "target": ["illness", "patient", "disease", "medicine", "health", "death", "patient", "virus", "disease", "diagnosis", "remission", "course", "stage", "death", "health", "infection"], "target_random": ["course", "remission", "death", "infection", "health", "virus", "disease", "stage", "illness", "health", "diagnosis", "patient", "medicine", "death", "disease", "patient"], "type": "metaphor"}
22
+ {"id": 21, "reference": ["bloom", "innovation"], "source": ["bloom", "water", "stem", "soil", "planting", "blossom", "greenhouse", "symbiosis", "water", "stem", "soil", "planting", "blossom", "greenhouse", "symbiosis", "water", "stem", "soil", "planting", "blossom", "greenhouse", "symbiosis"], "target": ["innovation", "funding", "research", "laboratory", "experiment", "idea", "conference", "collaboration", "funding", "research", "laboratory", "experiment", "idea", "conference", "collaboration", "funding", "research", "laboratory", "experiment", "idea", "conference", "collaboration"], "target_random": ["research", "experiment", "experiment", "collaboration", "idea", "idea", "laboratory", "funding", "laboratory", "conference", "collaboration", "conference", "research", "idea", "conference", "experiment", "research", "funding", "funding", "innovation", "laboratory", "collaboration"], "type": "metaphor"}
23
+ {"id": 22, "reference": ["liquid", "knowledge"], "source": ["liquid", "container", "container", "river", "emptiness", "pool", "pool"], "target": ["knowledge", "mind", "memory", "conversation", "forgetting", "repository", "book"], "target_random": ["book", "conversation", "forgetting", "mind", "repository", "memory", "knowledge"], "type": "metaphor"}
24
+ {"id": 23, "reference": ["theatre", "life"], "source": ["theatre", "stage", "actors", "actor", "script", "act", "act", "role", "decoration", "stage"], "target": ["life", "world", "people", "person", "history", "event", "age", "fate", "surroundings", "society"], "target_random": ["society", "person", "surroundings", "history", "event", "people", "world", "fate", "age", "life"], "type": "metaphor"}
25
+ {"id": 24, "reference": ["sound", "light"], "source": ["sound", "low", "high", "echoes", "loud", "quiet", "horn"], "target": ["light", "red", "violet", "reflects", "bright", "dim", "lens"], "target_random": ["bright", "violet", "lens", "dim", "red", "light", "reflects"], "type": "science"}
26
+ {"id": 25, "reference": ["journey", "love"], "source": ["journey", "traveler", "road", "destination", "destination", "progress", "milestone", "obstacle", "buyer", "goods", "terms"], "target": ["love", "lover", "relationship", "happiness", "separation", "improvement", "stage", "difficulty", "person", "attributes", "commitment"], "target_random": ["separation", "happiness", "lover", "attributes", "person", "stage", "difficulty", "love", "relationship", "commitment", "improvement"], "type": "metaphor"}
27
+ {"id": 26, "reference": ["boat", "marriage"], "source": ["boat", "passenger", "shipwreck", "storm", "storm", "sail", "sail", "rock", "rock", "anchor", "player", "playground", "match", "defeat"], "target": ["marriage", "spouse", "divorce", "quarrel", "anger", "happiness", "love", "affair", "problem", "home", "spouse", "home", "argument", "divorce"], "target_random": ["marriage", "quarrel", "affair", "argument", "home", "anger", "divorce", "spouse", "love", "divorce", "happiness", "spouse", "problem", "home"], "type": "metaphor"}
28
+ {"id": 27, "reference": ["computer", "mind"], "source": ["computer", "processing", "erasing", "write", "read", "memory", "outputs", "inputs", "bug", "working", "turned on", "turned off", "broken", "power", "repair", "hardware", "hardware", "software", "CPU", "RAM", "data"], "target": ["mind", "thinking", "forgetting", "memorize", "remember", "memory", "muscles", "senses", "mistake", "thinking", "awake", "asleep", "confused", "intelligence", "therapy", "brain", "neuron", "function", "consciousness", "memory", "input"], "target_random": ["senses", "input", "intelligence", "therapy", "memory", "confused", "remember", "memorize", "muscles", "asleep", "neuron", "awake", "brain", "mistake", "forgetting", "thinking", "mind", "function", "memory", "consciousness", "thinking"], "type": "science"}
29
+ {"id": 28, "reference": ["weapon", "money"], "source": ["weapon", "fighter", "fighter", "war", "war", "pouring", "flow", "flux", "flux", "outflow", "outflow", "container", "container", "sea", "source", "pool"], "target": ["money", "person", "businessman", "trade", "business", "investing", "transfer", "income", "profit", "loss", "spending", "bank", "account", "wealth", "salary", "capital"], "target_random": ["profit", "investing", "person", "account", "transfer", "income", "loss", "salary", "capital", "money", "trade", "businessman", "business", "wealth", "spending", "bank"], "type": "metaphor"}
30
+ {"id": 29, "reference": ["ship", "nation"], "source": ["ship", "ship", "captain", "crew", "passenger", "storm", "forecast", "father", "children", "disobedience", "punishment", "nurture"], "target": ["nation", "nation", "president", "congress", "citizen", "problem", "outlook", "law", "public ", "crime", "imprisonment", "aid"], "target_random": ["crime", "public ", "nation", "imprisonment", "congress", "law", "outlook", "aid", "nation", "citizen", "problem", "president"], "type": "metaphor"}
31
+ {"id": 30, "reference": ["artificial selection", "natural selection"], "source": ["artificial selection", "breeds", "selection", "conformance", "artificial", "popularity", "breeding", "domesticated"], "target": ["natural selection", "species", "competition", "adaptation", "natural", "fitness", "mating", "wild"], "target_random": ["wild", "competition", "fitness", "adaptation", "natural selection", "species", "mating", "natural"], "type": "science"}
32
+ {"id": 31, "reference": ["projectile", "planet"], "source": ["projectile", "trajectory", "earth", "parabolic", "air", "gravity", "attracts"], "target": ["planet", "orbit", "sun", "elliptical", "space", "gravity", "attracts"], "target_random": ["orbit", "gravity", "sun", "planet", "elliptical", "attracts", "space"], "type": "science"}
33
+ {"id": 32, "reference": ["courtship", "politics"], "source": ["courtship", "suitor", "suitor", "woman", "rival", "wooing", "player", "bet", "rules", "playground", "ball", "toy", "actor", "performance", "stage", "critic", "audience", "audience", "politician", "algorithm", "operator", "oil", "oil", "oil", "breakdown", "rust"], "target": ["politics", "incumbent", "politician", "public", "challenger", "campaigning", "politician", "election", "law", "parliament", "press", "citizen", "politician", "campaign", "parliament", "press", "people", "citizens", "politician", "law", "president", "press", "campaign", "money", "crisis", "corruption"], "target_random": ["politician", "law", "challenger", "incumbent", "press", "law", "campaigning", "citizen", "politician", "press", "campaign", "politician", "election", "crisis", "politics", "parliament", "public", "politician", "president", "press", "citizens", "campaign", "money", "people", "corruption", "parliament"], "type": "metaphor"}
34
+ {"id": 33, "reference": ["disease", "poverty"], "source": ["disease", "doctor", "doctor", "patient", "hospital", "medicine", "medicine", "cure"], "target": ["poverty", "politician", "benefactor", "citizen", "state", "subsidy", "payment", "money"], "target_random": ["subsidy", "citizen", "state", "money", "politician", "payment", "poverty", "benefactor"], "type": "metaphor"}
35
+ {"id": 34, "reference": ["grounds for a building", "reasons for a theory"], "source": ["grounds for a building", "foundations", "buildings", "supporting", "solid", "weak", "crack"], "target": ["reasons for a theory", "reasons", "theories", "confirming", "rational", "dubious", "flaw"], "target_random": ["flaw", "theories", "dubious", "confirming", "reasons for a theory", "rational", "reasons"], "type": "metaphor"}
36
+ {"id": 35, "reference": ["hunt", "research"], "source": ["hunt", "prey", "prey", "slay", "field", "hunter", "weapon"], "target": ["research", "idea", "information", "find", "laboratory", "researcher", "instrument"], "target_random": ["information", "researcher", "find", "instrument", "laboratory", "research", "idea"], "type": "metaphor"}
37
+ {"id": 36, "reference": ["combustion", "respiration"], "source": ["combustion", "fire", "fuel", "burning", "hot", "intense", "oxygen", "carbon dioxide"], "target": ["respiration", "animal", "food", "breathing", "living", "vigorous", "oxygen", "carbon dioxide"], "target_random": ["oxygen", "animal", "carbon dioxide", "food", "vigorous", "living", "respiration", "breathing"], "type": "science"}
38
+ {"id": 37, "reference": ["possession", "skill"], "source": ["possession", "owner", "acquisition", "acquisition", "acquisition"], "target": ["skill", "person", "learning", "education", "practice"], "target_random": ["practice", "skill", "learning", "education", "person"], "type": "metaphor"}
39
+ {"id": 38, "reference": ["organism", "society"], "source": ["organism", "cell", "cell", "organ", "tissue", "vein", "passenger", "passengers", "tracks", "tracks", "route", "coach", "driver", "ticket", "destination", "fuel"], "target": ["society", "person", "citizen", "organisation", "people", "communication", "citizen", "people", "law", "constitution", "history", "class", "leader", "passport", "future", "budget"], "target_random": ["people", "budget", "constitution", "law", "communication", "citizen", "society", "class", "person", "history", "leader", "citizen", "people", "organisation", "passport", "future"], "type": "metaphor"}
40
+ {"id": 39, "reference": ["waves", "sounds"], "source": ["waves", "shore", "reflects", "water", "breakwater", "rough", "calm", "crashing"], "target": ["sounds", "wall", "echoes", "air", "insulation", "loud", "quiet", "vibrating"], "target_random": ["air", "wall", "insulation", "loud", "sounds", "vibrating", "echoes", "quiet"], "type": "science"}
41
+ {"id": 40, "reference": ["war", "sport"], "source": ["war", "army", "general", "battle", "battle", "battle", "soldier", "soldier", "soldier", "frontline", "weapon"], "target": ["sport", "team", "coach", "match", "game", "race", "sportsman", "footballer", "player", "field", "ball"], "target_random": ["coach", "sport", "match", "player", "team", "game", "race", "ball", "field", "footballer", "sportsman"], "type": "metaphor"}
42
+ {"id": 41, "reference": ["family", "state"], "source": ["family", "father", "father", "child", "rule", "parent", "food", "home"], "target": ["state", "president", "governor", "citizen", "law", "government", "subsidies", "nation"], "target_random": ["government", "subsidies", "state", "nation", "citizen", "governor", "president", "law"], "type": "metaphor"}
43
+ {"id": 42, "reference": ["building", "theory"], "source": ["building", "construction", "construction", "foundation", "foundation", "cement", "block", "foundation", "framework", "framework", "architect"], "target": ["theory", "conjecture", "idea", "data", "evidence", "relation", "concept", "axiom", "proposition", "logic", "scientist"], "target_random": ["idea", "scientist", "data", "proposition", "conjecture", "axiom", "concept", "logic", "evidence", "theory", "relation"], "type": "metaphor"}
44
+ {"id": 43, "reference": ["money", "time"], "source": ["money", "allocate", "budget", "effective", "cheap", "expensive"], "target": ["time", "invest", "schedule", "efficient", "quick", "slow"], "target_random": ["invest", "quick", "time", "efficient", "slow", "schedule"], "type": "metaphor"}
45
+ {"id": 44, "reference": ["following", "understanding"], "source": ["following", "follow", "leader", "path", "follower", "lost", "wanders", "twisted", "straight", "light", "illuminating", "darkness", "view", "hidden"], "target": ["understanding", "understand", "speaker", "argument", "listener", "misunderstood", "digresses", "complicated", "simple", "knowledge", "explaining", "confusion", "interpretation", "secret"], "target_random": ["argument", "misunderstood", "understand", "complicated", "interpretation", "knowledge", "confusion", "simple", "understanding", "listener", "digresses", "explaining", "speaker", "secret"], "type": "metaphor"}
scientific_and_creative_analogy.py ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import datasets
3
+
4
+ logger = datasets.logging.get_logger(__name__)
5
+ _DESCRIPTION = """Dataset for relation mapping task (see [paper](https://arxiv.org/abs/2211.15268))."""
6
+ _NAME = "scientific_and_creative_analogy"
7
+ _VERSION = "0.0.0"
8
+ _CITATION = """
9
+ @article{czinczoll2022scientific,
10
+ title={Scientific and Creative Analogies in Pretrained Language Models},
11
+ author={Czinczoll, Tamara and Yannakoudakis, Helen and Mishra, Pushkar and Shutova, Ekaterina},
12
+ journal={arXiv preprint arXiv:2211.15268},
13
+ year={2022}
14
+ }
15
+ """
16
+ _HOME_PAGE = "https://github.com/taczin/SCAN_analogies"
17
+ _URLS = {
18
+ str(datasets.Split.TEST): [f'https://huggingface.co/datasets/relbert/{_NAME}/raw/main/data.jsonl']
19
+ }
20
+
21
+
22
+ class ScientificAndCreativeAnalogyConfig(datasets.BuilderConfig):
23
+ """BuilderConfig"""
24
+
25
+ def __init__(self, **kwargs):
26
+ """BuilderConfig.
27
+ Args:
28
+ **kwargs: keyword arguments forwarded to super.
29
+ """
30
+ super(ScientificAndCreativeAnalogyConfig, self).__init__(**kwargs)
31
+
32
+
33
+ class ScientificAndCreativeAnalogy(datasets.GeneratorBasedBuilder):
34
+ """Dataset."""
35
+
36
+ BUILDER_CONFIGS = [
37
+ ScientificAndCreativeAnalogyConfig(name=_NAME, version=datasets.Version(_VERSION), description=_DESCRIPTION),
38
+ ]
39
+
40
+ def _split_generators(self, dl_manager):
41
+ downloaded_file = dl_manager.download_and_extract(_URLS)
42
+ return [datasets.SplitGenerator(
43
+ name=str(datasets.Split.TEST), gen_kwargs={"filepaths": downloaded_file[str(datasets.Split.TEST)]})
44
+ ]
45
+
46
+ def _generate_examples(self, filepaths):
47
+ _key = 0
48
+ for filepath in filepaths:
49
+ logger.info(f"generating examples from = {filepath}")
50
+ with open(filepath, encoding="utf-8") as f:
51
+ _list = [i for i in f.read().split('\n') if len(i) > 0]
52
+ for i in _list:
53
+ data = json.loads(i)
54
+ yield _key, data
55
+ _key += 1
56
+
57
+ def _info(self):
58
+ return datasets.DatasetInfo(
59
+ description=_DESCRIPTION,
60
+ features=datasets.Features(
61
+ {
62
+ "id": datasets.Value("string"),
63
+ "type": datasets.Value("string"),
64
+ "reference": datasets.Sequence(datasets.Value("string")),
65
+ "source": datasets.Sequence(datasets.Value("string")),
66
+ "target": datasets.Sequence(datasets.Value("string")),
67
+ "target_random": datasets.Sequence(datasets.Value("string")),
68
+ }
69
+ ),
70
+ supervised_keys=None,
71
+ homepage=_HOME_PAGE,
72
+ citation=_CITATION,
73
+ )