badnaam
badnaam

Reputation: 1884

Rails Dynamic tag generation from context

Let's say I want to trend all comments posted on a site and create dynamic tags. For example, If there are x number of comments that contain the word iPad I would like to create automatically create a tag called "iPad" and put it in a tag cloud.

Is this possible? I checked out the acts_as_taggable gem but it requires one to specify a tag, I guess I am looking for a way to generate tags from content.

Upvotes: 0

Views: 322

Answers (2)

badnaam
badnaam

Reputation: 1884

Well something like the yahoo term extraction service might do the trick and there is a plugin for it http://expressica.com/auto_tags/.

Though it is not for commercial use.

Upvotes: 1

Jamie Wong
Jamie Wong

Reputation: 18350

Sure, this is possible. Just parse the content of each comment as it's passed in and attach the tags you're interested in.

This can either work on a whitelist - where you specify all the tags you're interested in and attach those if relevant.

Or it could work on a blacklist - where you specify all the words to ignore, e.g. "the", "on". This approach is probably a lot more time consuming, but would allow for more dynamic results.

I would probably work on a white list, then have an ability to add new tags to the whitelist and have it go back and retroactively add the tags where applicable.

Upvotes: 0

Related Questions