GithubHelp home page GithubHelp logo

nicklogin / distractorselector Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 364.72 MB

Supervised generation of distractors for language testing

Jupyter Notebook 98.86% Python 1.13% Dockerfile 0.01%

distractorselector's Introduction

Distractor Selector

  1. Installation

Clone this repository and install requirements

git clone https://github.com/nicklogin/DistractorSelector
python -m pip install -r requirements.txt
python -m nltk.downloader punkt
  1. Installation via Docker

You can install DistractorSelector image from Dockerhub:

docker pull niklogin/disselector:latest

You can also build a Docker image from source after cloning this repository:

docker build . -t disselector:latest
  1. Usage via terminal/command line

DistractorSelector accepts a CSV file with sentences as an input and outputs a CSV file with distractors.

The input file must contian the following fields (example - gold_standard/gold_standard_input.csv):

Masked sentence - The sentence where the target word is replaces with [MASK] token

Right answer - The target word

Run this command to get output of DistractorSelector:

python -m distractor_generator --

DistractorSelector accepts the following set of CLI arguments:

Argument Description Default value
--filename Path to input file gold_standard/gold_standard_input.csv
--output_filename Path to output file data/gold_standard_output.csv
--sep Field delimiter in a CSV file ;
--index_col The name of the index column in a CSV file None
--n Number of distractors on the classifier input 20
--no-clf Do not use classifier -
--clf_path Path to file with the saved classifier model XGBAllFeats/clf.pkl
--cols_path Path to file with feature names to be used with the classifier XGBAllFeats/cols.json
  1. Usage via a WebAPI

Execute this command in command line/terminal to run the API of DistractorSelector:

python -m api

The documentation will be available at http://localhost:5000/docs

distractorselector's People

Contributors

nicklogin 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.