Kent Beck
Kent Beck

Reputation: 5011

Tag Cloud web service?

Is there a public, free web service that generates tag clouds? I'm looking for something like Google Chart--URL in, image out.

Upvotes: 4

Views: 3468

Answers (5)

ty.
ty.

Reputation: 11132

12 years later, I decided to build this World Cloud API. You send it your text, it will render a PNG or SVG word cloud with word tokens scaled by frequency.

Here's a simple URL example using a famous speech:

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.

Word Cloud API example

Note that GET requests typically require that you URL encode the text, especially if it contains special characters.

There are many parameters that allow you to customize and scale your word cloud. Some notable ones include:

  • text: The actual text to create a tag cloud from (required)
  • scale: The function to determine how words are scaled by frequency. linear (default), sqrt, or log.
  • removeStopWords: Set to true to remove common English words
  • fontScale: A multiplier that determines the baseline size of words

For larger texts, you should use a POST request instead of encoding it in the URL. Here's an example usage in 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)

I documented all the API options and multiple word cloud examples here.

Hope someone finds this useful!

Upvotes: 1

mcpeterson
mcpeterson

Reputation: 5134

Realize that this is an old post, but I think tagcrowd.com might work here despite no API access. Commercial license is cheap $19.95.

Upvotes: 0

pmlarocque
pmlarocque

Reputation: 1714

Maybe you could make a use of this : http://www.wordle.net/

Upvotes: 0

Kent Beck
Kent Beck

Reputation: 5011

It still makes sense to me, but I haven't been able to find any such service. Actually, the API could be words in, styled text out or words in, image out. I'll just implement what I need in SWT and go from there.

You can see an example of the kind of thing I'd like to generate at http://www.wordle.net/gallery/wrdl/359579/JUnit_Tests. These are the words in the names of JUnit's self-tests.

Upvotes: 2

victoriah
victoriah

Reputation: 1394

I highly doubt it. A web service for this wouldn't make any sense.

There are tons of libraries though:

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

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

Upvotes: 2

Related Questions