How to Make Bertviz library available to Dash

What process should I go through to identify the best way to bring in a package like bertviz into dash? Wht process do you go through? Do you think try iframe, then try creating a component etcc. ?

Looking at the code, it looks like it’s a combination of HTML & Javascript encapsulated in Python and exposed via Jupyter widgets.

So, you might be able to get this into Dash with something like:

If you did all of this as a html component, you might be able to pass new paramters by updating the children property and re-passing everything: The HTML + Javascript Library + JSON-ified params. The JSON-ified params would be the things that you might make customizable via other Dash components.

1 Like

And you might need to just fork the library to return params rather than do all of the Jupyter display stuff: bertviz/head_view.py at master · jessevig/bertviz · GitHub

1 Like