All Projects → yala → Text_nn

yala / Text_nn

Licence: mit
Text classification models. Used a submodule for other projects.

Projects that are alternatives of or similar to Text nn

Cnn Interpretability
🏥 Visualizing Convolutional Networks for MRI-based Diagnosis of Alzheimer’s Disease
Stars: ✭ 68 (+23.64%)
Mutual labels:  jupyter-notebook, cnn, interpretability
Symbolic Metamodeling
Codebase for "Demystifying Black-box Models with Symbolic Metamodels", NeurIPS 2019.
Stars: ✭ 29 (-47.27%)
Mutual labels:  jupyter-notebook, interpretability
Servenet
Service Classification based on Service Description
Stars: ✭ 21 (-61.82%)
Mutual labels:  jupyter-notebook, cnn
Gaze Estimation
A deep learning based gaze estimation framework implemented with PyTorch
Stars: ✭ 33 (-40%)
Mutual labels:  jupyter-notebook, cnn
Tensorflow cookbook
Code for Tensorflow Machine Learning Cookbook
Stars: ✭ 5,984 (+10780%)
Mutual labels:  jupyter-notebook, cnn
Tensorflow Tutorial
Some interesting TensorFlow tutorials for beginners.
Stars: ✭ 893 (+1523.64%)
Mutual labels:  jupyter-notebook, cnn
Qa Rankit
QA - Answer Selection (Rank candidate answers for a given question)
Stars: ✭ 30 (-45.45%)
Mutual labels:  jupyter-notebook, cnn
Deeplearning
深度学习入门教程, 优秀文章, Deep Learning Tutorial
Stars: ✭ 6,783 (+12232.73%)
Mutual labels:  jupyter-notebook, cnn
Neural Networks
All about Neural Networks!
Stars: ✭ 34 (-38.18%)
Mutual labels:  jupyter-notebook, cnn
Keras basic
keras를 이용한 딥러닝 기초 학습
Stars: ✭ 39 (-29.09%)
Mutual labels:  jupyter-notebook, cnn
Yann
This toolbox is support material for the book on CNN (http://www.convolution.network).
Stars: ✭ 41 (-25.45%)
Mutual labels:  jupyter-notebook, cnn
Cvnd exercises
Exercise notebooks for CVND.
Stars: ✭ 622 (+1030.91%)
Mutual labels:  jupyter-notebook, cnn
Flashtorch
Visualization toolkit for neural networks in PyTorch! Demo -->
Stars: ✭ 561 (+920%)
Mutual labels:  cnn, interpretability
Neural Image Captioning
Implementation of Neural Image Captioning model using Keras with Theano backend
Stars: ✭ 12 (-78.18%)
Mutual labels:  jupyter-notebook, cnn
Video Classification
Tutorial for video classification/ action recognition using 3D CNN/ CNN+RNN on UCF101
Stars: ✭ 543 (+887.27%)
Mutual labels:  jupyter-notebook, cnn
Kaggle Web Traffic Time Series Forecasting
Solution to Kaggle - Web Traffic Time Series Forecasting
Stars: ✭ 29 (-47.27%)
Mutual labels:  jupyter-notebook, cnn
Face Identification With Cnn Triplet Loss
Face identification with cnn+triplet-loss written by Keras.
Stars: ✭ 45 (-18.18%)
Mutual labels:  jupyter-notebook, cnn
Music recommender
Music recommender using deep learning with Keras and TensorFlow
Stars: ✭ 528 (+860%)
Mutual labels:  jupyter-notebook, cnn
Interpretable machine learning with python
Examples of techniques for training interpretable ML models, explaining ML models, and debugging ML models for accuracy, discrimination, and security.
Stars: ✭ 530 (+863.64%)
Mutual labels:  jupyter-notebook, interpretability
Dl Colab Notebooks
Try out deep learning models online on Google Colab
Stars: ✭ 969 (+1661.82%)
Mutual labels:  jupyter-notebook, cnn

text_nn

Text Classification models. Used as a submodule for other projects. Supports extractive rationale extraction like in Tao Lei's Rationalizing neural prediction. These departs from Tao's original framework in the following way:

  • I implement Generator training using the Gumbel Softmax instead of using REINFORCE
  • I only implement the indepdent selector.

Requirments

This repository assumes glove embeddings. Download Glove embeddings at: https://nlp.stanford.edu/projects/glove/ And place glove.6B/glove.6B.300d.txt in data/embeddings/glove.6B/glove.6B.300d.txt.

This code supports the the NewsGroup dataset and the BeerReview dataset. The for access to the BeerReview and the corresponding embeddings, please contact Tao Lei. I've included the NewsGroup dataset, conveiently provided by SKLearn so you can run code out of the box.

Usage:

Example run:

CUDA_VISIBLE_DEVICES=0 python -u scripts/main.py  --batch_size 64 --cuda --dataset news_group --embedding
glove --dropout 0.05 --weight_decay 5e-06 --num_layers 1 --model_form cnn --hidden_dim 100 --epochs 50 --init_lr 0.0001 --num_workers
 0 --objective cross_entropy --patience 5 --save_dir snapshot --train --test --results_path logs/demo_run.results  --gumbel_decay 1e-5 --get_rationales
 --selection_lambda .001 --continuity_lambda 0

Use --get_rationales to enable extractive rationales.

The results and extracted rationales will be saved in results_path And be accessed as

results = pickle.load(open(results_path,'rb'))
rationales = results['test_stats']['rationales']

To run grid search, see docs/dispatcher.

Note, the rationale model is very sensitive to hyperparameters and the example run has not been tuned.

Base Models Supported:

  • TextCNN (Yoon 2014)

Extending:

How to add a new dataset:

  • Fork the repo
  • Add a pytorch Dataset object to rationale_net/datasets and register it to the dataset factory. See the news_group and beer_review datasets for an example.
  • Add the corresponding import to rationale_net/datasets/__init__.py

How to add a new model base?

  • Supported in research version of this repo, but it's involved. If there is interest, please contact me.
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].