Coder Social home page Coder Social logo

frankiegu / tetx-cnn-baseline Goto Github PK

View Code? Open in Web Editor NEW

This project forked from carrychang/tetx-cnn-baseline

0.0 0.0 0.0 53.69 MB

Tetx-CNN BaseLine在2000条人工选取的正负语料上,在二分类上准确度以%94.1上超过了SnowNLP的%93.75情感分析准确度,还可以继续微调模型的参数。添加flask后端推理API,修改了全局model load的方式,增加了模型推理的速度,使用nginx搭配Gunicorn启动Flask,使用虚拟环境搭配sh的启动方式,可以直接对model进行一键重启,并有错误日志监控

Home Page: http://127.0.0.1:5000/sentiment_analysis_api

License: Apache License 2.0

Python 98.77% Shell 1.23%

tetx-cnn-baseline's Introduction

996.icu

Tetx-CNN BaseLine

一个简单的NLP项目(文本情感分析)的flask后端API,修改了全局model load的方式,增加了模型推理的速度,使用nginx搭配Gunicorn启动Flask,使用虚拟环境搭配sh的启动方式,可以直接对model进行一键重启,并有错误日志监控

支持一键sh部署,flask配置见gun.py,情感分析属于毕业项目整理的一部分(整个项目为顾客意见挖掘)

使用方法

  1. 首先在服务器上部署虚拟环境 ,假设虚拟环境在/home,cd /home 进入home
  2. 在hoem文件夹中使用python3 -m venv v1创建虚拟环境,v1就是虚拟环境的名字,然后使用souce v1/bin/activate加载虚拟环境
  3. 在虚拟环境下使用pip install -r requirement.txt 安装所需要的库,然后使用chmod +777 restart.sh部署模型的后端

基于字符级卷积神经的中文情感分析:

  1. 将顾客打分和评论情感进行两极映射,使用数据自动标注和基于弱监督预训练的数据增强方式自动扩充和优化数据集,实验证实了在情感分类中,使用本文的字符级卷积神经网络(C-CNN-SA)可以在不依赖分词的情况下,达到的精度和 F 值均高于词级粒度
  2. 在字符级向量化分类模型中,结果显示卷积神经网络在短文本情感分类中效果最好,字符级卷积神经网络在训练速度和效果上优势明显
  3. 模型的最后一层改写输出为积极标签的概率,这种输出方式符合情感强度的表达,即输出0.9位这段文字的情感强度,一般大于0.5即视为积极,数字越大,强度越强烈,反则反之,文本分数为0.1的则为消极情感,极性较强

tetx-cnn-baseline's People

Contributors

carrychang 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.