Code Monkey home page Code Monkey logo

weibo-rmdt's Introduction

Weibo Rumor Detection

A small project to automatically crawl micro-blog in Sina Weibo and try to detect whether the specified blog is a rumor.

Environments

Dataset

The dataset used in this project is merged from some small set. It was all uploaded into this repo under folder data/dataset/raw/

Use extractraw.py to generate train, valid and eval datasets.

Pretrained Vectors

The raw pretrained vectors is download from repo: Chinese-Word-Vectors via this link: Mixed-large 综合 Baidu Netdisk Word + Character + Ngram

In this project, to avoid huge memory occupation, the raw vectors was processed to a binary data file pretrain_wv.vec.dat and a index file pretrain_wv.index.json, and use the class PretrainedVector in dataset.py to load it. pretrain_wv.indexpretrain_wv.index You can download pretrain_wv.vec.dat from the release page.

Train

See train.py for details.

After training, it will automatically make evaluation on eval dataset.

Model

See model.py for details.

In this project, it just used fixed parameters to train the model, the parameters of final uploaded rmdt.pt model is shown in the output below.

RumorDetectModel(
  (origin_bilstm): LSTM(300, 32, batch_first=True, bidirectional=True)
  (comment_lstm): LSTM(300, 64, batch_first=True)
  (comment_dropout): Dropout(p=0.5, inplace=False)
  (attn_U): Linear(in_features=64, out_features=32, bias=False)
  (attn_W): Linear(in_features=64, out_features=32, bias=False)
  (attn_v): Linear(in_features=32, out_features=1, bias=False)
  (linear_dropout): Dropout(p=0.5, inplace=False)
  (linear): Linear(in_features=128, out_features=2, bias=True)
)

Usage

See main.py and rmdt.py for details.

A simple example is in main.py and main.ipynb.

Known Problem

Due to model limitations, the input data must have both original blog text and at least one comment text, otherwise may throw exceptions.


If you think this project is helpful to you, plz star it and let more people see it. :)

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.