songyingxin / Bert-TextClassification

Implemention some Baseline Model upon Bert for Text Classification
Other
682 stars 149 forks source link

代码好几处运行报错 #3

Closed Biaocsu closed 4 years ago

Biaocsu commented 5 years ago

你好,我运行你的代码有好几处报错,改起来有点吃力,你是否可以更新一下,谢谢啊。 1、在Utils/utils.py文件line 33处,report = metrics.classification_report(labels, preds, labels=labels_list, target_names=label_list, digits=5, output_dict=True),其中output_dict=True未定义需要删掉。 2、Utils/train_evaluate.py文件line106处,会出现这样的错误:TypeError: string indices must be integers 如果你能帮忙改正一下将是极好的

Biaocsu commented 5 years ago

我将tensorboard的这些功能全部注释掉就不会有问题了。另外,可否麻烦你提供一个文本分类预测的脚本,即从外部传入一个txt文件,识别其类型,感谢,哈哈哈哈

7125messi commented 5 years ago

tensorboardX会报错 image

songyingxin commented 5 years ago

这些问题主要是包版本不同引起的, 上面是由于 Scikit-learn, 下面那个是由于 tensorboardx, 我会更新一下 requirement, 请按照 requirement 来使用更佳。