Giter Site home page Giter Site logo

bertforsquad's Introduction

Introduction

This is a repository for Extractive Question Answering task, using BERT model and SQuAD dataset.

Environment

# create environment
conda create --name NAME python=3.8
# activate environment
conda activate NAME
# install packages
pip install -r requirements.txt

Data Process

  • process0.py
# download BERT: bert-base-cased
PYTHONPATH=./ python dataprocess/process0.py --bert_name bert-base-cased
# download BERT: bert-base-uncased
PYTHONPATH=./ python dataprocess/process0.py --bert_name bert-base-uncased
  • process1.py
# download and process SQuAD1.1
PYTHONPATH=./ python dataprocess/process1.py --dataset_name squad1.1
# download and process SQuAD2.0
PYTHONPATH=./ python dataprocess/process1.py --dataset_name squad2.0

Unit Test

  • for loader
# QALoader for SQuAD1.1
PYTHONPATH=./ python loaders/QALoader.py --dataset_name squad1.1
# QALoader for SQuAD2.0
PYTHONPATH=./ python loaders/QALoader.py --dataset_name squad2.0
  • for module
# QAModule
# You can add --official to use official implementation of BertForQuestionAnswering
PYTHONPATH=./ python modules/QAModule.py

Main Process

python main.py

You can change the config either in the command line or in the file utils/parser.py

bertforsquad's People

Contributors

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