File size: 884 Bytes
99614d2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import sys

sys.path.append('../')

from evaluation.encoders import Model
from evaluation.evaluator import SupervisedEvaluator, SupervisedTask

#default no control codes
model = Model(base_checkpoint="allenai/specter")

#default control codes
# model = Model(base_checkpoint="../lightning_logs/full_run/scincl_ctrl/checkpoints/", task_id="[RGN]", use_ctrl_codes=True)

#single adapters
# model = Model(base_checkpoint="malteos/scincl", variant="adapters",
#               adapters_load_from="../lightning_logs/full_run/scincl_adapters/checkpoints/", task_id="[RGN]")

evaluator = SupervisedEvaluator("max hIndex", SupervisedTask.REGRESSION, ("allenai/scirepeval", "peer_review_score_hIndex"),
                                ("allenai/scirepeval_test", "hIndex"), model, metrics=("pearsonr","kendalltau"))

embeddings = evaluator.generate_embeddings()

evaluator.evaluate(embeddings)