forked from ShulinCao/OpenNRE-PyTorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
31 lines (30 loc) · 775 Bytes
/
Copy pathtest.py
File metadata and controls
31 lines (30 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import config
import models
import numpy as np
import os
import time
import datetime
import json
from sklearn.metrics import average_precision_score
import sys
import os
import argparse
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
parser = argparse.ArgumentParser()
parser.add_argument('--model_name', type = str, default = 'pcnn_att', help = 'name of the model')
args = parser.parse_args()
model = {
'pcnn_att': models.PCNN_ATT,
'pcnn_one': models.PCNN_ONE,
'pcnn_ave': models.PCNN_AVE,
'cnn_att': models.CNN_ATT,
'cnn_one': models.CNN_ONE,
'cnn_ave': models.CNN_AVE
}
con = config.Config()
con.set_max_epoch(27)
con.load_test_data()
con.set_test_model(model[args.model_name])
con.set_epoch_range(list(range(10,20)))
con.test()
# con.predict(27,store_path='lstm_predict')