基于CNN的中文文本分类算法(可应用于垃圾邮件过滤、情感分析等场景)

上传者: 44510615 | 上传时间: 2021-07-08 15:02:43 | 文件大小: 13.32MB | 文件类型: ZIP
基于CNN的中文文本分类算法(可应用于垃圾邮件过滤、情感分析等场景) 利用word2vec先获取中文测试数据集中各个字的向量表达,再输入卷积网络进行分类。 运行方法 训练 run python train.py to train the cnn with the spam and ham files (only support chinese!) (change the config filepath in FLAGS to your own) 在tensorboard上查看summaries run tensorboard --logdir /{PATH_TO_CODE}/runs/{TIME_DIR}/summaries/ to view summaries in web view 测试、分类 run python eval.py --checkpoint_dir /{PATH_TO_CODE/runs/{TIME_DIR}/checkpoints} 如果需要分类自己提供的文件,请更改相关输入参数 如果需要测试准确率,需要指定对应的标签文件(input_label_file): python eval.py --input_label_file /PATH_TO_INPUT_LABEL_FILE 说明:input_label_file中的每一行是0或1,需要与input_text_file中的每一行对应。 在eval.py中,如果有这个对照标签文件input_label_file,则会输出预测的准确率 推荐运行环境 python 2.7.13 :: Anaconda 4.3.1 (64-bit) tensorflow 1.0.0 gensim 1.0.1 Ubuntu16.04 64bit

文件下载

资源详情

[{"title":"( 30 个子文件 13.32MB ) 基于CNN的中文文本分类算法(可应用于垃圾邮件过滤、情感分析等场景)","children":[{"title":"zh_cnn_text_classify","children":[{"title":"train.py <span style='color:#111;'> 8.66KB </span>","children":null,"spread":false},{"title":"data_helpers.py <span style='color:#111;'> 4.40KB </span>","children":null,"spread":false},{"title":"word2vec_helpers.py <span style='color:#111;'> 2.51KB </span>","children":null,"spread":false},{"title":"eval.py <span style='color:#111;'> 4.76KB </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 1.87KB </span>","children":null,"spread":false},{"title":"runs","children":[{"title":"1492954581","children":[{"title":"checkpoints","children":[{"title":"model-300.meta <span style='color:#111;'> 99.75KB </span>","children":null,"spread":false},{"title":"model-600.meta <span style='color:#111;'> 99.75KB </span>","children":null,"spread":false},{"title":"model-400.meta <span style='color:#111;'> 99.75KB </span>","children":null,"spread":false},{"title":"model-600.index <span style='color:#111;'> 1009B </span>","children":null,"spread":false},{"title":"model-600.data-00000-of-00001 <span style='color:#111;'> 2.26MB </span>","children":null,"spread":false},{"title":"model-500.data-00000-of-00001 <span style='color:#111;'> 2.26MB </span>","children":null,"spread":false},{"title":"model-500.index <span style='color:#111;'> 1009B </span>","children":null,"spread":false},{"title":"model-500.meta <span style='color:#111;'> 99.75KB </span>","children":null,"spread":false},{"title":"model-400.data-00000-of-00001 <span style='color:#111;'> 2.26MB </span>","children":null,"spread":false},{"title":"model-300.index <span style='color:#111;'> 1009B </span>","children":null,"spread":false},{"title":"model-400.index <span style='color:#111;'> 1009B </span>","children":null,"spread":false},{"title":"model-200.meta <span style='color:#111;'> 99.75KB </span>","children":null,"spread":false},{"title":"model-300.data-00000-of-00001 <span style='color:#111;'> 2.26MB </span>","children":null,"spread":false},{"title":"model-200.data-00000-of-00001 <span style='color:#111;'> 2.26MB </span>","children":null,"spread":false},{"title":"model-200.index <span style='color:#111;'> 1009B </span>","children":null,"spread":false},{"title":"checkpoint <span style='color:#111;'> 697B </span>","children":null,"spread":false}],"spread":false},{"title":"summaries","children":[{"title":"train","children":[{"title":"events.out.tfevents.1492954586.escenter11PC <span style='color:#111;'> 14.84MB </span>","children":null,"spread":false}],"spread":true},{"title":"dev","children":[{"title":"events.out.tfevents.1492954586.escenter11PC <span style='color:#111;'> 155.51KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"training_params.pickle <span style='color:#111;'> 59B </span>","children":null,"spread":false},{"title":"trained_word2vec.model <span style='color:#111;'> 845.16KB </span>","children":null,"spread":false},{"title":"prediction.csv <span style='color:#111;'> 45.25KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"data","children":[{"title":"ham_100.utf8 <span style='color:#111;'> 58.09KB </span>","children":null,"spread":false},{"title":"spam_100.utf8 <span style='color:#111;'> 43.94KB </span>","children":null,"spread":false}],"spread":true},{"title":".gitignore <span style='color:#111;'> 14B </span>","children":null,"spread":false},{"title":"text_cnn.py <span style='color:#111;'> 3.33KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明