Giter VIP home page Giter VIP logo

squad-question-answering's Introduction

SQuAD Q&A

SQuAD logo

This repository contains solutions to the question answering problem on the SQuAD v1.1 dataset, which consists on selecting a possible answer to the given question as a span of words in the given context paragraph. The newest version (v2.0) of the dataset also contains unanswerable questions, but the one on which we worked on (v1.1) does not.

Installation

In order to install all the dependencies required by the project, you have two options:

  1. Using pip: make sure that you have Python 3.8 installed on your system and run
python3 -m venv squad
source squad/bin/activate
pip install -r init/requirements.txt
  1. Using conda: simply run the following command
conda env create --name squad -f init/environment.yml
conda activate squad

Execution

Training

The training part of the project is managed through a Jupyter notebook, in which you can select which model to train and which hyperparameters to use.

Training and evaluation metrics, along with model checkpoints and results, are directly logged into a W&B project, which is openly accessible here. Logging abilities are only granted to members of the team, so that if you want to launch your training run, you would have to disable wandb, by setting the environment variable WANDB_DISABLED to an empty value at the top of the notebook (%env WANDB_DISABLED=).

Testing

The testing part of the project is managed using two Python scripts:

  1. compute_answers.py: given the path to the testing JSON file (formatted as the official SQuAD training set JSON), computes and saves another JSON file with the following format
{
    "question_id": "textual answer",
    ...
}
  1. evaluate.py: given the path to the same testing JSON file used in the compute_answers.py script and the JSON file produced by the script itself, prints to the standard output a dictionary of metrics such as the F1 and Exact Match scores, which can be used to assess the performance of a trained model as done in the official SQuAD competition

squad-question-answering's People

Contributors

leocalbi avatar wadaboa avatar

Stargazers

 avatar  avatar  avatar

Watchers

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