Git Product home page Git Product logo

opencsr's Introduction

Open-Ended Commonsense Reasoning


DrFact


This is the repository of the paper, Differentiable Open-Ended Commonsense Reasoning, by Bill Yuchen Lin, Haitian Sun, Bhuwan Dhingra, Manzil Zaheer, Xiang Ren, and William W. Cohen, in Proc. of NAACL 2021.

Abstract

Current commonsense reasoning research focuses on developing models that use commonsense knowledge to answer multiple-choice questions. However, systems designed to answer multiple-choice questions may not be useful in applications that do not provide a small list of candidate answers to choose from. As a step towards making commonsense reasoning research more realistic, we propose to study open-ended commonsense reasoning (OpenCSR) — the task of answering a commonsense question without any pre-defined choices — using as a resource only a corpus of commonsense facts. OpenCSR is challenging due to a large decision space, and because many questions require implicit multi-hop reasoning. As an approach to OpenCSR, we propose DrFact, an efficient Differentiable model for multi-hop Reasoning over knowledge Facts. To evaluate OpenCSR methods, we adapt several popular commonsense reasoning benchmarks, and collect multiple new answers for each test question via crowd-sourcing. Experiments show that DrFact outperforms strong baseline methods by a large margin.

Content

Please check the documentation for running the code.

We show the instructions for running four retrieval approaches to the OpenCSR task — BM25 (off-the-shelf), DPR (EMNLP2020), DrKIT (ICLR 2020) and DrFact (ours, NAACL 2021), as well as a concept re-ranker to boost the performance by learning with cross-attention. Note that there is a relative dependency of these four methods:

  • training the DPR model needs the results from BM25 (to create training data);
  • DrFact needs to reuse DPR’s fact index and single-hop results (for creating distant supervision);
  • DrFact and DrKIT share many utility functions (sparse matrix operation and indexing scripts). We detailed the detailed instructions in individual pages.

Outline and Documentation

Citation

@inproceedings{lin-etal-2021-differentiable,
    title = "Differentiable Open-Ended Commonsense Reasoning",
    author = "Lin, Bill Yuchen and Sun, Haitian and Dhingra, Bhuwan and Zaheer, Manzil and Ren, Xiang and Cohen, William",
    booktitle = "Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies",
    month = jun,
    year = "2021",
    address = "Online",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/2021.naacl-main.366",
    pages = "4611--4625"
}

Note: this is not an official Google product.

Contact

This repo is now under active development, and there may be issues caused by refactoring code. Please email [email protected] if you have any questions.

opencsr's People

Contributors

yuchenlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

opencsr's Issues

error occurs when converting the OpenCSR datasets format

I was trying to Preprocess for DPR according to the guide where step 2 went wrong:

Traceback (most recent call last):
File "baseline_methods/DPR/convert_qas_csv.py", line 8, in
nlp.pipeline = [('tagger', nlp.tagger)]
AttributeError: 'English' object has no attribute 'tagger'

I've searched for this Error, but discussions are rare.
my spacy version is 3.2.1, and version of en-core-web-sm is 3.2.0.
Could anyone offer some solutions?

cannot download dataset from the link provided

MEGA:The file you are trying to download is no longer available
This could be due to the following reasons:
The file has been removed as it violated our Terms of Service.
Invalid URL - the link you are trying to access does not exist.
The file has been deleted by the user.

module 'torch.cuda' has no attribute 'amp'

when training DPR, this error occurs.
Some says that attribute "cuda.amp" needs a torch version>=1.50.
In the guide the recommanded torch version is 1.4.0, so I wonder if it is possible to solve the problem without installing other versions of cuda and packages again.

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.