Skip to content

keithbradley1/language-analyzer-lazer-powered-cthulhu

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Language Analyzer

Summary


This project is a language analyzer that analyzes 2016 presidential nominees' tweets. The program is intended to analyze a twitter message based on categories relating to the presidiential race. The categories used are sentiment, behavior, and domain.

Sentiment: The sentence gets scanned for the positive, neutral, or negative keywords then produces a value based on the amount of matches found.

Behavior Predictor: The behavior of the sentence can be predicted to see if it fits into the categories of Dictator, Hippie, Blame, Childish, Mockery, Pandering, Supportive, Promises, and Patriotic.

Domain: The sentence is evaluated to see if it fits into the topic of Healthcare, War, Climate, and Political Correctness.

How it works:

Our language analyzer takes each of the presidential tweets and runs it through our language_analyzer.py file. This file sends the tweets to our tokenizer which then strips the messages down to a list of strings. These stripped messages are then run through each module to determine the sentiment, behavior, and domain values. The result is printed in the command line for readability.

Example


Light Example

Motivation


The motivation behind this project is to scan the presidential tweets and help citizens make a more conscious and informed decision for the Fall 2016 election.

Installation


If you're on Mac OS X, consider installing with Homebrew. Run the command $ python --version from your command line , we recommend Python 3.3.6

If you do not have pyenv use this link to install.

This project was built using Python 3.3, click here to install this version.

Once you have Python 3.3 installed you can pull down our code by using the following commands:

  • $ git clone https://github.com/nss-day-cohort-13/language-analyzer-lazer-powered-cthulhu.git
  • $ cd language-analyzer-lazer-powered-cthulhu

Test the code


We implemented test driven development in this project. First we wrote a complete test suite for each of our modules. The test suite provided the framework and planning for the logic and implementation. Here is an example of passing tests used to assign values to the behvior predictor module.

Behavior Tests Passing

To run a test file for yourself:

Type 'python' to start the python interpreter then the test file name you want to run. Here’s an example of running the behavior_predictor test file: ➜
python test_behavior_predictor.py -v

Contributors


License


MIT

About

language-analyzer-lazer-powered-cthulhu created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%