Skip to content

Julia-XAI/TextHeatmaps.jl

Repository files navigation

TextHeatmaps.jl

Stable Dev Build Status Coverage Aqua

TextHeatmaps.jl is a lightweight Julia package for visualization of numerical values associated with text.

Installation

To install this package and its dependencies, open the Julia REPL and run

]add TextHeatmaps

Example

Assume you have the following values associated with words in a sentence:

text = "I loved the concert but not the opening act"
words = split(text)
val = [0.1, 2.5, 0.0, 0.3, -0.6, -1.4, 0.0, 0.1, -0.1]

These values could for example come from a sentiment analysis model.

Using the heatmap function, we can visualize the values:

Heatmap in Julia-REPL

This not only works in the REPL, but also as HTML output in notebooks and on websites:

Heatmap in Pluto

The color scheme of the heatmap is customizable:

Heatmap in Documenter

For more information, refer to the package documentation.

Related packages

  • VisionHeatmaps.jl: Sibling package for visualization of input space attributions for vision models.
  • ExplainableAI.jl: TextHeatmaps.jl was designed as a dependency for visualization of attributions from ExplainableAI.jl.