Giter Club home page Giter Club logo

sentiment_analysis's Introduction

Sentiment Analysis

陈鑫圣 计算机科学与技术系 计13 2021010760


This is a project for the course "Introduction to Artificial Intelligence" in Tsinghua University, 2023. The project is to implement sentiment analysis model using CNN, LSTM, GRU, MLP and word2vec. The goal is to classify the reviews into positive and negative.

Accuracy F1-score
CNN 0.8726 0.8712
LSTM(RNN) 0.8428 0.8497
GRU(RNN) 0.8347 0.8407
MLP 0.8184 0.8134

Refer to the report for more details.

运行程序

训练并可视化展示结果(默认使用 CNN 模型)

python main.py

查看帮助

python main.py -h

更多使用案例

python main.py -nw           # 不使用 wandb 进行可视化
python main.py -m MLP -e 25  # 使用 MLP 模型,epoch=25

文件结构

config.py

该文件定义了程序的一些常数、默认参数和超参数。

data_preprocess.py

数据预处理。不需要手动运行。

model.py

定义了本次实验使用的神经网络模型。

main.py

主程序。

Dataset

训练集、验证集、测试集语料库,预训练词向量文件。

sentiment_analysis's People

Contributors

chen-xinsheng 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.