• Stars
    star
    169
  • Rank 223,150 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created about 7 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A bidirectional LSTM with attention for multiclass/multilabel text classification.

Document-Classifier-LSTM

Recurrent Neural Networks for multilclass, multilabel classification of texts. The models that learn to tag samll texts with 169 different tags from arxiv.

In classifier.py is implemented a standard BLSTM network with attention.

In hatt_classifier.py you can find the implementation of Hierarchical Attention Networks for Document Classification.

The neural networks were built using Keras and Tensorflow.

The best performing model is the attention BLSTM that achieves a micro f-score of 0.67 on the test set.

The Hierarchical Attention Network achieves only 0.65 micro f-score.

I am using 500k paper abstracts from arxiv. In order to download your own data refer to the arxiv OAI api.

Pretrained word embeddings can be used. The embeddings can either be GloVe or Word2Vec. You can download the GoogleNews-vectors-negative300.bin or the GloVe embeddings.

Usage:

  1. In order to train your own model you must prepare your data set using the data_prep.py script. The preprocessing converts to lower case, tokenizes and removes very short words. The preprocessed files and label files should be saved in a /data folder.

  2. You can now run classifier.py or hatt_classifier.py to build and train the models.

  3. The trained models are exported to json and the weights to h5 for later use.

  4. You can use utils.visualize_attention to visualize the attention weights.

Requirements

Run pip install -r requirements.txt to install the requirements.

More Repositories

1

Multimodal-Gesture-Recognition-with-LSTMs-and-CTC

An end-to-end system that performs temporal recognition of gesture sequences using speech and skeletal input. The model combines three networks with a CTC output layer that recognises gestures from continuous stream.
Python
27
star
2

Advanced-ML-techniques

This repo contains implementation of advanced ML techniques. Includes model ensembles, cost-sensitive learning and dealing with class imbalance.
Python
19
star
3

DANCER-summ

Code for the paper "A Divide-and-Conquer Approach to the Summarization of Long Documents"
Python
17
star
4

keras-CF-NADE

keras implementation of Neural Autoregressive Distribution Estimator for Collaborative Filtering
Python
9
star
5

PMC-StructuredAbstracts-Dataset

Code to obtain the PMC-SA. A dataset for the summarization of scientific articles.
Python
5
star
6

gpt-light

The easiest repo for building GPT applications.
Python
5
star
7

predict_query_product_relevance

we try to predict a relevance score between a search term and a product
Python
4
star
8

ml-algorithms-minimal

Pure python implementations of popular ML algorithms.
Jupyter Notebook
3
star
9

LSTM-Language-Models

Experiments with LSTM networks for language modeling.
Python
2
star
10

Automatic_Gesture_Recognition

In this project we address the task of multimodal recognition of gestures. We are using skeletal, speech, rgb and depth streams to recognise sequences of gestures.
Python
2
star
11

Bayesian-Summarization

Python
1
star
12

Keras-tutorial-on-CNNs

Tutorial on how to implement a simple CNN for image classification and face detection.
Python
1
star