All Projects → rpanchal1996 → question-pair

rpanchal1996 / question-pair

Licence: MIT License
A siamese LSTM to detect sentence/question pairs.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to question-pair

deep-char-cnn-lstm
Deep Character CNN LSTM Encoder with Classification and Similarity Models
Stars: ✭ 20 (-20%)
Mutual labels:  lstm, siamese
Base-On-Relation-Method-Extract-News-DA-RNN-Model-For-Stock-Prediction--Pytorch
基於關聯式新聞提取方法之雙階段注意力機制模型用於股票預測
Stars: ✭ 33 (+32%)
Mutual labels:  lstm, rnn
air writing
Online Hand Writing Recognition using BLSTM
Stars: ✭ 26 (+4%)
Mutual labels:  lstm, rnn
Solar-Rad-Forecasting
In these notebooks the entire research and implementation process carried out for the construction of various machine learning models based on neural networks that are capable of predicting levels of solar radiation is captured given a set of historical data taken by meteorological stations.
Stars: ✭ 24 (-4%)
Mutual labels:  rnn, rnn-tensorflow
Speech-Recognition
End-to-end Automatic Speech Recognition for Madarian and English in Tensorflow
Stars: ✭ 21 (-16%)
Mutual labels:  lstm, rnn
Quora-Paraphrase-Question-Identification
Paraphrase question identification using Feature Fusion Network (FFN).
Stars: ✭ 19 (-24%)
Mutual labels:  quora, quora-question-pairs
myDL
Deep Learning
Stars: ✭ 18 (-28%)
Mutual labels:  lstm, rnn
EBIM-NLI
Enhanced BiLSTM Inference Model for Natural Language Inference
Stars: ✭ 24 (-4%)
Mutual labels:  lstm, rnn
theano-recurrence
Recurrent Neural Networks (RNN, GRU, LSTM) and their Bidirectional versions (BiRNN, BiGRU, BiLSTM) for word & character level language modelling in Theano
Stars: ✭ 40 (+60%)
Mutual labels:  lstm, rnn
lstm-electric-load-forecast
Electric load forecast using Long-Short-Term-Memory (LSTM) recurrent neural network
Stars: ✭ 56 (+124%)
Mutual labels:  lstm, rnn
Paper-Implementation-DSTP-RNN-For-Stock-Prediction-Based-On-DA-RNN
基於DA-RNN之DSTP-RNN論文試做(Ver1.0)
Stars: ✭ 62 (+148%)
Mutual labels:  lstm, rnn
char-VAE
Inspired by the neural style algorithm in the computer vision field, we propose a high-level language model with the aim of adapting the linguistic style.
Stars: ✭ 18 (-28%)
Mutual labels:  rnn, rnn-tensorflow
ArrayLSTM
GPU/CPU (CUDA) Implementation of "Recurrent Memory Array Structures", Simple RNN, LSTM, Array LSTM..
Stars: ✭ 21 (-16%)
Mutual labels:  lstm, rnn
novel writer
Train LSTM to writer novel (HongLouMeng here) in Pytorch.
Stars: ✭ 14 (-44%)
Mutual labels:  lstm, rnn
stylegan-pokemon
Generating Pokemon cards using a mixture of StyleGAN and RNN to create beautiful & vibrant cards ready for battle!
Stars: ✭ 47 (+88%)
Mutual labels:  rnn, rnn-tensorflow
SpeakerDiarization RNN CNN LSTM
Speaker Diarization is the problem of separating speakers in an audio. There could be any number of speakers and final result should state when speaker starts and ends. In this project, we analyze given audio file with 2 channels and 2 speakers (on separate channels).
Stars: ✭ 56 (+124%)
Mutual labels:  lstm, rnn
tf-ran-cell
Recurrent Additive Networks for Tensorflow
Stars: ✭ 16 (-36%)
Mutual labels:  lstm, rnn
5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
RNN-LSTM that learns passwords from a starting list
Stars: ✭ 35 (+40%)
Mutual labels:  lstm, rnn
sequence-rnn-py
Sequence analyzing using Recurrent Neural Networks (RNN) based on Keras
Stars: ✭ 28 (+12%)
Mutual labels:  lstm, rnn
automatic-personality-prediction
[AAAI 2020] Modeling Personality with Attentive Networks and Contextual Embeddings
Stars: ✭ 43 (+72%)
Mutual labels:  lstm, rnn

Sentence Pair Detector

A siamese LSTM based approach to indentifying similar sentences/question. Built for the quora question pair challenge on Kaggle, but can be trained on any similar-sentence dataset.

File Description:

  • generate_stemmed_vectors.py processes the wordvectors. Stems the word associated with the vector and generates the final wordlist.
  • vectorize_input.py contains a major portion of the preprocessing steps including cleaning of the data and generation of sentence vectors.
  • model.py contains the actual model and batching function.

How to train:

  • Download the quora question pair dataset from here and extract the train.csv file
  • Download the ConceptNet Numberbatch pretrained embedding from here
  • Run the vector processing script with the location of the embeddings of as an argument like: python generate_stemmed_vectors.py "[path_to_numberbatch_embeddings]"
  • Run the rest of the preprocessing with the location of the quora train.csv as an argument like this: python vectorize_input.py "[path to train dataset]"(this will take quite some time)
  • Start the training by running model.py.

An overview of what I have done:

Word Embeddings:

The word embeddings that I used were the ConceptNet Numberbatch embeddings. I used them mainly for their small size, but can be switched out for any other word embeddings. I would personally recommend using Google's Word2Vec pretrained vectors.

Preprocessing:

I cleaned the dataset to remove sentence contractions. I used the list of contractions given by lystdo on Kaggle. Standard preprocessing tasks like removing outliers in terms of size and stemming was done.

Model:

I used stacked LSTM cells with tied weights and dropout. The two sentences/questions were fed into the two parallel networks with equal weights, and the loss was calculated based on their output. The loss function is Yann LeCun's Contrastive Loss Function. The optimizer used is Adam.

To-Do:

  • Expand Readme for better explanation of the model
  • Remove hardcoded training parameters
  • Optimize preprocessing
  • Add option for other optimizers and GRU cells
  • Add credits for resources used
  • ADD COMMENTS
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].