Open 1193700079 opened 2 years ago
print("加载并评估bilstm+crf模型...") crf_word2id, crf_tag2id = extend_maps(word2id, tag2id, for_crf=True) bilstm_model = load_model(BiLSTMCRF_MODEL_PATH) bilstm_model.model.bilstm.bilstm.flatten_parameters() # remove warning test_word_lists, test_tag_lists = prepocess_data_for_lstmcrf( test_word_lists, test_tag_lists, test=True ) lstmcrf_pred, target_tag_list = bilstm_model.test(test_word_lists, test_tag_lists, crf_word2id, crf_tag2id)
我只需要得到lstmcrf_pred就行了,然后为什么test参数一定要test_tag_lists
我只需要得到lstmcrf_pred就行了,然后为什么test参数一定要test_tag_lists