Skip to content

Neural network-based sentiment analysis tool for classifying product reviews as positive or negative, developed as part of the ISY503 Intelligent Systems course at Torrens University, Australia

License

Notifications You must be signed in to change notification settings

sergey-chek/sentiment-analysis-isy503

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ISY503 Intelligent Systems - Project

This project involves training a neural network to perform sentiment analysis on a dataset of labeled product reviews, classifying them as positive or negative. The trained model is integrated into a web application for real-time sentiment analysis using FastAPI for the backend and a simple JavaScript page for entering reviews and displaying results.

Prerequisites

Before you begin, make sure you have the following installed:

  • Python 3.7 or higher
  • pip (Python package installer)

Setup and Installation

1. Clone the repository:

git clone https://github.com/sergey-chek/sentiment-analysis-isy503.git
cd sentiment-analysis-isy503

2. Create a virtual environment:

python3 -m venv venv

In some cases it could be

python -m venv venv

3. Activate the virtual environment:

- Windows:

.\venv\Scripts\activate

- MacOS and Linux:

source venv/bin/activate

4. Install dependencies:

pip install -r requirements.txt

Running the Web Application

1. Start the FastAPI server using Uvicorn:

The following command will start the FastAPI server on http://127.0.0.1:8000/ by default.

uvicorn main:app --reload

Note

If you use a different port for the server, make sure to update the API_ENDPOINT variable in static/script.js to match the correct port.

2. Access the frontend

Open your web browser and navigate to http://127.0.0.1:8000/ (or to your custom endpoint).

Building Model

  1. Ensure that the training data files are placed in the model/import-data folder.
  2. To prepare a combined .csv file and perform spelling correction, run the model.prepare module using command:
python3 -m model.prepare
  1. For subsequent data cleaning, run the model.clean module using command:
python3 -m model.clean
  1. For model training, run the model.train module using command:
python3 -m model.train

The trained model will be saved in the model/trained-model directory.

License

This project is licensed under the MIT License.

Acknowledgments

This project was developed as part of the ISY503 Intelligent Systems course at Torrens University of Australia.

About

Neural network-based sentiment analysis tool for classifying product reviews as positive or negative, developed as part of the ISY503 Intelligent Systems course at Torrens University, Australia

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published