init
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- README.md +7 -7
- experiments/baseline_fasttext.py +2 -1
- experiments/baseline_fasttext_zeroshot.py +2 -1
- experiments/baseline_lm_lc_zeroshot.py +1 -1
- experiments/baseline_lm_qa_zeroshot.py +2 -1
- experiments/baseline_relbert.py +1 -1
- experiments/figures/fewshots/lc.average.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/lc.average.fewshot.png +2 -2
- experiments/figures/fewshots/lc.competitor-rival_of.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/lc.competitor-rival_of.fewshot.png +2 -2
- experiments/figures/fewshots/lc.friend-ally_of.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/lc.friend-ally_of.fewshot.png +2 -2
- experiments/figures/fewshots/lc.influenced_by.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/lc.influenced_by.fewshot.png +2 -2
- experiments/figures/fewshots/lc.known_for.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/lc.known_for.fewshot.png +2 -2
- experiments/figures/fewshots/lc.similar_to.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/lc.similar_to.fewshot.png +2 -2
- experiments/figures/fewshots/qa.average.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/qa.average.fewshot.png +2 -2
- experiments/figures/fewshots/qa.competitor-rival_of.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/qa.competitor-rival_of.fewshot.png +2 -2
- experiments/figures/fewshots/qa.friend-ally_of.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/qa.friend-ally_of.fewshot.png +2 -2
- experiments/figures/fewshots/qa.influenced_by.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/qa.influenced_by.fewshot.png +2 -2
- experiments/figures/fewshots/qa.known_for.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/qa.known_for.fewshot.png +2 -2
- experiments/figures/fewshots/qa.similar_to.fewshot.landscape.png +2 -2
- experiments/figures/fewshots/qa.similar_to.fewshot.png +2 -2
- experiments/figures/main/lc.average.landscape.png +2 -2
- experiments/figures/main/lc.average.png +2 -2
- experiments/figures/main/lc.competitor-rival_of.landscape.png +2 -2
- experiments/figures/main/lc.competitor-rival_of.png +2 -2
- experiments/figures/main/lc.friend-ally_of.landscape.png +2 -2
- experiments/figures/main/lc.friend-ally_of.png +2 -2
- experiments/figures/main/lc.influenced_by.landscape.png +2 -2
- experiments/figures/main/lc.influenced_by.png +2 -2
- experiments/figures/main/lc.known_for.landscape.png +2 -2
- experiments/figures/main/lc.known_for.png +2 -2
- experiments/figures/main/lc.similar_to.landscape.png +2 -2
- experiments/figures/main/lc.similar_to.png +2 -2
- experiments/figures/main/qa.average.landscape.png +2 -2
- experiments/figures/main/qa.average.png +2 -2
- experiments/figures/main/qa.competitor-rival_of.landscape.png +2 -2
- experiments/figures/main/qa.competitor-rival_of.png +2 -2
- experiments/figures/main/qa.friend-ally_of.landscape.png +2 -2
- experiments/figures/main/qa.friend-ally_of.png +2 -2
- experiments/figures/main/qa.influenced_by.landscape.png +2 -2
- experiments/figures/main/qa.influenced_by.png +2 -2
README.md
CHANGED
@@ -39,13 +39,13 @@ THe test set is private at the moment.
|
|
39 |
### Dataset Summary
|
40 |
|
41 |
|
42 |
-
| relation_type
|
43 |
-
|
44 |
-
|
|
45 |
-
|
|
46 |
-
|
|
47 |
-
|
|
48 |
-
| similar to
|
49 |
|
50 |
## Dataset Structure
|
51 |
### Data Instances
|
|
|
39 |
### Dataset Summary
|
40 |
|
41 |
|
42 |
+
| relation_type | val. | test |
|
43 |
+
|:--------------------|-------:|-------:|
|
44 |
+
| competitor/rival of | 20 | 84 |
|
45 |
+
| friend/ally of | 19 | 88 |
|
46 |
+
| influenced by | 19 | 90 |
|
47 |
+
| known for | 18 | 105 |
|
48 |
+
| similar to | 19 | 89 |
|
49 |
|
50 |
## Dataset Structure
|
51 |
### Data Instances
|
experiments/baseline_fasttext.py
CHANGED
@@ -4,12 +4,13 @@ import os
|
|
4 |
import json
|
5 |
from statistics import mean
|
6 |
import pandas as pd
|
7 |
-
from gensim.models import fasttext
|
8 |
from datasets import load_dataset
|
9 |
|
10 |
|
11 |
# load fasttext
|
12 |
def load_model():
|
|
|
|
|
13 |
os.makedirs('./cache', exist_ok=True)
|
14 |
path = './cache/crawl-300d-2M-subword.bin'
|
15 |
if not os.path.exists(path):
|
|
|
4 |
import json
|
5 |
from statistics import mean
|
6 |
import pandas as pd
|
|
|
7 |
from datasets import load_dataset
|
8 |
|
9 |
|
10 |
# load fasttext
|
11 |
def load_model():
|
12 |
+
from gensim.models import fasttext
|
13 |
+
|
14 |
os.makedirs('./cache', exist_ok=True)
|
15 |
path = './cache/crawl-300d-2M-subword.bin'
|
16 |
if not os.path.exists(path):
|
experiments/baseline_fasttext_zeroshot.py
CHANGED
@@ -3,12 +3,13 @@ import requests
|
|
3 |
import os
|
4 |
import json
|
5 |
import pandas as pd
|
6 |
-
from gensim.models import fasttext
|
7 |
from datasets import load_dataset
|
8 |
|
9 |
|
10 |
# load fasttext
|
11 |
def load_model():
|
|
|
|
|
12 |
os.makedirs('./cache', exist_ok=True)
|
13 |
path = './cache/crawl-300d-2M-subword.bin'
|
14 |
if not os.path.exists(path):
|
|
|
3 |
import os
|
4 |
import json
|
5 |
import pandas as pd
|
|
|
6 |
from datasets import load_dataset
|
7 |
|
8 |
|
9 |
# load fasttext
|
10 |
def load_model():
|
11 |
+
from gensim.models import fasttext
|
12 |
+
|
13 |
os.makedirs('./cache', exist_ok=True)
|
14 |
path = './cache/crawl-300d-2M-subword.bin'
|
15 |
if not os.path.exists(path):
|
experiments/baseline_lm_lc_zeroshot.py
CHANGED
@@ -14,7 +14,7 @@ prompt_dict = {
|
|
14 |
"influenced by": "what has influenced different entities",
|
15 |
"similar to": "examples of entities that are similar"
|
16 |
}
|
17 |
-
data = load_dataset("cardiffnlp/
|
18 |
full_result = []
|
19 |
for lm, ppl_class, batch, pretty_name in [
|
20 |
("google/flan-ul2", EncoderDecoderLM, 1, "Flan-UL2"),
|
|
|
14 |
"influenced by": "what has influenced different entities",
|
15 |
"similar to": "examples of entities that are similar"
|
16 |
}
|
17 |
+
data = load_dataset("cardiffnlp/relentless", split="test")
|
18 |
full_result = []
|
19 |
for lm, ppl_class, batch, pretty_name in [
|
20 |
("google/flan-ul2", EncoderDecoderLM, 1, "Flan-UL2"),
|
experiments/baseline_lm_qa_zeroshot.py
CHANGED
@@ -14,7 +14,7 @@ prompt_dict = {
|
|
14 |
"influenced by": "what has influenced different entities",
|
15 |
"similar to": "examples of entities that are similar"
|
16 |
}
|
17 |
-
data = load_dataset("cardiffnlp/
|
18 |
full_result = []
|
19 |
for lm, ppl_class, batch, pretty_name in [
|
20 |
("google/flan-ul2", EncoderDecoderLM, 1, "Flan-UL2"),
|
@@ -28,6 +28,7 @@ for lm, ppl_class, batch, pretty_name in [
|
|
28 |
ppl_file = f"results/lm_qa_zeroshot/{os.path.basename(lm)}/ppl.{d['relation_type'].replace(' ', '_').replace('/', '__')}.jsonl"
|
29 |
|
30 |
if not os.path.exists(ppl_file):
|
|
|
31 |
|
32 |
if scorer is None:
|
33 |
if ppl_class is OpenAI:
|
|
|
14 |
"influenced by": "what has influenced different entities",
|
15 |
"similar to": "examples of entities that are similar"
|
16 |
}
|
17 |
+
data = load_dataset("cardiffnlp/relentless", split="test")
|
18 |
full_result = []
|
19 |
for lm, ppl_class, batch, pretty_name in [
|
20 |
("google/flan-ul2", EncoderDecoderLM, 1, "Flan-UL2"),
|
|
|
28 |
ppl_file = f"results/lm_qa_zeroshot/{os.path.basename(lm)}/ppl.{d['relation_type'].replace(' ', '_').replace('/', '__')}.jsonl"
|
29 |
|
30 |
if not os.path.exists(ppl_file):
|
31 |
+
input(ppl_file)
|
32 |
|
33 |
if scorer is None:
|
34 |
if ppl_class is OpenAI:
|
experiments/baseline_relbert.py
CHANGED
@@ -3,7 +3,6 @@ import json
|
|
3 |
import pandas as pd
|
4 |
from statistics import mean
|
5 |
from datasets import load_dataset
|
6 |
-
from relbert import RelBERT
|
7 |
|
8 |
|
9 |
def cosine_similarity(a, b):
|
@@ -27,6 +26,7 @@ for lm in ['base', 'large']:
|
|
27 |
if not os.path.exists(ppl_file):
|
28 |
|
29 |
if scorer is None:
|
|
|
30 |
scorer = RelBERT(f"relbert/relbert-roberta-{lm}")
|
31 |
anchor_embeddings = scorer.get_embedding(d['prototypical_examples'])
|
32 |
option_embeddings = scorer.get_embedding(d['pairs'], batch_size=64)
|
|
|
3 |
import pandas as pd
|
4 |
from statistics import mean
|
5 |
from datasets import load_dataset
|
|
|
6 |
|
7 |
|
8 |
def cosine_similarity(a, b):
|
|
|
26 |
if not os.path.exists(ppl_file):
|
27 |
|
28 |
if scorer is None:
|
29 |
+
from relbert import RelBERT
|
30 |
scorer = RelBERT(f"relbert/relbert-roberta-{lm}")
|
31 |
anchor_embeddings = scorer.get_embedding(d['prototypical_examples'])
|
32 |
option_embeddings = scorer.get_embedding(d['pairs'], batch_size=64)
|
experiments/figures/fewshots/lc.average.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.average.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.competitor-rival_of.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.competitor-rival_of.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.friend-ally_of.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.friend-ally_of.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.influenced_by.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.influenced_by.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.known_for.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.known_for.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.similar_to.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/lc.similar_to.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.average.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.average.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.competitor-rival_of.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.competitor-rival_of.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.friend-ally_of.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.friend-ally_of.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.influenced_by.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.influenced_by.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.known_for.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.known_for.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.similar_to.fewshot.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/fewshots/qa.similar_to.fewshot.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.average.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.average.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.competitor-rival_of.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.competitor-rival_of.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.friend-ally_of.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.friend-ally_of.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.influenced_by.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.influenced_by.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.known_for.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.known_for.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.similar_to.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/lc.similar_to.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/qa.average.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/qa.average.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/qa.competitor-rival_of.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/qa.competitor-rival_of.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/qa.friend-ally_of.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/qa.friend-ally_of.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/qa.influenced_by.landscape.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|
experiments/figures/main/qa.influenced_by.png
CHANGED
![]() |
Git LFS Details
|
![]() |
Git LFS Details
|