Visualize number vector on text using colored html
Project description
Visualize number vector on text using colored html
Usage
Input:
from html_text_color import from_tokens
html = from_tokens(["I", " am", " a", " sentence", "."], [1, 2, 3, 4, 5], dim_order="b")
Output html:
Input:
html = from_tokens(
[["I", "▁am", "▁a", "▁sentence", "."],
["I", "▁am", "▁another", "▁sentence", "."]],
[[[1, 0, 5], [2, 0, 2], [3, 0, 3], [4, 0, 4], [5, 0, 5]],
[[5, 0, 0], [4, 2, 0], [3, 4, 0], [2, 6, 0], [1, 8, 0]]],
dim_order="rgb"
)
Output html:
Input:
from html_text_color import from_ids
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("gpt2")
html = from_ids(tokenizer.encode("I am a sentence."), tokenizer, [1, 2, 3, 4, 5])
Output html:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
html_text_color-0.0.1.tar.gz
(13.8 kB
view hashes)
Built Distribution
Close
Hashes for html_text_color-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3851254f5e94d064733f26c13315ca425d3902c4e3540f80a2954f01501c0122 |
|
MD5 | 3c375290464912bf5fa17546b45acf4d |
|
BLAKE2b-256 | 4f6c5a68e4c937c8fd02e077d9168bae5b9d17ee1b881f005e883b6c312462b7 |