Leo Jiang
Leo Jiang

Reputation: 26085

PHP: Extracting important keywords from a string

I use the Google Images API to automatically generate thumbnails for my blog posts. I want to pick 3 or 4 important keywords from the post title and get a relevant image from Google Images. What's a good way to do this using PHP?

Upvotes: 1

Views: 402

Answers (2)

barryhunter
barryhunter

Reputation: 21091

You could try the yahho term extraction api

http://developer.yahoo.com/search/content/V1/termExtraction.html

Or maybe tagthe.net

Both are accessible from php with the likes of cURL

Upvotes: 2

someone
someone

Reputation: 1468

There's not really a good way to automatically determine which keywords are "important". However, you could put in all words with at least a certain length, or the 3 longest words, or the words of at least a certain length that occur the most in the article.

Upvotes: 1

Related Questions