You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this sense, I could make a big list from the concatenation of several arrays of 'categories' and the result of that using them as candidates in the run() method, hoping that the return presents the label linked to the candidate that obtained the highest score.
Another interesting implementation would be to create a variable in the configuration options to delimit the cut-off point for returning the score, that is, if the candidates' highest score is lower than the cut-off point informed in the options, the run() method would return messages of fallback defined in another configuration option.
The text was updated successfully, but these errors were encountered:
Is there any possibility to implement some sort of intent detection?
It would be something more or less like this:
const qr = [
{label: 'food', text: 'mac and cheese', keywords: ['eating', 'cheese', 'mac'] },
{label: 'food', text: 'rice with meat', keywords: ['eating', 'rice', 'meat'] },
{label: 'sports' text: 'Morning run', keywords: ['runing', 'morning'] }
{label: 'sports', text: 'bodybuilding at night' },
]
const input = 'eat in the morning, cheese with mac'
result = qm.run(input, qr)
// candidates
// [
// {
// text: 'mac and cheese',
// keywords: [ 'eating', 'cheese', mac ],
// label: 'food'
// score: 0.4230769230769231,
// intersections: [ 'cheese', 'mac' ]
// },
// {
// text: 'bodybuilding at night',
// keywords: [ ],
// label: 'sports'
// score: 0.2545454545454545,
// stemmed: [ 'foot' ],
// intersections: [ 'foot' ]
// }
// ]
In this sense, I could make a big list from the concatenation of several arrays of 'categories' and the result of that using them as candidates in the run() method, hoping that the return presents the label linked to the candidate that obtained the highest score.
Another interesting implementation would be to create a variable in the configuration options to delimit the cut-off point for returning the score, that is, if the candidates' highest score is lower than the cut-off point informed in the options, the run() method would return messages of fallback defined in another configuration option.
The text was updated successfully, but these errors were encountered: