Giter Club home page Giter Club logo

textualexplincontext's Introduction

TextualExplInContext

The Unreliability of Explanations in Few-shot Prompting for Textual Reasoning (NeurIPS 2022)

Setup

Requirements:

  • openai
  • transformers
  • scikit-learn

Set OPENAI KEY:

export OPENAI_API_KEY=yourkey

Run Experiments on Synth

Please run the following commands under synth dir.

(1) Running standard few-shot prompting:

python few_shot.py --run_pred --train_slice 0

(2) Runninng explain-predict or predict-explain pipeline:

python joint.py --run_pred --style e-p (p-e) --train_slice 0

(3) Calibrating the predictions of predict-explain: python posthoc_pipeline.py --style p-e --train_slice 0

Arguments

Note that we will store the API query results as json files in synth/misc.

There are some arguements in few_shot.py and joint.py.

  • --engine specifies the OPENAI API engine (e.g., davinci,text-davinci-001)
  • --style specifies the prompt format style
  • --train_slice specifies the random split of the shots in prompts. Because the trainning data is randomly sampled and permuted, different train_slice will result in different randomly sampled shot sets.

Run Experiments on HotpotAdv and E-SNLI

Please refer to HotpotAdv/run_exp.py and ESNL/run_exp.py. The commands and arguments are the same as the experiments on Synth.

textualexplincontext's People

Contributors

xiye17 avatar

Stargazers

Devesh avatar Jeff Carpenter avatar Ruocheng Guo avatar Jin Liu avatar Wenting Zhao avatar Gasol Sun avatar Annie avatar Puxuan Yu avatar Jiaxin Zhang avatar Nuo Chen avatar  avatar

Watchers

 avatar

textualexplincontext's Issues

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.