MCPcopy Create free account
hub / github.com/NJUNLP/GTS / test

Function test

code/NNModel/main.py:116–126  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

114
115
116def 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
129if __name__=='__main__':

Callers 1

main.pyFile · 0.70

Calls 3

load_data_instancesFunction · 0.90
DataIteratorClass · 0.90
evalFunction · 0.70

Tested by

no test coverage detected