Giter Site home page Giter Site logo

influence-function-analysis's Introduction

Influence function analysis

The main environment requirements for this project are python 3.6, pytorch 1.2.0, and pytorch-pretrained-bert 0.6.1.

Datasets used in the paper can be found in data/, except for mnli_train.tsv (too large), which can be downloaded from https://gluebenchmark.com/tasks.

run_tagger.sh: finetune a BERT model for sentiment analysis (SA) and natural language inference (NLI).

run_influence.sh: generate influence function results in the paper, including influence score calculation, leave-one-out (LOO) training, and token removals.

SA_analysis.ipynb: see influential examples in SA (Figure 1 in the paper).

NLI_analysis.ipynb: see influential examples in NLI (Table 5 in the paper).

LOO.ipynb: see LOO training results for both SA and NLI (Table 1 and 2 in the paper).

SA_sal_if_direct_consistency.ipynb, NLI_sal_if_direct_consistency.ipynb: Figure 2 and 3 in the paper.

SA_mask_token_analysis.ipynb, NLI_mask_token_analysis.ipynb: Table 3 and 4 in the paper.

NLI_heuristic_analysis.ipynb: Section 5.1 in the paper.

If you have any questions, please email Xiaochuang Han at [email protected]. Thank you!

influence-function-analysis's People

Contributors

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