(args)
| 114 | |
| 115 | |
| 116 | def test(args): |
| 117 | print("Evaluation on testset:") |
| 118 | model_path = args.model_dir + args.model + args.task + '.pt' |
| 119 | model = torch.load(model_path).to(args.device) |
| 120 | model.eval() |
| 121 | |
| 122 | word2index = json.load(open(args.prefix + 'doubleembedding/word_idx.json')) |
| 123 | sentence_packs = json.load(open(args.prefix + args.dataset + '/test.json')) |
| 124 | instances = load_data_instances(sentence_packs, word2index, args) |
| 125 | testset = DataIterator(instances, args) |
| 126 | eval(model, testset, args) |
| 127 | |
| 128 | |
| 129 | if __name__=='__main__': |
no test coverage detected