HuuuNan / PLMs-in-Practical-KBQA

The code of An Empirical Study of Pre-trained Language Models in Simple Knowledge Graph Question Answering
33 stars 8 forks source link

ner_label.py 报错 #2

Closed gitgoready closed 1 year ago

gitgoready commented 1 year ago

Connected to pydev debugger (build 221.5080.210) Some weights of the model checkpoint at /home/data/PLMs-in-Practical-KBQA-main/pretrain/albert-base-v2_output were not used when initializing AlbertForTokenClassification: ['predictions.decoder.weight', 'predictions.bias', 'predictions.LayerNorm.bias', 'predictions.LayerNorm.weight', 'predictions.dense.weight', 'predictions.dense.bias', 'predictions.decoder.bias']

ner_label.py文件: 文件路径这样配?: train_data = '../../mydata1/train.txt' valid_data = '../../mydata1/valid.txt' test_data='../../mydata1/test.txt'

......

model = NERModel(TYPE,MODEL+'_output', args=model_args, labels=custom_labels,use_cuda=True) result, model_outputs, preds_list = model.eval_model(valid_data) #改成text_data train_data都出错! test_csv=pd.read_table('../../mydata/valid.txt', header=None, names=["lineid", "entity_mid", "entity_name", "relation", "object", "question", "tags"]) #这个valid文件地址对的吗? truth=test_csv['tags']

P, R, F = evaluation_my(truth, preds_list, type=False) #此处报上面的错!

谢谢!

gitgoready commented 1 year ago

ner.py ner_label.py文件中的test_sentence.txt _label.txt 缺乏

gitgoready commented 1 year ago

entity_linking.py 文件中提及的 kb_105M/entity.pkl 缺乏,能否将流程再详细补充一下,资源文件等补充一下,感谢!

wuyike2000 commented 1 year ago

你需要先运行data_convert.py转换数据格式。105M和202M KB的相关字典文件已经更新。