nlp.js icon indicating copy to clipboard operation
nlp.js copied to clipboard

entities.topic.option is undefined if there are multiple topic entities

Open MeetMartin opened this issue 4 years ago • 2 comments

I am using import {Evaluator, Template} from '@nlpjs/evaluator'; for entities

If the NER finds one entity topic, then "opts": "entities.topic.option === 'mytopic'" evaluates corretly If the NER find multiple entities of topic, then in entities.topic.option the option is undefined

I was trying multiple combinations of how to find out what is in the object topic if multiple topics are found but as far as I can tell the object is empty.

Can you please tell me if it's is a bug or if there is a way how to work with multiple identified entities?

MeetMartin avatar Mar 01 '21 07:03 MeetMartin

@jesus-seijas-sp can you please help me with this one. It's still causing trouble for me in production.

Otherwise, the NLP system works for me quite well, thank you for all the hard work on the library. It is used here: https://www.meet-martin.com/ The website is built in React and deployed on Netlify. The NLP itself is a Netlify function deployed as a webpacked code to AWS lambda.

MeetMartin avatar Mar 17 '21 21:03 MeetMartin

I can only guess with the little informatoon provided.

Nroamly in content "repeastet entities" are encoced into an object where isList is set to True and then the entity instances are in a sub property items as array.

So you could check "entities.topic.isList === true" then you know it is a list .

Does that help?

Apollon77 avatar Aug 08 '22 17:08 Apollon77

Closing due to inactivity. Please, re-open if you think the topic is still alive.

aigloss avatar Nov 25 '22 08:11 aigloss