如何保存到img“ dispersion_plot” NLTK?

问题描述

我开始学习NLTK。有没有一种方法可以保存对dispersion_plot的图像?

这是我的代码:

import nltk
from nltk import word_tokenize

raw="""This is the text where includes the word lawyers"""

text1 = nltk.Text(word_tokenize(raw))

print(text1.dispersion_plot(["lawyers"]))

因此,它会打印出情节,但我想将其保存到图像文件中。

谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)