Skip to content

Commit 128f123

Browse files
committed
Update README
1 parent 02f4a4a commit 128f123

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,39 @@
44
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://Julia-XAI.github.io/TextHeatmaps.jl/dev/)
55
[![Build Status](https://github.com/Julia-XAI/TextHeatmaps.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/Julia-XAI/TextHeatmaps.jl/actions/workflows/CI.yml?query=branch%3Amain)
66
[![Coverage](https://codecov.io/gh/Julia-XAI/TextHeatmaps.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/Julia-XAI/TextHeatmaps.jl)
7+
8+
TextHeatmaps.jl is a lightweight Julia package for visualization of numerical values associated with text.
9+
10+
## Installation
11+
To install this package and its dependencies, open the Julia REPL and run
12+
13+
```julia-repl
14+
]add TextHeatmaps
15+
```
16+
17+
## Example
18+
Assume you have the following values associated with words in a sentence:
19+
```julia
20+
text = "I loved the concert but not the opening act"
21+
words = split(text)
22+
val = [0.1, 2.5, 0.0, 0.3, -0.6, -1.4, 0.0, 0.1, -0.1]
23+
```
24+
25+
These values could for example come from a sentiment analysis model.
26+
27+
Using the heatmap function, we can visualize the values:
28+
29+
![Heatmap in Julia-REPL][heatmap-repl]
30+
31+
This not only works in the REPL, but also works in Pluto notebooks and Documenter:
32+
33+
![Heatmap in Pluto][heatmap-pluto]
34+
35+
The color scheme of the `heatmap` can be customized, as shown in the
36+
[package documentation](https://Julia-XAI.github.io/TextHeatmaps.jl/stable/):
37+
38+
![Heatmap in Documenter][heatmap-settings]
39+
40+
[heatmap-repl]: https://raw.githubusercontent.com/Julia-XAI/TextHeatmaps.jl/gh-pages/assets/heatmap_repl.png
41+
[heatmap-pluto]: https://raw.githubusercontent.com/Julia-XAI/TextHeatmaps.jl/gh-pages/assets/heatmap_pluto.png
42+
[heatmap-settings]: https://raw.githubusercontent.com/Julia-XAI/TextHeatmaps.jl/gh-pages/assets/heatmap_settings.png

docs/src/example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The model returns a vector of sentiment scores for each word,
99
where positive values indicate positive sentiment
1010
and negative values indicate negative sentiment:
1111
```@example 1;
12-
val = [0.1, 2.5, 0.0, 0.3, -0.6, -1.4, 0.0, 0.1, -0.3]
12+
val = [0.1, 2.5, 0.0, 0.3, -0.6, -1.4, 0.0, 0.1, -0.1]
1313
nothing #hide
1414
```
1515

0 commit comments

Comments
 (0)