A Multi-class Classification for Many different Sentiments
📦Fine_Grain_Sentiment_Analyser ┣--------📂Analyser ┃--------┣--------📜TextProcessor.py ┃--------┣--------📜Variables.py ┃--------┗--------📜__init__.py ┣--------📂Model ┃--------┣--------📜Model.joblib ┃--------┗--------📜Vectorizer.pickle ┗--------📜__init__.py
- 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
here . (dot) represents root folder of this project
- First Clone this repository
- And The Traverse to root Folder
- Now install all the modules written in requirement.txt or from root folder run pip install -r requirements.txt
- An Text.py named file is given in root folder which have driver code for model
# 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
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)
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 |
|
@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
}
}