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']
This IS expected if you are initializing AlbertForTokenClassification from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
This IS NOT expected if you are initializing AlbertForTokenClassification from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Some weights of AlbertForTokenClassification were not initialized from the model checkpoint at /home/data/PLMs-in-Practical-KBQA-main/pretrain/albert-base-v2_output and are newly initialized: ['classifier.bias', 'classifier.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
INFO:simpletransformers.ner.ner_model: Converting to features started.
100%|█████████████████████████████████████████████| 1/1 [00:02<00:00, 2.83s/it]
Running Evaluation: 100%|█████████████████████████| 1/1 [00:00<00:00, 3.87it/s]
/home/pmi/anaconda3/envs/kgqa/lib/python3.7/site-packages/seqeval/metrics/v1.py:57: UndefinedMetricWarning: Recall is ill-defined and being set to 0.0 due to no true samples. Use zero_division parameter to control this behavior.
_warn_prf(average, modifier, msg_start, len(result))
INFO:simpletransformers.ner.ner_model:{'eval_loss': 1.4158203601837158, 'precision': 0.0, 'recall': 0.0, 'f1_score': 0.0}
Traceback (most recent call last):
File "/home/pmi/.pycharm_helpers/pydev/pydevd.py", line 1491, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/pmi/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/data/PLMs-in-Practical-KBQA-main/main/entity_detection/ner_label.py", line 54, in
P, R, F = evaluation_my(truth, preds_list, type=False)
File "/home/data/PLMs-in-Practical-KBQA-main/main/entity_detection/evaluation.py", line 78, in evaluation_my
python-BaseException
pred_label = pred[i]
IndexError: list index out of range
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']
zero_division
parameter to control this behavior. _warn_prf(average, modifier, msg_start, len(result)) INFO:simpletransformers.ner.ner_model:{'eval_loss': 1.4158203601837158, 'precision': 0.0, 'recall': 0.0, 'f1_score': 0.0} Traceback (most recent call last): File "/home/pmi/.pycharm_helpers/pydev/pydevd.py", line 1491, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/home/pmi/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/data/PLMs-in-Practical-KBQA-main/main/entity_detection/ner_label.py", line 54, inner_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) #此处报上面的错!
谢谢!