5

I want to compute the relevance of a keyword to a short description text. What would be the best approach in terms of efficiency and ease of implementation. I am using C++?

halfer
  • 19,824
  • 17
  • 99
  • 186
fgungor
  • 479
  • 4
  • 15

2 Answers2

6

Simple solution: Count the occurrences of the word in the text.

To do a good job though is a hard problem that companies like Google have been working on for years. If possible, you might want to take a look at using their technology

To expand, try the following:

That's still only going to get you so far. You'll need to perform some natural language processing to truly understand what the description is about to distinguish between multiple texts containing the keyword the same number of times.

moinudin
  • 134,091
  • 45
  • 190
  • 216
  • Thank you ! Levenshtein distance was the thing I've been trying to recall yeah :) In my case I don't need any hardcore processing. Just want to yield a score over 100 for a really short description text. – fgungor Dec 28 '10 at 13:30
3

Refer to these previous Stack Overflow questions:

Community
  • 1
  • 1
Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480