TextHeatmaps.jl is a lightweight Julia package for visualization of numerical values associated with text.
To install this package and its dependencies, open the Julia REPL and run
]add TextHeatmaps
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:
This not only works in the REPL, but also as HTML output in notebooks and on websites:
The color scheme of the heatmap
is customizable:
For more information, refer to the package documentation.
- 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.