Skip to content

kritish-dhaubanjar/semantic-question-matching

Repository files navigation

Semantic Question Pair Matching with Deep Learning

Sample Question Pair in Quora

Quora Dataset


Distribution of Questions

Distribution of Questions


System Architecture System Architecture


Stopwords Removal

Stopwords Removal


Stemming | Lemmatization

Stemming

Lemmatization


Word2vec

Word2vec


Correlation Heatmap for features

Heatmap

Distribution Plots

len_q1 vs len_q2 diff_len
len_q1 vs len_q2 diff_len

Scatter Plots

cosine_distance vs common_words fuzz_partial_ratio vs common_words

Supervised Machine Learning Models

S.N. Supervised Machine Learning Accuracy
1 Random Forest 0.7235
2 K Nearest Neighbors 0.7104
3 Logistic Regression 0.6680

Neural Network

Neural Network

Training Neural Network

Training of Network

S.N. Learning Rate Batch Size Training Accuracy
1 0.01 30 0.6264
2 0.005 30 0.6938
3 0.001 30 0.7256
Training Loss Training Accuracy ROC
Training Loss Training Accuracy ROC

Confusion Matrix

Predicted
0 1
Actual 0 36462 12792
0 8954 20455

Some Metrics

Measure Value Derivations
Sensitivity 0.6955 TPR = TP / (TP + FN)
Specificity 0.7403 SPC = TN / (FP + TN)
Precision 0.6152 PPV = TP / (TP + FP)
Negative Predictive Value 0.8028 NPV = TN / (TN + FN)
False Positive Rate 0.2597 FPR = FP / (FP + TN)
False Discovery Rate 0.3848 FDR = FP / (FP + TP)
False Negative Rate 0.3045 FNR = FN / (FN + TP)
Accuracy 0.7236 ACC = (TP + TN) / (P + N)
F1 Score 0.6529 F1 = 2TP / (2TP + FP + FN)

Flask Interface

Home

Evaluate

Lookups

Install essential libraries

pip3 install numpy
pip3 install fuzzywuzzy
pip3 install gensim
pip3 install python-Levenshtein
pip3 install sklearn
pip3 install pyemd
pip3 install keras
pip3 install tensorflow

Download Models from https://drive.google.com/open?id=1YgibRxIBRPDBvrPPstxkInnNKc6M5lFc & Extract to ./semantic-question-matching/flask_interface/

cd ./semantic-question-matching/flask_interface

export FLASK_APP=app.py

flask run --without-threads

About

Semantic Question Pair Matching with Deep Learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages