GithubHelp home page GithubHelp logo

jm-kang / nc-bert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wjdghks950/nc-bert

0.0 0.0 0.0 300 KB

BERT capable of numerical extrapolation over text (solving arithmetic problems over textual reasoning dataset)

Python 99.58% Shell 0.42%

nc-bert's Introduction

NC-BERT: A Numerical-Contextual BERT for Numerical Reasoning

This repostiory contains codes for NC-BERT: Exploiting Numerical-Contextual Knowledge to Improve Numerical Reasoning in Question Answering.

NC-BERT is a numerical reasoning QA model that handles discrete reasoning (e.g., addition, subtraction, counting) to answer a question based on the given passage.

The task at hand is DROP, a numerical question answering dataset created by AllenNLP.

Our model leverages a novel attention masking scheme (namely, the NC-Mask) to:

  1. Reduce the over-reliance on the parametric knowledge by induceing the model leverage number-related contextual knowledge.
  2. And thereby enable the model to correctly interpret the numbers in the passage (consequently improving the numerical reasoning performance).

We also provide the code for pre-training the ALBERT-xxlarge-v2 model as the initial backbone of the NC-BERT model (in this case, the NC-ALBERT).

The NC-ALBERT model, unlike its BERT counterpart, is trained using the sentence order prediction (SOP) task along with the masked language modeling (MLM) task (Lan et al., 2019).

Note

  • The sentence order prediction is not implemented on the "sentence-level," but on the "text chunk-level."

Structure

The repository contains:

  • Implementation/pre-training/finetuning of NC-BERT on MLM/synthetic-data/DROP/SQuAD (in pre_training dir)
  • Code and vocabularies for textual data generation (in textual_data_generation dir)
  • Code for numerical data generation (in pre_training/numeric_data_generation dir)

Instructions for downloading data + models for pre-trained baseline are in the README of pre_training dir.

This repository is based on Geva's repository.

nc-bert's People

Contributors

ag1988 avatar honggiwon avatar mega002 avatar wjdghks950 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.