It adopts Denny's implementation of Kim's Convolutional Neural Network for Sentence Classificationpaper in tensor flow.
- Python 2.7
- Numpy
- Tensor Flow ( CPU only, Python 2.7) (installation Link)
-
data_helpers_pre.py : Clean the data and make it into right format to be handled by CNN classifier
-
predict.py : Make predictions for input data
-
runs/ : Folder contains pretrained CNN classifier and word2vec trained within CNN framework
-
text_cnn.py : Model Formulation
Sequence of tweets in string format
- 1 for Repbulican
- 0 for Democratic
Modify data source in predict.py then run python predict.py
- Install the required libraries
- Modified code in data_helpers_pre.py to read tweet from DynamoDB(if applicable), the output should be strings or sequence of strings
- Modified code in the Data Loading section of predict.py to specify the input files
- Modified code at the end of predict.py to write prediction into DynamoDB
- If batch process, please activate the bath processing in the predict.py