Keyword Relevancy Algorithms

A small and simple algorithm in order to find relevant keywords in a text works as follows:

  1. initialising array of stop words and keywords,
  2. text preprocessing, such as lowercasing and removing peculiars,
  3. determining general text statistics, such as number of characters,
  4. removing stop words,
  5. exploding text to keyword array,
  6. iterating keyword array in order to count earch word,
  7. sorting and delivering result.

Download this JavaScript, embedded in HTML as ZIP file: algorithm_js.zip

Download this PHP code as ZIP file: algorithm_php.zip

Advertising