Giter Site home page Giter Site logo

tafoca / sentimentanalysis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from barissayil/sentimentanalysis

0.0 0.0 0.0 17.01 MB

Sentiment analysis neural network trained by fine-tuning BERT, ALBERT, or DistilBERT on the Stanford Sentiment Treebank.

License: MIT License

Python 100.00%

sentimentanalysis's Introduction

Sentiment Analysis

Sentiment analysis neural network trained by fine-tuning BERT, ALBERT, or DistilBERT on the Stanford Sentiment Treebank.

https://i.imgur.com/XPQFCix.mp4

Setup Sentiment Analysis

Clone Sentiment Analysis, update lists of packages, install Pyton 3.9

git clone https://github.com/barissayil/SentimentAnalysis.git
cd SentimentAnalysis
sudo apt-get update
sudo apt-get install python3.9

Verify that you have Python 3.9.10

python3.9 --version

Create virtual environment with Python 3.9.10 binary, activate it

python3.9 -m venv env
source env/bin/activate

Install necessary packages

pip install -r requirements.txt

Test it and verify that it passes all tests

python -m pytest

Use Sentiment Analysis with my model

Evaluate

python evaluate.py

Analyze your inputs

python analyze.py

Run server, and verify that you get back 99% positive

python server.py
curl localhost:5000 -G -d text=good

Train your own model and use Sentiment Analysis with it

Train (i.e.fine-tune) BERT

python train.py --model_name_or_path bert-base-uncased --output_dir XXX --num_eps 2

bert-base-uncased, albert-base-v2, distilbert-base-uncased, and other similar models are supported.

Evaluate

python evaluate.py --model_name_or_path XXX

Analyze your inputs

python analyze.py --model_name_or_path XXX

Run server

python server.py --model_name_or_path XXX

sentimentanalysis's People

Contributors

barissayil avatar dependabot[bot] avatar tafoca 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.