Coder Social home page Coder Social logo

bridge's Introduction

Bridge

Making a bridge between NLP models and Brain data

This repository includes codes for:

  • Comparing and evaluating representational spaces (e.g. internal states of language encoding models) using RSA and ReStA.
  • Using internal states of a pretrained language model to predict brain activations.

Publication:

Blackbox meets blackbox: Representational Similarity and Stability Analysis of Neural Language Models and Brains

Requirements:

files:

Path to the raw brain data, e.g.: '/Users/samiraabnar/Codes/Data/harrypotter/'

Spacy model file for tokenization: python -m spacy download en_core_web_lg

How to obtain contextualized representations from different models:

python encode_stimuli_in_context.py

How to run predictive modelling experiments:

python run_experiment.py

How to run RSA experiments:

python rsa/compute_rep_sim.py

Link to colab for plotting the results:

https://colab.research.google.com/drive/1hO9ZV6gfO-WT-wGFwJZvHPQrLPHHuuhO#scrollTo=HeHmO4ZTL9O5&uniqifier=10

To create story_features.npy you can use the scripts in this colab notebook


If you use our code, please consider citing our paper:

@inproceedings{abnar-etal-2019-blackbox,
    title = "Blackbox Meets Blackbox: Representational Similarity {\&} Stability Analysis of Neural Language Models and Brains",
    author = "Abnar, Samira  and
      Beinborn, Lisa  and
      Choenni, Rochelle  and
      Zuidema, Willem",
    booktitle = "Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP",
    year = "2019",
    url = "https://www.aclweb.org/anthology/W19-4820",
}

bridge's People

Contributors

samiraabnar avatar

Stargazers

hyx avatar  avatar David Adam avatar  avatar Jiaang Li avatar tawsif avatar Nikolaos Dionelis avatar Kanishka avatar Sweta Agrawal avatar Dennis Ulmer avatar Gabriele Sarti avatar normanj avatar FengXie avatar zhoudi avatar mengtanx avatar  avatar 爱可可-爱生活 avatar  avatar

Watchers

 avatar  avatar  avatar paper2code - bot 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.