nlp.js
nlp.js copied to clipboard
entities.topic.option is undefined if there are multiple topic entities
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?
@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.
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?
Closing due to inactivity. Please, re-open if you think the topic is still alive.