Git Product home page Git Product logo

fake_news's Introduction

[TOC]

1、项目描述

https://www.biendata.com/competition/falsenews/ task1:虚假新闻识别、文本分类任务

2、Requirements

python  3.7
pytorch 1.1
tensorboardx
numpy
torchvision
torchtext
transformers # pytorch加载bert工具, 并提供bert预训练转换工具

3、训练

1、数据: 链接: https://pan.baidu.com/s/1ZE_V_bjyJIFpWqHXfhmh8w 提取码: r3dv

1、下载bert预训练模型:pytorch版本:

将 vocab.txt pytorch_model.bin config.json 放到对应的目录

remind: 基于bert的文本分类,先下载bert系列(bert、bertwwm、ernie、xlnet、roberta、albert)等, 放到指定的预训练目录(pretrain)

网络上,可以使用基本的bert+mlp方式,也可以在上层再套用CNN、RNN、RCNN、RNN_attention、HAN等网络,模型越复杂,对gpu的要求也越高

3、运行:

数据处理:
python run_bert.py --do_data # 数据预处理, 分割训练集和验证集,存储pickle格式

训练:
python run_bert.py --do_train # 注意修改超参数 默认model_name 是bert
python run_bert.py --do_train --use_cnn  1 # 使用bert +textcnn网络,下面的模型也可以在

python run_bert.py --do_train --model ernie
python run_bert.py --do_train --model ernie --use_cnn 1
python run_bert.py --do_train --model xlnet
python run_bert.py --do_train --model albert
python run_bert.py --do_train --model roberta
python run_bert.py --do_train --model bert_wwm

4 相关的git、预训练下载地址

bert:

bertwwm

ernie(百度)

xlnet

roberta

albert

fake_news's People

Contributors

baixl avatar

Watchers

paper2code - bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.