Coder Social home page Coder Social logo

so2jia / bridge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samiraabnar/bridge

0.0 1.0 0.0 59.18 MB

Making a bridge between NLP models and Brain data

License: GNU General Public License v3.0

Python 24.75% Shell 2.96% Jupyter Notebook 72.29%

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

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.