Skip to content

Sentiment Analysis assignment for CS331H at Oregon State University 2025

Notifications You must be signed in to change notification settings

jdtumlinson/sentimentAnalysis

Repository files navigation

Sentiment Analysis Assignment

This repository contains the code for implementing naive Bayes classification to determine the sentiment of a writers attitude towards the topics of which they are writing about. In the case of this repo, that topic is restruants. A large training and testing set of reviews have been gathered, each containing a given label -- 1 for positive and 0 for negative. The training and testings sets are arranged into vectors containing the words usedin the sentence and the sentiment. Probabilities are then calculated based on the training data. When run through the classify_text method with a given vector of sentences, the program will use naive Bayes classification to tetermine the sentiment of the sentence.

To Run

In order to run the program, enter python3 sentiment.py. This will output results to the terminal and into the results.txt file

About

Sentiment Analysis assignment for CS331H at Oregon State University 2025

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages