-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
entities in request always empty #1134
Comments
Hello there, can you please share the request that is supposed to fill the entities? |
sure!
|
Thanks for the fast response. The problem is that the underlying NLU plugin (nlp.js) that is used by the Jovo Debugger does not have a built-in name entity-type. This is one of the main reasons we switched the content of the template in v4. One workaround would be to add a custom entity-type and values for potential names or use another NLU integration that is able to handle names by itself. I hope this helps. |
I understand. Can i define a type for the Jovo Debugger specifically?
Because i don't want to rewrite my model everytime i build my project. I definitely need to use some of these built in types especially for number inputs aswell. |
Yes that works, but you will have to specify the type for "type": {
"alexa": "AMAZON.US_FIRST_NAME",
"dialogflow": "@sys.given-name"
"nlpjs": "MyEntityType"
} As for the dynamic types, nlpjs has some built-in ones but they're not enabled by default.
import { NlpjsNlu } from '@jovotech/nlu-nlpjs';
// import could be used instead if module declarations are provided for @nlpjs/builtin-default
const { BuiltinDefault } = require('@nlpjs/builtin-default');
// initialize debugger
const jovoDebugger = new JovoDebugger();
// initialize built-in entity extraction
const builtin = new BuiltinDefault()
// add the built-in entity extractor to the container of the nlp-instance
(jovoDebugger.config.nlu as NlpjsNlu).nlpjs?.container?.register('extract-builtin-??', builtin, true);
app.use(jovoDebugger) This is something that we're going to simplify in the future. Let me know if this fixes the problem or does not help. |
Thank you @m-ripper ! However as I'm only using the debugger for quick local tests anyways, I'm fine with setting it to some pre-defined values as you described above. PS: I highly suggest adding that |
Hey @EeeDotZee, Regarding the typings of It's definitely helpful, thank you for your feedback! |
Sorry for reopening this but are there any updates on enabling the debugger to auto-fill entities? The workaround with a custom entity type for the debugger works for me, the small hack proposed my @m-ripper does not - although I am trying to extract a search query, not a name. Being able to have the debugger's NLP auto extract entities would be really nice! |
I was able to enable the entities recognition with nlp.js and Microsoft extractor. This is the code that I used: import { BuiltinMicrosoft } from '@nlpjs/builtin-microsoft';
import { Nlp, NlpjsNlu } from '@jovotech/nlu-nlpjs';
import { LangEn } from '@nlpjs/lang-en';
import { LangIt } from '@nlpjs/lang-it';
import { Platform } from '@jovotech/framework';
// [...]
const nlp = new NlpjsNlu({
languageMap: {
en: LangEn,
it: LangIt,
},
enabled: true,
setupModelCallback: async (platform: Platform, nlpjs: Nlp) => {
nlpjs.container.register('extract-builtin-??', BuiltinMicrosoft, true);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
await nlp.addCorpusFromModelsIn('./models');
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
await nlpjs.train();
},
});
app.configure({
plugins: [
new FileDb({
pathToFile: '../db/db.json',
}),
new JovoDebugger({
nlu: nlp,
}),
],
});
export * from './server.express'; Pay attention that currently, I think there is a bug in the Microsoft Extractor package because it missing the Italian language resource. I opened the issue here waiting for the response. |
@jBernavaPrah Can you provide a sample TypeScript Jovo app that shows this working? I'm interested in the Jovo model file and how to get past the error:
|
Hi @rmtuckerphx // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore before the first line or any lines that give you issues with Typescript. (I know I know, but I was still testing and the project and package Anyway, at the end, I decided to move away from I decided to use the .net version (the original and fully functional code) of |
Thanks @jBernavaPrah |
I'm submitting a...
Expected Behavior
If i set an entity in my language model it should be filled up with a value when the request is sent.
Current Behavior
I'm trying to migrate my v3 project to v4 and everything works fine beside migrating my inputs to v4. I adjusted the language model as described in the documentation and this is how my intent looks right now:
This is how my intent handler looks:
However
this.$entities
is always empty if i do for examplemy name is John
. I also see that in the Debugger in the lifecycle that now entities are being added.What am i doing wrong? My example is pretty much the same as in documentation.
PS: the right intent is triggered, so the routing works
Your Environment
The text was updated successfully, but these errors were encountered: