Giter VIP home page Giter VIP logo

dd2417_semantic_equivalence_detection's Introduction

DD2417 Semantic Equivalence Detection

This is the mini-project work of the course DD2417 Language Engineering at KTH

Determining whether two questions are asking the same thing can be challenging, as the differences might be very subtle. The choice of words can be quite varying while the semantic meaning stays the same.

we explore different ways to detect semantic equivalence using different GRU models, combined with several DL techniques. We also use a bagging ensemble way to combine our GRU-based models. In the end, we evaluate and compare all these approaches, with our best model achieving 83.1% accuracy on the test set.

Our dataset is downloaded from Kaggle. The download link: https://www.kaggle.com/datasets/quora/question-pairs-dataset. We use 90% of it as our training set, the rest 10% as our test set.

We use GloVe word embedding. The download link: http://nlp.stanford.edu/data/glove.6B.zip

To train the simGRU model using the best set of hyperparameters that we find:

set CUBLAS_WORKSPACE_CONFIG=:4096:8
python SimilarityGRU.py -tr dataset/training.csv -te dataset/test.csv -hs 150 -bs 50 -e 15 -thf 30 -lr 0.001 -ef glove/glove.6B.200d.txt -s -st 1

To train the concatGRU model with the best set of parameters coded:

python concatGRU.py -tr dataset/training.csv -t dataset/test.csv -wv glove/glove.6B.200d.txt

To load the saved models:

python SimilarityGRU.py -te dataset/test.csv -l model_folder
python concatGRU.py -t dataset/test.csv -l model_folder

To generate extracted features needed for our Ensemble model:

python SimilarityGRU.py -te dataset/test.csv -l model_folder -p destination_folder
python concatGRU.py -t dataset/test.csv -l model_folder -p destination_folder

To run our Ensemble model, you need to firstly change the dir_name in the code to your destination folder.

python Ensemble_SED.py

dd2417_semantic_equivalence_detection's People

Contributors

dingwanoscartan avatar karlenkko avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.