4

是否有生成标签云的公共、免费 Web 服务?我正在寻找类似谷歌图表的东西——URL 输入,图像输出。

4

5 回答 5

2

我对此表示高度怀疑。用于此的 Web 服务没有任何意义。

虽然有大量的图书馆:

CodeIgniter:http ://codeigniter.com/forums/viewthread/64498/

Java: http: //opencloud.sourceforge.net/

于 2008-12-04T01:44:09.437 回答
2

这对我来说仍然有意义,但我还没有找到任何这样的服务。实际上,API 可以是文字输入、样式化文本输出或文字输入、图像输出。我将在 SWT 中实现我需要的东西,然后从那里开始。

您可以在http://www.wordle.net/gallery/wrdl/359579/JUnit_Tests看到我想生成的那种东西的例子。这些是 JUnit 的自检名称中的单词。

于 2008-12-04T16:06:26.747 回答
1

12 年后,我决定构建这个World Cloud API。您将文本发送给它,它会渲染一个 PNG 或 SVG 文字云,其中包含按频率缩放的文字标记。

这是一个使用著名演讲的简单 URL 示例:

https://quickchart.io/wordcloud?text=Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this.But, in a larger sense, we can not dedicate—we can not consecrate—we can not hallow—this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us—that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion—that we here highly resolve that these dead shall not have died in vain—that this nation, under God, shall have a new birth of freedom—and that government of the people, by the people, for the people, shall not perish from the earth.

词云 API 示例

请注意,GET 请求通常要求您对文本进行 URL 编码,尤其是当它包含特殊字符时。

有许多参数可让您自定义和缩放您的词云。一些值得注意的包括:

  • text:创建标签云的实际文本(必需)
  • scale:确定单词如何按频率缩放的函数。 linear(默认)sqrt、 或log
  • removeStopWords:设置为true删除常用英文单词
  • fontScale:确定单词基线大小的乘数

对于较大的文本,您应该使用 POST 请求而不是在 URL 中对其进行编码。这是 Python 中的一个示例用法:

resp = requests.post('https://quickchart.io/wordcloud', json={
    'format': 'png',
    'width': 1000,
    'height': 1000,
    'fontScale': 15,
    'scale': 'linear',
    'removeStopwords': True,
    'minWordLength': 4,
    'text': 'To be or not to be, that is the question...',
})

with open('shakespeare.png', 'wb') as f:
    f.write(resp.content)

我在这里记录了所有 API 选项和多个词云示例。

希望有人觉得这很有用!

于 2020-06-24T18:04:38.720 回答
0

也许你可以利用这个:http ://www.wordle.net/

于 2008-12-08T17:41:50.670 回答
0

意识到这是一篇旧帖子,但我认为 tagcrowd.com 可能在这里工作,尽管没有 API 访问权限。商业许可证便宜 19.95 美元。

于 2010-02-02T01:44:50.483 回答