Skip to main content

Visualization tools for NLP machine learning models.

Project description

Ecco Logo

Ecco is a python library for explaining Natural Language Processing models using interactive visualizations.

It provides multiple interfaces to aid the explanation and intuition of Transformer-based language models. Read: Interfaces for Explaining Transformer Language Models.

Ecco runs inside Jupyter notebooks. It is built on top of pytorch and transformers.

The library is currently an alpha release of a research project. Not production ready. You’re welcome to contribute to make it better!

Installation

# Assuming you had PyTorch previously installed
pip install ecco

Documentation

To use the project:

import ecco

# Load pre-trained language model.
lm = ecco.from_pretrained('distilgpt2')

# Input text
text = "The countries of the European Union are:\n1. Austria\n2. Belgium\n3. Bulgaria\n4."

# Generate 20 tokens to complete the input text.
output = lm.generate(text, generate=20, do_sample=True)

This does the following:

  1. It loads a pretrained Huggingface DistilGPT2 model. It wraps it an ecco LM object that does useful things (e.g. it calculates input saliency, can collect neuron activations).

  2. We tell the model to generate 20 tokens.

  3. The model returns an ecco OutputSeq object. This object holds the output sequence, but also a lot of data generated by the generation run, including the input sequence and input saliency values. If we set activations=True in from_pretrained(), then this would also contain neuron activation values.

  4. output can now produce various interactive explorables. Examples include:

Changelog

0.0.8 (2020-11-20)

  • Allowing the project some fresh air.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ecco-0.0.13.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

ecco-0.0.13-py2.py3-none-any.whl (37.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ecco-0.0.13.tar.gz.

File metadata

  • Download URL: ecco-0.0.13.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20200925 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.5

File hashes

Hashes for ecco-0.0.13.tar.gz
Algorithm Hash digest
SHA256 16c6bd627570436e6eb7e7d38f808b9470e44eff9f46c28528e02093a38c28cd
MD5 58d4b797eb328ab09cc60474e2435195
BLAKE2b-256 0228169783ef89a4ca7b37e5170369c37322d9a67ecdbb4ff3b8c6466c524798

See more details on using hashes here.

Provenance

File details

Details for the file ecco-0.0.13-py2.py3-none-any.whl.

File metadata

  • Download URL: ecco-0.0.13-py2.py3-none-any.whl
  • Upload date:
  • Size: 37.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20200925 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.5

File hashes

Hashes for ecco-0.0.13-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 eb183852f595260b56d6e1c6193e833254f05982b1368659b1a325043f24d215
MD5 d0d6f52b2a097bc79fd332d92eb082a5
BLAKE2b-256 724e9c10e37c095fe3daa5c7c8c5aaccab620505a00c52221342c24ae676e30d

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page