This project provides a command-line interface (CLI) for performing sentiment analysis on text using a Hugging Face transformer model.
Ensure you have the following tools installed:
- Python 3.10 or later
- Make
Follow these steps to set up the project:
-
Clone the Repository
Clone the repository to your local machine:
git clone https://github.com/MeherBhaskar/sentiment_analysis_cli.git cd sentiment_analysis_cli -
Create New Environment Create new environment using
make create_env
-
Install Required Packages Install required packages using
make install
-
Format and Lint Code Format the code and install the necessary packages by running:
make format
-
Run Tests
make test
- Make the Script Executable
Change the permissions to make the detect_sentiment.py script executable:
chmod +x detect_sentiment.py- Activate the Conda Environment
Activate the conda environment
conda activate sentiment_analysis_cli- 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!"