GithubHelp home page GithubHelp logo

i-machine-think / morphology_and_generalisation Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 1.0 52.33 MB

Repository with code for interpretability analyses of a recurrent neural network predicting German plural nouns.

Jupyter Notebook 33.04% Python 62.77% Shell 1.81% Perl 1.45% Smalltalk 0.07% Emacs Lisp 0.67% JavaScript 0.03% NewLisp 0.06% Ruby 0.07% Slash 0.01% SystemVerilog 0.01%
recurrent-neural-networks interpretability morphology probing

morphology_and_generalisation's Introduction

Morphology & generalisation

Installation

Install OpenNMT via the conventional route (e.g. https://pypi.org/project/OpenNMT-py/1.2.0/). Afterwards, replace your implementation with the OpenNMT code provided here, and rerunning python setup.py install.

Model training

This repository provides a custom adapted installation of OpenNMT in opennmt, with a dedicated README on the scripts to train encoder-decoder models and run the various behavioural tests.

DC training and visualising results

Afterwards, the results presented in the paper can reproduced with code from the following folders:

  • behavioural
    • visualise_nonce.ipynb: jupyter notebook to visualise nonce predictions.
    • visualise_training_curve.ipynb: jupyter notebook to visualise the training curves.
    • visualise_overgeneralisation.ipynb: jupyter notebook to visualise the overgeneralisation curves.
    • visualise_enforce_gender.ipynb: jupyter notebook to visualise the plural classes after enforcing gender.
    • visualise_increasing_lengths.ipynb: jupyter notebook to visualise the increasing lengths for the -s class.
  • diagnostic_classification:
    • Contains various bash and python scripts to train DCs. Visit the folder for suggestions on how to train DCs and evaluate them.
    • Afterwards, visualise_diagnostic_classification.ipynb can help visualise the results,
    • and baselines.ipynb helps you collect baseline results.
  • interventions:
    • Contains various bash and python scripts to perform interventions. Visit the folder for suggestions on how to train DCs and evaluate them.
    • Afterwards, visualise_interventions.ipynb can help visualise the results.
  • belth_model: Decision trees of the models by Belth et al. (2021), retrained on Wiktionary data for 5 seeds. (https://arxiv.org/pdf/2105.05790.pdf)

The graphic below summarises the results per plural class, where the line thickness indicates relative performance, and colour gradients indicate how performance increases as a word is being processed.

@inproceedings{dankers2021generalising,
  title={Generalising to German plural noun classes, from the perspective of a recurrent neural network},
  author={Dankers, Verna and Langedijk, Anna and McCurdy, Kate and Williams, Adina and Hupkes, Dieuwke},
  booktitle={Proceedings of the 25th Conference on Computational Natural Language Learning},
  pages={94--108},
  year={2021}
}

morphology_and_generalisation's People

Contributors

vernadankers avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

annaproxy

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.