SentimentClassifier is a lightweight neural network tool designed to perform sentiment analysis on textual data. It highlights the sentiment of input texts using a pretrained model from HuggingFace. The project includes preprocessing, processing, and postprocessing steps to deliver human-presentable results.
- Make
- Docker
- Python 3.9+
git clone https://github.com/AntonKorznikov/SentimentClassifierProject.git- Install Dependencies
make prereqs- Build Executables
make build- Clean Executables
make clean- Run Tests
make test- Run Project
make run_all- Build Docker Image
docker build -t sentimentclassifier:latest .- Run Docker Container
docker run -v $(pwd)/examples/input_raw:/input_raw -v $(pwd)/examples/output:/output sentimentclassifier:latestSample input files are provided in the examples/input_raw/ directory. After running the preprocessing, processing, and postprocessing steps, the results can be found in the examples/output/ directory.
example of input_raw/sample_input.txt :
I love this product!
This service is terrible.
The quality is just okay.
Absolutely fantastic experience!
Not worth the investment at all.
example of output/sample_input.txt :
Sentiment: POSITIVE, Score: 0.9998855590820312
Sentiment: NEGATIVE, Score: 0.999573290348053
Sentiment: POSITIVE, Score: 0.9998542070388794
Sentiment: POSITIVE, Score: 0.9998812675476074
Sentiment: NEGATIVE, Score: 0.999803364276886
Run all tests using the Makefile:
make testpreprocessing/: Contains scripts and tests for data preprocessing.processing/: Contains scripts and tests for running the sentiment analysis model.postprocessing/: Contains scripts and tests for processing the model's output.examples/: Contains example input and output files.