All Projects → HaebinShin → grad-cam-text

HaebinShin / grad-cam-text

Licence: other
Implementation of Grad-CAM for text.

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to grad-cam-text

Sentence Similarity
对四种句子/文本相似度计算方法进行实验与比较
Stars: ✭ 181 (+389.19%)
Mutual labels:  word2vec
Gemsec
The TensorFlow reference implementation of 'GEMSEC: Graph Embedding with Self Clustering' (ASONAM 2019).
Stars: ✭ 210 (+467.57%)
Mutual labels:  word2vec
Aravec
AraVec is a pre-trained distributed word representation (word embedding) open source project which aims to provide the Arabic NLP research community with free to use and powerful word embedding models.
Stars: ✭ 239 (+545.95%)
Mutual labels:  word2vec
Nlp learning
结合python一起学习自然语言处理 (nlp): 语言模型、HMM、PCFG、Word2vec、完形填空式阅读理解任务、朴素贝叶斯分类器、TFIDF、PCA、SVD
Stars: ✭ 188 (+408.11%)
Mutual labels:  word2vec
Word2vec
Python interface to Google word2vec
Stars: ✭ 2,370 (+6305.41%)
Mutual labels:  word2vec
Practical 1
Oxford Deep NLP 2017 course - Practical 1: word2vec
Stars: ✭ 220 (+494.59%)
Mutual labels:  word2vec
Splitter
A Pytorch implementation of "Splitter: Learning Node Representations that Capture Multiple Social Contexts" (WWW 2019).
Stars: ✭ 177 (+378.38%)
Mutual labels:  word2vec
russe
RUSSE: Russian Semantic Evaluation.
Stars: ✭ 11 (-70.27%)
Mutual labels:  word2vec
Sensegram
Making sense embedding out of word embeddings using graph-based word sense induction
Stars: ✭ 209 (+464.86%)
Mutual labels:  word2vec
Book deeplearning in pytorch source
Stars: ✭ 236 (+537.84%)
Mutual labels:  word2vec
Germanwordembeddings
Toolkit to obtain and preprocess german corpora, train models using word2vec (gensim) and evaluate them with generated testsets
Stars: ✭ 189 (+410.81%)
Mutual labels:  word2vec
Chameleon recsys
Source code of CHAMELEON - A Deep Learning Meta-Architecture for News Recommender Systems
Stars: ✭ 202 (+445.95%)
Mutual labels:  word2vec
Cw2vec
cw2vec: Learning Chinese Word Embeddings with Stroke n-gram Information
Stars: ✭ 224 (+505.41%)
Mutual labels:  word2vec
Text Pairs Relation Classification
About Text Pairs (Sentence Level) Classification (Similarity Modeling) Based on Neural Network.
Stars: ✭ 182 (+391.89%)
Mutual labels:  word2vec
Movietaster Open
A practical movie recommend project based on Item2vec.
Stars: ✭ 253 (+583.78%)
Mutual labels:  word2vec
Tensorflow Tutorials
텐서플로우를 기초부터 응용까지 단계별로 연습할 수 있는 소스 코드를 제공합니다
Stars: ✭ 2,096 (+5564.86%)
Mutual labels:  word2vec
Stocksensation
基于情感字典和机器学习的股市舆情情感分类可视化Web
Stars: ✭ 215 (+481.08%)
Mutual labels:  word2vec
Simple-Sentence-Similarity
Exploring the simple sentence similarity measurements using word embeddings
Stars: ✭ 99 (+167.57%)
Mutual labels:  word2vec
Cukatify
Cukatify is a music social media project
Stars: ✭ 21 (-43.24%)
Mutual labels:  word2vec
Koan
A word2vec negative sampling implementation with correct CBOW update.
Stars: ✭ 232 (+527.03%)
Mutual labels:  word2vec

Grad-CAM for Text

This is implementation of Grad-CAM for text classification model. The model used is 1D-CNN for text classification which was introduced in Yoon Kim (2014). The data used are re-fined version of Stanford Sentimental Treebank which re-labeled for binary classification. Input feature is slim version of word2vec.

It especially requires python>=3, tensorflow>=1.4,<2.0 (requires tf.data.Dataset and tf.estimator.Estimator, but not support TF2).

Installation

>>> pip3 install -r requirements.txt

Feature

Before training, it requires word2vec binary file. Download by word2vec.sh, it will download in directory word2vec/.

>>> ./word2vec.sh

All word2vec binary have to be located on word2vec/ directory.

  • word2vec/GoogleNews-vectors-negative300-SLIM.bin

Stanford Sentimental Treebank Dataset will be download automatically when training.

Training

usage: train.py [-h] [--epoch EPOCH] [--batch-size BATCH_SIZE]
                [--learning-rate LEARNING_RATE] [--gpu-index GPU_INDEX]

optional arguments:
  -h, --help            show this help message and exit
  --epoch EPOCH         Train Epoch
  --batch-size BATCH_SIZE
                        Train Batch Size
  --learning-rate LEARNING_RATE
                        Train Learning Rate
  --gpu-index GPU_INDEX
                        GPU Index Number

Visulization

It shows which word impacts the result with heatmap of sentence. Strong impact factor gets brighter color, otherwise darker color.

Fill CKPT variable with your ckeckpoint path in visualize.ipynb.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].