Skip to content

shramezani/Persian-Sentiment-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Persian-Sentiment-Analysis

This repository contains a simple sentiment analysis for Persian language

Install

To run this source code please create a new tensorflow conda environment first and then install required libraries

 conda create -n tf_2 tensorflow-gpu cudatoolkit=10.2 python=3.8
 pip install -r requirements.txt 
 conda install -c conda-forge numpy=1.19.5

Dataset

  • This folder contains a DeepSentiPers-original.csv that contains all labeled dataset, we then preprocess and spilt this dataset to train.csv, test.csv and valid.csv

  • The labels are as follows:

  1. Furious
  2. Angry
  3. Neutral
  4. Happy
  5. Delighted
Label #
Furious 236
Angry 1357
Neutral 2874
Happy 2848
Delighted 2516
@misc{sharami2020deepsentipers,
    title={DeepSentiPers: Novel Deep Learning Models Trained Over Proposed Augmented Persian Sentiment Corpus},
    author={Javad PourMostafa Roshan Sharami and Parsa Abbasi Sarabestani and Seyed Abolghasem Mirroshandel},
    year={2020},
    eprint={2004.05328},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}
  • To preprocess and prepare the dataset please follow the Data Preparation.ipynb notebook in the Code directory. We also provided interesting data analysis in this notebook.

Model

  • We are using a fasttext embedding and a two-layer BiGRU model for this project.
  • To pretrain the model please follow the Model.ipynb notebook in the Code directory.
  • You can config path addresses and some global variables in the settings.py file
  • We save the pretrained models in the Models directory

REST API

  • We are using Flask to deploy the pretrained model. Please open index.html which is located in the Code/WebPage directory and also run python flask-restapi.py command in the Code directory.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages