Skip to content

Commit

Permalink
Merge pull request #158 from PAIR-code/dev
Browse files Browse the repository at this point in the history
Merge dev into main
  • Loading branch information
iftenney authored Nov 17, 2020
2 parents c3ab0ac + 140f257 commit a88c580
Show file tree
Hide file tree
Showing 264 changed files with 13,180 additions and 1,297 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
lit_nlp/node_modules/**
lit_nlp/yarn-error.log
website/www/**
**/build/**
**/node_modules/**
**/__pycache__/**
**/*.pyc
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY . ./

# Update Ubuntu packages and install basic utils
RUN apt-get update
RUN apt-get install -y wget curl gnupg2
RUN apt-get install -y wget curl gnupg2 gcc g++

# Install yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
Expand Down
69 changes: 36 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LIT is built to answer questions such as:
* **Does my model behave consistently** if I change things like textual style,
verb tense, or pronoun gender?

![Example of LIT UI](docs/images/figure-1.png)
![Example of LIT UI](documentation/images/figure-1.png)

LIT supports a variety of debugging workflows through a browser-based UI.
Features include:
Expand All @@ -32,13 +32,13 @@ Features include:
* **Framework-agnostic** and compatible with TensorFlow, PyTorch, and more.

For a broader overview, check out [our paper](https://arxiv.org/abs/2008.05122) and the
[user guide](docs/user_guide.md).
[user guide](documentation/user_guide.md).

## Documentation

* [User Guide](docs/user_guide.md)
* [Developer Guide](docs/development.md)
* [FAQ](docs/faq.md)
* [User Guide](documentation/user_guide.md)
* [Developer Guide](documentation/development.md)
* [FAQ](documentation/faq.md)
* [Release notes](./RELEASE.md)

## Download and Installation
Expand All @@ -61,8 +61,7 @@ conda install cudnn cupti # optional, for GPU support
conda install -c pytorch pytorch # optional, for PyTorch

# Build the frontend
cd ~/lit/lit_nlp
yarn && yarn build
pushd lit_nlp; yarn && yarn build; popd
```

Note: if you see [an error](https://github.com/yarnpkg/yarn/issues/2821)
Expand All @@ -84,25 +83,29 @@ running the demos.

## Running LIT

### Quick-start: sentiment classifier
### Quick-start: classification and regression

To explore classification and regression models tasks from the popular [GLUE benchmark](https://gluebenchmark.com/):

```sh
cd ~/lit
python -m lit_nlp.examples.quickstart_sst_demo --port=5432
python -m lit_nlp.examples.glue_demo --port=5432 --quickstart
```

This will fine-tune a [BERT-tiny](https://arxiv.org/abs/1908.08962) model on the
Navigate to http://localhost:5432 to access the LIT UI.

Your default view will be a
[small BERT-based model](https://arxiv.org/abs/1908.08962) fine-tuned on the
[Stanford Sentiment Treebank](https://nlp.stanford.edu/sentiment/treebank.html),
which should take less than 5 minutes on a GPU. After training completes, it'll
start a LIT server on the development set; navigate to http://localhost:5432 for
the UI.
but you can switch to
[STS-B](http://ixa2.si.ehu.es/stswiki/index.php/STSbenchmark) or [MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) using the toolbar or the gear icon in
the upper right.


### Quick start: language modeling

To explore predictions from a pretrained language model (BERT or GPT-2), run:

```sh
cd ~/lit
python -m lit_nlp.examples.pretrained_lm_demo --models=bert-base-uncased \
--port=5432
```
Expand All @@ -114,14 +117,13 @@ And navigate to http://localhost:5432 for the UI.
See [lit_nlp/examples](./lit_nlp/examples). Run similarly to the above:

```sh
cd ~/lit
python -m lit_nlp.examples.<example_name> --port=5432 [optional --args]
```

## User Guide

To learn about LIT's features, check out the [user guide](docs/user_guide.md), or
watch this [short video](https://www.youtube.com/watch?v=j0OfBWFUqIE).
To learn about LIT's features, check out the [user guide](documentation/user_guide.md), or
watch this [video](https://www.youtube.com/watch?v=CuRI_VK83dU).

## Adding your own models or data

Expand All @@ -130,33 +132,34 @@ launcher, similar to those in [lit_nlp/examples](./lit_nlp/examples). The basic
steps are:

* Write a data loader which follows the
[`Dataset` API](docs/python_api.md#datasets)
* Write a model wrapper which follows the [`Model` API](docs/python_api.md#models)
[`Dataset` API](documentation/python_api.md#datasets)
* Write a model wrapper which follows the [`Model` API](documentation/python_api.md#models)
* Pass models, datasets, and any additional
[components](docs/python_api.md#interpretation-components) to the LIT server
[components](documentation/python_api.md#interpretation-components) to the LIT server
class

For a full walkthrough, see
[adding models and data](docs/python_api.md#adding-models-and-data).
[adding models and data](documentation/python_api.md#adding-models-and-data).

## Extending LIT with new components

LIT is easy to extend with new interpretability components, generators, and
more, both on the frontend or the backend. See the
[developer guide](docs/development.md) to get started.
[developer guide](documentation/development.md) to get started.

## Citing LIT

If you use LIT as part of your work, please cite [our paper](https://arxiv.org/abs/2008.05122):
If you use LIT as part of your work, please cite [our EMNLP paper](https://arxiv.org/abs/2008.05122):

```
@misc{tenney2020language,
title={The Language Interpretability Tool: Extensible, Interactive Visualizations and Analysis for NLP Models},
title={The Language Interpretability Tool: Extensible, Interactive Visualizations and Analysis for {NLP} Models},
author={Ian Tenney and James Wexler and Jasmijn Bastings and Tolga Bolukbasi and Andy Coenen and Sebastian Gehrmann and Ellen Jiang and Mahima Pushkarna and Carey Radebaugh and Emily Reif and Ann Yuan},
year={2020},
eprint={2008.05122},
archivePrefix={arXiv},
primaryClass={cs.CL}
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
year = "2020",
publisher = "Association for Computational Linguistics",
pages = "107--118",
url = "https://www.aclweb.org/anthology/2020.emnlp-demos.15",
}
```

Expand All @@ -165,7 +168,7 @@ If you use LIT as part of your work, please cite [our paper](https://arxiv.org/a
This is not an official Google product.

LIT is a research project, and under active development by a small team.
There will be some bugs and rough edges, but we're releasing v0.1 because we
think it's pretty useful already. We want LIT to be an open platform, not a
walled garden, and we'd love your suggestions and feedback - drop us a line in
the [issues](https://github.com/pair-code/lit/issues).
There will be some bugs and rough edges, but we're releasing at an early stage
because we think it's pretty useful already. We want LIT to be an open platform,
not a walled garden, and we'd love your suggestions and feedback - drop us a
line in the [issues](https://github.com/pair-code/lit/issues).
9 changes: 9 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Language Interpretability Tool releases

## Release 0.2

This release of LIT coincides with the EMNLP 2020 conference, where the LIT
paper was presented, and the publication of the LIT website, including tutorials
and hosted demos.

The UI has been slightly revamped, bugs have been fixed, and new capabilities
have been added.

## Release 0.1.1

This release of LIT adds a pip package for easy installation, cleans up some of
Expand Down
Loading

0 comments on commit a88c580

Please sign in to comment.