Giter VIP home page Giter VIP logo

chinesesentimentanalysis's Introduction

中文情感分类(Chinese Sentiment Classification)

[email protected]

implemented model: MLP, CNN, RNN

衡量标准: Acc, F1(macro)

Performance

Model Test-Acc
MLP 56.64
BERT-MLP 60.33
CNN 58.86
Text-CNN 62.72
RNN 55.09
LSTM 61.16
GRU 62.64

提交的包中已经包含了预处理后的文件,可以直接训练。

预处理

如果您需要从头开始预处理数据(非必需), 您需要下载Word2Vec词向量文件sgns.sogounews.bigram-char,您可以从我的云盘

https://cloud.tsinghua.edu.cn/f/cb435184e9ed41979d49/

中下载,放入/word2vec/文件夹下之后开始预处理过程。

之后您可以在命令行输入

python main.py pre

来进行预处理工作。

训练

命令行中输入一种模型名称即可开始训练。

python main.py mlp|cnn|rnn|textcnn|rcnn|bert (选一个)

可以训练相应的神经网络. main.py 中针对不同网络设置了对应模型的参数,您可以根据需要修改相关参数.

输出文件

均保存在/save/... 中对应的文件夹下.

输出包括:

参数配置config.json、训练日志*.log、模型参数*.pkl

模型可视化结构*.pdf、使用TensorBoard 可视化的Scalar 曲线events.out.tfevents.xxx等文件。

可视化

您可以在最上层文件夹下执行命令

tensorboard ‐‐logdir save/...

来查看acc, loss, F1, corrscalar 变化的曲线.

特别地,如果您想查看所有模型的可视化结果,请执行命令

tensorboard ‐‐logdir save/all/run

之后在http://localhost:6006/ 中查看结果。


chinesesentimentanalysis's People

Contributors

liu-hz18 avatar

Stargazers

Roman avatar  avatar

Watchers

 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.