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++?
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.
Refer to these previous Stack Overflow questions:
What are Useful Ranking Algorithms for Documents without Links (e.g. PDF, MS Documents, etc…)?
Algorithm for generating a 'top list' using word frequency.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With