Skip to content

AntonKorznikov/SentimentClassifierProject

Repository files navigation

SentimentClassifier

Overview

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.

Table of Contents

Installation

Requirements

  • Make
  • Docker
  • Python 3.9+

Usage

Cloning repository

git clone https://github.com/AntonKorznikov/SentimentClassifierProject.git

Using Makefile

  1. Install Dependencies
make prereqs
  1. Build Executables
make build
  1. Clean Executables
make clean
  1. Run Tests
make test
  1. Run Project
make run_all

Using Docker

  1. Build Docker Image
docker build -t sentimentclassifier:latest .
  1. Run Docker Container
docker run -v $(pwd)/examples/input_raw:/input_raw -v $(pwd)/examples/output:/output sentimentclassifier:latest

Examples

Sample 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

Testing

Run all tests using the Makefile:

make test

Project Structure

  • preprocessing/: 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.

About

This repository contains the project of Team 7 for the course Software Engineering for AI at Skoltech 2024.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •