I am currently trying to create a chatbot and adding some contextdata to it, like in this example: https://github.com/axa-group/nlp.js/tree/master/examples/14-ner-corpus
I have tried several variants of configs, filenames, file paths etc. I even looked up the source code if the contextdata corpus gets read, which it does.
But at the end when running my code against "what is the real name of spiderman?" the {{ hero }} part gets replaced, but the {{ _data[entities.hero.option].realName }} doesn't.
My code currently looks like this:
import { NlpManager, ConversationContext } from 'node-nlp'
const manager = new NlpManager({
languages: ['en'],
forceNER: true,
autoSave: false,
nlu: { useNoneFeature: true }
})
const context = new ConversationContext()
manager.addCorpora('./corpus.json')
await manager.train()
const response = await manager.process(
'en',
'what is the real name of spiderman?',
context
)
console.log(response)
The corpus files i use are those linked in the example above:
https://github.com/axa-group/nlp.js/blob/master/examples/14-ner-corpus/corpus.json
https://github.com/axa-group/nlp.js/blob/master/examples/14-ner-corpus/heros.json
I hope someone can give me a pointer at what i am doing wrong here.
question from:
https://stackoverflow.com/questions/65878376/how-to-use-contextdata-in-node-nlp-properly 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…