2

Python文本颜色渲染

 2 years ago
source link: https://allenwind.github.io/blog/13313/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Mr.Feng Blog

NLP、深度学习、机器学习、Python、Go

Python文本颜色渲染

Python文本颜色渲染小工具,用于NLP中文本的可视化。

根据文本的权重来渲染文本的深浅颜色,只依赖numpy。可以应用在NLP有关任务的可视化~

命令行效果:

Markdown效果:

使用matplotlib绘制成图像的效果:

这里使用STKAITI.TTF字体,侵删。

基于最长公共子序列高亮差异部分:

基于最长公共子串高亮差异部分:

真实场景示例(匹配):

代码实现在:text-color-render

这是我在NLP用的一些可视化应用:

text-globalmaxpool-visualization

text-attentionpooling-visualization

text-integrated-gradients

text-glyph-in-NLU

使用该工具进行可视化的文章:

NLP中Pooling的可视化理解

积分梯度:神经网络可视化方法及其在NLU中的应用

如何评估LSTM每个时间步的重要性?

NLU任务:仅使用字形信息也有效?

转载请包括本文地址:https://allenwind.github.io/blog/13313
更多文章请参考:https://allenwind.github.io/blog/archives/


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK