Skip to content

jmyrick02/Coding-Challenge-F21

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ACM Research Coding Challenge (Fall 2021) - Jack Myrick

Overview

My method of sentiment analysis rated the given text overall as positive with a score of 9.75. This means the passage had a positive sentiment as a whole.

Method

I used a knowledge-based approach to rate the sentiment of the passage. I used the SentiWordNet dataset, which contains the positivity and negativity of many words in the English language. My program parses through the dataset and stores the net score for every word with a non-zero net score. Next, the program parses through the input passage and adds each word's net score to the overall sentiment score. As such, this method is a bag-of-words model, since the order of the passage does not affect the final score. As a result, my method does not handle context or negation, some important limitations. If the final sentiment score is greater than 0, the passage has a positive sentiment. Else, it has a negative sentiment.

Details

In addition to the final score, my method gives a graph from Matplotlib of the net sentiment score as the passage progresses through each word. The graph is shown below.

image

Reflection

Reading through the passage myself, I expected a positive score overall, which aligns with my model's evaluation. Additionally, I did notice that the passage starts out somewhat negatively in its description of the dream and the conflict that was the argument. The graph above reflects my observation in the model's evaluation. Once the argument ends and the description of the person's character begins, the graph noticeably increases at around word 300. This aligns well with my interpretation of the sentiment of the character description as I saw it as positive and laudatory.

Despite the somewhat naive approach taken, the model seems to judge the sentiment of the passage reasonably well. I suspect that positive and negative inacurracies due to context and negation balance out in a sufficiently long text, leading to a relatively accurate sentiment score.

About

Coding challenge for the Fall 2021 cohort

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%