Skip to content

TechForEverybody/Text_Sentiment_Analyzer_Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Sentiment Analyzer Model

A Multi-class Classification for Many different Sentiments

Created By: Shivkumar Chauhan


Model Folder Structure

📦Fine_Grain_Sentiment_Analyser
┣--------📂Analyser
┃--------┣--------📜TextProcessor.py
┃--------┣--------📜Variables.py
┃--------┗--------📜__init__.py
┣--------📂Model
┃--------┣--------📜Model.joblib
┃--------┗--------📜Vectorizer.pickle
┗--------📜__init__.py

Requirements

  • Python <=3.10.8
  • The Folder Fine_Grain_Sentiment_Analyser is the main folder must be placed where the file is importing it
  • Do not Edit the folder Fine_Grain_Sentiment_Analyser until you are professional in

How to setup

here . (dot) represents root folder of this project

  1. First Clone this repository
  2. And The Traverse to root Folder
  3. Now install all the modules written in requirement.txt or from root folder run pip install -r requirements.txt
  4. An Text.py named file is given in root folder which have driver code for model

Driver code

# imports 
from Fine_Grain_Sentiment_Analyser import TextInputProcessor,TextSentimentAnalyser

# object creation
textInputProcessor=TextInputProcessor()
textSentimentAnalyser=TextSentimentAnalyser()

# Setting the Model Paths
textSentimentAnalyser.setModel("./Fine_Grain_Sentiment_Analyser/Model/Model.joblib")
textInputProcessor.setVecorizer("./Fine_Grain_Sentiment_Analyser/Model/Vectorizer.pickle")

# Raw Text Input
text_input="I need to try this Model"

# Preprocessing the Input
preprocessed_input=textInputProcessor.getPreprocessTheArray(text_input)

# generating the result
sentiment_result=textSentimentAnalyser.predict(preprocessed_input)

print(sentiment_result)

output

> python Test.py
desire

Required folder Structure

if you are a beginner the please follow the following path Structure

📦Your_Project_Path
|------📦Fine_Grain_Sentiment_Analyser
|------┣--------📂Analyser
|------┃--------┣--------📜TextProcessor.py
|------┃--------┣--------📜Variables.py
|------┃--------┗--------📜__init__.py
|------┣--------📂Model
|------┃--------┣--------📜Model.joblib
|------┃--------┗--------📜Vectorizer.pickle
|------┗--------📜__init__.py
|------Code.py (This Code will have Driver code for this model)

Data used for This Model

The following table is shows the all the description of the dataset used for this model building

property value
name GoEmotions
description GoEmotions contains 58k carefully curated Reddit comments labeled for 27 emotion categories or Neutral. The emotion categories are _admiration, amusement, anger, annoyance, approval, caring, confusion, curiosity, desire, disappointment, disapproval, disgust, embarrassment, excitement, fear, gratitude, grief, joy, love, nervousness, optimism, pride, realization, relief, remorse, sadness, surprise_.
sameAs https://github.com/google-research/google-research/tree/master/goemotions
citation https://identifiers.org/arxiv:2005.00547
provider
property value
name Google
sameAs https://en.wikipedia.org/wiki/Google

Citation

@misc{https://doi.org/10.48550/arxiv.2005.00547,
    doi = {
        10.48550/ARXIV.2005.00547
    },
    
    url = {
        https://arxiv.org/abs/2005.00547
    },
    
    author = {
        Demszky, Dorottya and Movshovitz-Attias, 
        Dana and Ko, Jeongwoo and Cowen, 
        Alan and Nemade, 
        Gaurav and Ravi, 
        Sujith
    },
    
    keywords = {
        Computation and Language (cs.CL), 
        FOS: Computer and information sciences, 
        FOS: Computer and information sciences
    },
    
    title = {
        GoEmotions: A Dataset of Fine-Grained Emotions
    },
    
    publisher = {
        arXiv
    },
    
    year = {
        2020
    },
    
    copyright = {
        arXiv.org perpetual, 
        non-exclusive license
    }
  }
  

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages