Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could someone help me with these questions? #23

Open
drksbr opened this issue Mar 5, 2022 · 0 comments
Open

Could someone help me with these questions? #23

drksbr opened this issue Mar 5, 2022 · 0 comments

Comments

@drksbr
Copy link

drksbr commented Mar 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant