crownpku / Information-Extraction-Chinese

Chinese Named Entity Recognition with IDCNN/biLSTM+CRF, and Relation Extraction with biGRU+2ATT 中文实体识别与关系提取
2.22k stars 814 forks source link

test_GRU中执行main_for_evalution问题 #56

Open DENGCPU opened 6 years ago

DENGCPU commented 6 years ago

您好,我在运行test_GRU中的main_for_evalution 函数时,出现以下问题: File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 124, in run _sys.exit(main(argv)) File "test_evaluation.py", line 122, in main average_precision = average_precision_score(allans, allprob) File "/usr/local/lib/python3.5/dist-packages/sklearn/metrics/ranking.py", line 199, in average_precision_score sample_weight=sample_weight) File "/usr/local/lib/python3.5/dist-packages/sklearn/metrics/base.py", line 75, in _average_binary_score return binary_metric(y_true, y_score, sample_weight=sample_weight) File "/usr/local/lib/python3.5/dist-packages/sklearn/metrics/ranking.py", line 191, in _binary_uninterpolated_average_precision y_true, y_score, sample_weight=sample_weight) File "/usr/local/lib/python3.5/dist-packages/sklearn/metrics/ranking.py", line 441, in precision_recall_curve sample_weight=sample_weight) File "/usr/local/lib/python3.5/dist-packages/sklearn/metrics/ranking.py", line 320, in _binary_clf_curve check_consistent_length(y_true, y_score, sample_weight) File "/usr/local/lib/python3.5/dist-packages/sklearn/utils/validation.py", line 204, in check_consistent_length " samples: %r" % [int(l) for l in lengths]) ValueError: Found input variables with inconsistent numbers of samples: [12008, 12000] 不知道怎么解决,想咨询下您

jufengada commented 6 years ago

我也是遇到这个问题了

suiyuan2009 commented 6 years ago

refer to this comment.