Giter VIP home page Giter VIP logo

squash-website's Introduction

Generating Question-Answer Hierarchies - Website

This is the official repository for the website and demo accompanying the ACL 2019 long paper Generating Question-Answer Hierarchies. The main codebase and data can be found in martiansideofthemoon/squash-generation, in the demo branch.

To get started, place this repository as a sister folder to the repository martiansideofthemoon/squash-generation. Switch to the demo branch using git checkout demo. Your folder structure should look like this,

squash-root/squash-generation
squash-root/squash-website

SQUASH Landing Page

The landing page is a static HTML file which can be found under squash-landing. All the code is written in squash-landing/index.html. The website is hosted at http://squash.cs.umass.edu/. This file has been adapted from Rowan Zeller's landing page for HellaSwag.

SQUASH Backend

The code for the SQUASH APIs and backend is found under squash-backend. All the code is written in squash-backend/app.py. The code requires Python 3.6+ (for the secrets module) as well as the python package Flask. This code triggers the scripts in the demo branch of the main SQUASH repository. To get started,

cd squash-backend
export FLASK_APP=app.py
python -m flask run --host 0.0.0.0 --port 3005

Remove the --host 0.0.0.0 flag if you do not want to expose the APIs publicly. Also note that you will need to restart the Flask server to reflect edits in the codebase.

Next, in a different terminal enter the squash-generation directory and create an empty file named squash/generated_outputs/queue/queue.txt.

touch squash/generated_outputs/queue/queue.txt

Finally, in five different terminals (all with squash-generation as the root folder launch the following scripts

# terminal 1
python squash/extract_answers.py

# terminal 2
python question-generation/interact.py --model_checkpoint question-generation/gpt2_corefs_question_generation --model_type gpt2

# terminal 3
python question-answering/run_squad_demo.py --bert_model question-answering/bert_large_qa_model --do_predict --do_lower_case --predict_batch_size 16 --version_2_with_negative

# terminal 4
python squash/filter.py

# terminal 5
python squash/cleanup.py

(For running these commands together, you might find the tmux command under Production Level Deployment useful)

SQUASH Frontend

The SQUASH frontend has been written in ReactJS. To get started, make sure you the latest npm and node installed (reference). The dependencies for the frontend have been specified in squash-frontend/package.json.

To get started, first edit the squash-frontend/src/url.js to point to the local server URL. Then, install the dependencies and run the frontend server (while the backend is running on a different process and port),

npm install
npm start

Production Level Deployment

For a production level deployment, you should not use developmental servers. For the backend server, we use waitress. To run the server use,

cd squash-backend
python waitress_server.py

For the frontend server, first create a static website and then serve it. See here for other options and more details.

cd squash-frontend
npm run build
npx serve -s build -l 3000

You might find this all-in-one tmux command useful.

tmux new -s squash \
    "cd squash-website/squash-backend ; python waitress_server.py ; read" \; \
    new-window "cd squash-website/squash-frontend ; npx serve -s build -l 3000 ; read" \; \
    new-window "cd squash-generation ; python squash/extract_answers.py ; read" \; \
    new-window "cd squash-generation ; export CUDA_VISIBLE_DEVICES=0 ; python question-generation/interact.py --model_checkpoint question-generation/gpt2_corefs_question_generation --model_type gpt2 ; read" \; \
    new-window "cd squash-generation ; export CUDA_VISIBLE_DEVICES=0 ; python question-answering/run_squad_demo.py --bert_model question-answering/bert_large_qa_model --do_predict --do_lower_case --predict_batch_size 16 --version_2_with_negative ; read" \; \
    new-window "cd squash-generation ; python squash/filter.py ; read" \; \
    new-window "cd squash-generation ; python squash/cleanup.py ; read" \; \
    detach \;

Citation

If you find this website demo useful, please cite us.

@inproceedings{squash2019,
Author = {Kalpesh Krishna and Mohit Iyyer},
Booktitle = {Association for Computational Linguistics,
Year = "2019",
Title = {Generating Question-Answer Hierarchies}
}

squash-website's People

Contributors

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