Skip to content

ShihanSu/Classifying-tweets-sentiment---CS101-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Convolutional Neural Network for Predicting Ideology from Tweets

It adopts Denny's implementation of Kim's Convolutional Neural Network for Sentence Classificationpaper in tensor flow.

Requirement

Files

  1. data_helpers_pre.py : Clean the data and make it into right format to be handled by CNN classifier

  2. predict.py : Make predictions for input data

  3. runs/ : Folder contains pretrained CNN classifier and word2vec trained within CNN framework

  4. text_cnn.py : Model Formulation

Inputs

Sequence of tweets in string format

Outputs

  • 1 for Repbulican
  • 0 for Democratic

How to use model to predict

Modify data source in predict.py then run python predict.py

Note and TODO

  1. Install the required libraries
  2. Modified code in data_helpers_pre.py to read tweet from DynamoDB(if applicable), the output should be strings or sequence of strings
  3. Modified code in the Data Loading section of predict.py to specify the input files
  4. Modified code at the end of predict.py to write prediction into DynamoDB
  5. If batch process, please activate the bath processing in the predict.py

Releases

No releases published

Packages

No packages published

Languages