Skip to content

MeherBhaskar/sentiment_analysis_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run Tests

Sentiment Analysis CLI

This project provides a command-line interface (CLI) for performing sentiment analysis on text using a Hugging Face transformer model.

Prerequisites

Ensure you have the following tools installed:

  • Python 3.10 or later
  • Make

Setup

Follow these steps to set up the project:

  1. Clone the Repository

    Clone the repository to your local machine:

    git clone https://github.com/MeherBhaskar/sentiment_analysis_cli.git
    cd sentiment_analysis_cli
  2. Create New Environment Create new environment using

    make create_env
  3. Install Required Packages Install required packages using

    make install
  4. Format and Lint Code Format the code and install the necessary packages by running:

    make format
  5. Run Tests

    make test

Usage

  1. Make the Script Executable

Change the permissions to make the detect_sentiment.py script executable:

chmod +x detect_sentiment.py
  1. Activate the Conda Environment

Activate the conda environment

conda activate sentiment_analysis_cli
  1. Run the CLI Command

Execute the detect_sentiment.py script with your text as input:

./detect_sentiment.py "<text>"

For example:

./detect_sentiment.py "I love this product!"

About

A CLI tool that can take a text as input and return the sentiment of the text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors