/charCnn

Implementation of Character CNN by LeCunn et. al. in keras for a university seminar

Primary LanguagePython

explainable charCnn for sentiment classification

Implementation of character CNN by LeCunn et. al. for an university talk. Pimped with LIME to make the predictions of the black box charCNN more accessible and localy interpretable. Also, a small flask App is included for demonstration purposes.

This readme is structured as follows:

  1. Basic idea of CNNs for text classification
  2. Implementation
  3. Basic idea of LIME
  4. How to: handle those scripts

Work in progress

1. CNNs for text classification

1D convolution over character-encoded text. Example with the text "text mining":

animation 1D convolution

2. Implementation

Implementation of the small charCnn by Zhang, Zhao LeCunn 2015 following this architecture:

architecture

Used the Yelp Polarity Data Set to detect the sentiment of Yelp reviews.

The fully trained model can be downloaded as a hdf5 file using this link. Make sure to install the h5py python package (available on pip) to access the file.

3. LIME

Use of the fantastic LIME package to make some sense out of the local predictions of the charCnn.

4. How to: handle the scripts