Skip to content

Sentiment Analyst is a tool designed to identify the emotions in a text

Notifications You must be signed in to change notification settings

dantealegria1/Sentiment_Analysist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment Analyst

Description

Sentiment Analyst is a tool designed to identify the emotions in a text. Whether it's a message from your girlfriend, a review left on your website, or any other text, Sentiment Analyst can help you understand the underlying sentiments.

Installation

It is highly recommended to create and use a virtual environment on your own machine to manage dependencies.

  • Instal Virtualenv
pip install virtualenv
  • Create a Virtual Environment: Navigate to your project directory and create a virtual environment:
virtualenv env
  • Activate the Virtual Environment:

    • On windows
    source venv/bin/activate
    • On macOs or Linux
    source venv/bin/activate

Use the package manager pip to install all the requiered libraries.

pip install nltk transformers collections spacy requests

Usage

After installing all the requirements, run the following command. Make sure you are in the correct folder where the application is located:

python app.py

IMPORTANT: Remember youi have to get your on PRIVATE KEY for the Thesaurus API

def Get_Synonyms(word):
    api_url = 'https://api.api-ninjas.com/v1/thesaurus?word={}'.format(word)
    response = requests.get(api_url, headers={'X-Api-Key': 'PRIVATE KEY'})
    try:
        if response.status_code == requests.codes.ok:
            data = response.json()
            synonyms = data.get('synonyms', [])
            return synonyms
    except Exception as e:
        print(f"Error getting synonyms: {e}")

Replace 'YOUR_PRIVATE_KEY' with your actual API key to use the Thesaurus API.

With these steps, you should be able to set up and run the Sentiment Analyst tool successfully. Enjoy analyzing sentiments!

Preview

image

About

Sentiment Analyst is a tool designed to identify the emotions in a text

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published