views:

78

answers:

2

I'm planning to automate the FAQ section in my site where the questions and answers stored in standard DB and would like to get the input question from the user and recognize it (algorithm) and get the appropriate answer for that and return it to the user. Approach :

get input string -> parse -> check words with each question in DB ->reply the answer with most matched question

Which algorithm suites better for this approach to recognize the question from the user against the DB?

A: 

One simple approach would be to first filter unnecessary words like 'how' and 'and' and so on. Then query the DB for the important words and generate a score for the matches.

DaClown
+1  A: 

When I was working on some code for automatic selection of questions and answers from a FAQ collection, I ended up extracting keywords from the answers and setting scores on them. Then I checked all keywords against the question asked and the highest-scoring Q&A pair was presented.

A slight improvement would be to present the highest-scoring Q&A and all Q&A pairs that score 90% or more of that.

Unfortunately, I do not have any code at hand.

Vatine
Thanks vatine , This is good suggestion, i've added it :)
TuxGeek