lazy-forever / Fake-news-detection

虚假新闻检测 - nku 南开大学《python语言程序设计》大作业

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fake-news-detection

虚假新闻检测-南开大学《python语言程序设计》大作业,数据集来源yaqingwang/WeFEND-AAAI20: Dataset for paper "Weak Supervision for Fake News Detection via Reinforcement Learning" published in AAAI'2020. (github.com)

本项目遵守AGPL-3.0开源协议,你可以自由地使用、修改、传播源代码,但是你必须遵守AGPL-3.0许可证的规定,即如果使用或修改我的源代码,需要注明作者并给出项目链接,并且在公共平台开源(例如在GitHub或GitLab等),否则我有权力进行追责。

如果您觉得本项目还不错,请给出您的 star,球球了。另外,我以后可能还会将其他课程或项目的相关代码开源在 Github,欢迎 follow me。

如果对此项目或其他学习有疑问可以提 issue 或根据我主页或博客上面的联系方式联系我,我会尽可能帮助你。

Star History Chart

构建

确保你的电脑上已经装了pytorch

pip install -r requirements.txt
mkdir model

下载ymcui/Chinese-BERT-wwm: Pre-Training with Whole Word Masking for Chinese BERT(中文BERT-wwm系列模型)中的RoBERTa-wwm-ext-largePyTorch版本,SeanLee97/xmnlp: xmnlp中的xmnlp-onnx-models-v5.zip存入model文件夹中。

下载Embedding/Chinese-Word-Vectors: 100+ Chinese Word Vectors 上百种预训练中文词向量中的sgns.sogounews.bigram-char存入data文件夹中。

运行

数据预处理

python web.py
python construct_test.py
python construct_train.py

训练模型+预测

:请手动调整模型的各种数值以达到最优,本项目中默认数值结果不一定为最优。

Word2Vec+CNN

python cnn_model_sen.py

Bert+CNN

python bert_model_sen.py

Bert+LSTM

python lstm_model.py

机器学习

python ML_model.py

结果处理

:请手动调节分隔数值以达到最优解,本项目中默认数值结果不一定为最优。

python construct.py

分数计算

python calc_AUC.py

About

虚假新闻检测 - nku 南开大学《python语言程序设计》大作业

License:GNU Affero General Public License v3.0


Languages

Language:Python 100.0%