dot-format_attention: Format BERT Attention Weights for Visualizing

Description Usage Arguments Value

Description

Given data from an RBERT model, format the attention weights matrices in the structure expected by the javascript visualization code.

Usage

1
.format_attention(attention, sequence_index = 1)

Arguments

attention

The "attention" component of the output from extract_features(..., features = "attention").

sequence_index

Integer; which example sequence from the input to visualize.

Value

an object structured appropriately for input (as eventual json) to the javascript visualization code.


jonathanbratt/RBERTviz documentation built on June 19, 2021, 6:27 p.m.