Coder Social home page Coder Social logo

thusharan / wordwranglers Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 17.67 MB

A collaborative project on text mining undertaken as part of the post-graduate program.

Python 100.00%
bag-of-words bilstm ensemble-learning glove-embeddings nlp question-classification

wordwranglers's Introduction

How to work on this project?

Cloning the project

The project can be either downloaded as a zip file from the git repository WordWranglers or cloned using the following git command:

git clone https://github.com/ThusharaN/WordWranglers.git

The project can then be opened in Visual Studio Code or any other IDE.

Setting up the project

Install all the necessary dependencies

pip install -r requirements.txt

Do a test run to check if the environment has been setup correctly

python3 app/src/test_run.py

Note: Instructions for installing git can be found here. Most Mac/Linux machines will have git pre-installed.

Adding Dependencies

Dependencies can added to the current virtual environemt by running the following command

pip install <package_name> && pip freeze > requirements.txt

Making changes

A pull request needs to be created in order to push any changes to code.

After cloning, create a local branch to work on.

git checkout master
git checkout -b <your_branch_name>

In case a change has been made to hello.py, run the following commands to commit the changes

git status // Gives the paths of the files that have been updated
git add <file_path>/hello.py
git commit -m <some_commit_message>

In case new packages were installed, add the updated requirements.txt to the commit. Push your branch to GitHub

git push origin <your_branch_name>

Raise a pull request through GitHub. If the request shows conflicts, run the following commands locally

git fetch origin
git rebase origin/master

Fix all the conflicts in the files; add, commit and push.

Note: More git commands can be found here

Running the program

Since the classifier script resides within the src folder of the repository, make sure to move into this folder before running the train and/or test commands

cd WordWranglers/app/src

Run the following command in the console to train the model:

python3 question_classifier.py --train --config [config_file_name]

and the following command to test the model:

python3 question_classifier.py --test --config [config_file_name]

The placeholder [config_file_name] can be any of the following files to train and test the model with different configurations:

  • bilstm_pretrained.yaml: Train the test classifier with pretrained word embeddings using GloVe with the sentence representation given by BiLSTM
  • bilstm_random.yaml: Train the test classifier with randomly generated word embeddings with the sentence representation given by BiLSTM
  • bow_pretrained.yaml: Train the test classifier with pretrained word embeddings using GloVe with the sentence representation given by Bag-Of-Words (or BoW)
  • bow_random.yaml: Train the test classifier with randomly generated word embeddings with the sentence representation given by Bag-Of-Words (or BoW)
  • ensemble.yaml: Train the test classifier with pretrained word embeddings using GloVe with the sentence representation given by an ensemble learner which utilisez both LSTM and Bag-Of-Words

Debugging the program

The program can be debugged using the VS Code debugger. The configurations have been added as part of the .vscode/launch.json file

wordwranglers's People

Contributors

balendra-singh avatar mariamjamilah avatar thusharan avatar

Watchers

 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.