alainrk / alainrk/quick-match

Could someone help me with these questions?

Abierto
#23 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
2
Forks
1
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.