text-attn-vis
text-attn-vis copied to clipboard
A simple attention weights visualizer for text classification.
What
A tool to visualize attention weights on a document, adapted from the attention visualizer by Abigail See. It looks like this when deployed:

How
Run this in the root directory:
python -m http.server
And go to http://localhost:8000/ in your browser. Text and weights will be loaded from a attentions.json file, which contains a list of examples, with each example containing 4 fields:
words: a list of words in the text being classifiedweights: a list of weights assigned to each wordlabel: the gold label of the textprediction: the predicted label