GithubHelp home page GithubHelp logo

gchrupala / analyzing-analytical-methods Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 0.0 367 KB

Code for the paper "Analyzing analytical methods" http://dx.doi.org/10.18653/v1/2020.acl-main.381

License: MIT License

Python 100.00%
interpretability neural-networks analyzing-analytical-methods speech-recognition

analyzing-analytical-methods's Introduction

Analyzing analytical methods

This repository contains the instructions and code to help you reproduce the results in the following paper:

Grzegorz Chrupała, Bertrand Higy and Afra Alishahi (2020). Analyzing analytical methods: The case of phonology in neural models of spoken language. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. https://arxiv.org/abs/2004.07070

Prerequisites

For all experiments:

pip install -r requirements.txt

RNN-VGS experiments

  • Create the input data for analyses:
python -c 'import prepare; prepare.prepare_rnn_vgs()'
  • Run analyses:
python -c 'import analyze; analyze.analyze_rnn_vgs()'
  • Plot main results (Figure 2)
python -c 'import analyze; analyze.plot_rnn_vgs()'
  • Plot Figure 4:
python -c 'import analyze; analyze.plot_r2_partial()'

  • Plot Figure 5
python -c 'import analyze; analyze.plot_pooled_feature_std()

RNN-ASR experiments

  • Create the input data for analyses:
python -c 'import prepare; prepare.prepare_rnn_asr()'
  • Run analyses:
python -c 'import analyze; analyze.analyze_rnn_asr()'
  • Plot main results (Figure 3)
python -c 'import analyze; analyze.plot_rnn_asr()'

Transformer-ASR experiments

The transformer-ASR model is a transformer model trained with ESPnet on Librispeech. The forked version of the code we used to extract the activations is available from https://github.com/bhigy/espnet/tree/phoneme-repr. The README at the root of the repository provides instructions for installation, while details about activations extraction can be found under egs/librispeech/asr1/README.md. Alternativaly, the activations are also provided as part of the data you downloaded in the prerequisites, under data/activations/transformer-asr.

  • Copy the activations you extracted or the ones we provide under data/out/transformer-asr.
  • Create the input data for analyses:
python -c 'import prepare; prepare.prepare_transformer_asr()'
  • Run analyses:
python -c 'import analyze; analyze.analyze_transformer_asr()'
  • Plot main results (Figure 1)
python -c 'import analyze; analyze.plot_transformer_asr()'

analyzing-analytical-methods's People

Contributors

bhigy avatar gchrupala avatar

Stargazers

 avatar

Watchers

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