Been googling this for a bit, but i dont think i know how to phrase my question:
I have a client-side javascript app with an array of questions.
var questions = [
'How are you?',
'Where are you?',
'How far away is the sun?'
];
I would like to compare a new question against the array of existing questions:
var newQuestion = "How are you doing today?";
Is there an existing client-side javascript library that will copmare the new question to the array of existing questions and return a result like:
[
{
original: "How are you?",
similarity: .80
},
{
original: "Where are you?",
similarity: .71
},
{
original: "How far away is the sun?",
similarity: .13
}
]
Any advice would be helpful!