recognizing “4 days back” using @sys.date
I have an intent which takes date as input. I have used @sys.date
to recognize date which is able to recognize many date formats including today, 2 nov, 2 days ago.
However, surprisingly it is not able to map phrase like 2 days back to a specific date.
Is there any way to make it work?
dialogflow chatbot api.ai
add a comment |
I have an intent which takes date as input. I have used @sys.date
to recognize date which is able to recognize many date formats including today, 2 nov, 2 days ago.
However, surprisingly it is not able to map phrase like 2 days back to a specific date.
Is there any way to make it work?
dialogflow chatbot api.ai
add a comment |
I have an intent which takes date as input. I have used @sys.date
to recognize date which is able to recognize many date formats including today, 2 nov, 2 days ago.
However, surprisingly it is not able to map phrase like 2 days back to a specific date.
Is there any way to make it work?
dialogflow chatbot api.ai
I have an intent which takes date as input. I have used @sys.date
to recognize date which is able to recognize many date formats including today, 2 nov, 2 days ago.
However, surprisingly it is not able to map phrase like 2 days back to a specific date.
Is there any way to make it work?
dialogflow chatbot api.ai
dialogflow chatbot api.ai
edited Dec 14 at 11:18
asked Nov 20 at 13:44
sid8491
2,58121232
2,58121232
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You cannot add to system entities (entities that start with @sys
) but you can create your own composite date entity using a custom date unit entity (that includes "days back") and the system number entity:
- Create a new
date-unit
entity with the valuedays
and the synonymdays back
:
and save the entity - Create another entity called
Date
, uncheck the box forDefine synonyms
and enter@sys.number @date-unit
for the value of the entity:
and save the entity - Next add the
X days back
training example to an intent, which should be auto-annotated (if not highlight the training phrase and annotate it manually):
and save the intent. Try it out by querying your agent with aX days back
query.
The JSON you receive from this payload will vary based on if the @sys.date
entity was recognized or if the @Date
entity you just created was recognized. The JSON payload for the 17 days back query
that your webhook will receive looks like this:
{
"responseId": "1f67167c-8840-42ed-b3ed-420e2c2b1c43",
"queryResult": {
"queryText": "17 days back",
"parameters": {
"Date": "17 days"
},
"allRequiredParamsPresent": true,
"fulfillmentMessages": [
{
"text": {
"text": [
""
]
}
}
],
"intent": {
"name": "projects/anotheragent-c5ea8/agent/intents/6743e47a-8cb5-458d-b573-626d1a392a46",
"displayName": "Date"
},
"intentDetectionConfidence": 1,
"languageCode": "en"
}
}
so you'll need to add some logic in your webhook to parse this date type in addition to the @sys.date
type.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53394393%2frecognizing-4-days-back-using-sys-date%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You cannot add to system entities (entities that start with @sys
) but you can create your own composite date entity using a custom date unit entity (that includes "days back") and the system number entity:
- Create a new
date-unit
entity with the valuedays
and the synonymdays back
:
and save the entity - Create another entity called
Date
, uncheck the box forDefine synonyms
and enter@sys.number @date-unit
for the value of the entity:
and save the entity - Next add the
X days back
training example to an intent, which should be auto-annotated (if not highlight the training phrase and annotate it manually):
and save the intent. Try it out by querying your agent with aX days back
query.
The JSON you receive from this payload will vary based on if the @sys.date
entity was recognized or if the @Date
entity you just created was recognized. The JSON payload for the 17 days back query
that your webhook will receive looks like this:
{
"responseId": "1f67167c-8840-42ed-b3ed-420e2c2b1c43",
"queryResult": {
"queryText": "17 days back",
"parameters": {
"Date": "17 days"
},
"allRequiredParamsPresent": true,
"fulfillmentMessages": [
{
"text": {
"text": [
""
]
}
}
],
"intent": {
"name": "projects/anotheragent-c5ea8/agent/intents/6743e47a-8cb5-458d-b573-626d1a392a46",
"displayName": "Date"
},
"intentDetectionConfidence": 1,
"languageCode": "en"
}
}
so you'll need to add some logic in your webhook to parse this date type in addition to the @sys.date
type.
add a comment |
You cannot add to system entities (entities that start with @sys
) but you can create your own composite date entity using a custom date unit entity (that includes "days back") and the system number entity:
- Create a new
date-unit
entity with the valuedays
and the synonymdays back
:
and save the entity - Create another entity called
Date
, uncheck the box forDefine synonyms
and enter@sys.number @date-unit
for the value of the entity:
and save the entity - Next add the
X days back
training example to an intent, which should be auto-annotated (if not highlight the training phrase and annotate it manually):
and save the intent. Try it out by querying your agent with aX days back
query.
The JSON you receive from this payload will vary based on if the @sys.date
entity was recognized or if the @Date
entity you just created was recognized. The JSON payload for the 17 days back query
that your webhook will receive looks like this:
{
"responseId": "1f67167c-8840-42ed-b3ed-420e2c2b1c43",
"queryResult": {
"queryText": "17 days back",
"parameters": {
"Date": "17 days"
},
"allRequiredParamsPresent": true,
"fulfillmentMessages": [
{
"text": {
"text": [
""
]
}
}
],
"intent": {
"name": "projects/anotheragent-c5ea8/agent/intents/6743e47a-8cb5-458d-b573-626d1a392a46",
"displayName": "Date"
},
"intentDetectionConfidence": 1,
"languageCode": "en"
}
}
so you'll need to add some logic in your webhook to parse this date type in addition to the @sys.date
type.
add a comment |
You cannot add to system entities (entities that start with @sys
) but you can create your own composite date entity using a custom date unit entity (that includes "days back") and the system number entity:
- Create a new
date-unit
entity with the valuedays
and the synonymdays back
:
and save the entity - Create another entity called
Date
, uncheck the box forDefine synonyms
and enter@sys.number @date-unit
for the value of the entity:
and save the entity - Next add the
X days back
training example to an intent, which should be auto-annotated (if not highlight the training phrase and annotate it manually):
and save the intent. Try it out by querying your agent with aX days back
query.
The JSON you receive from this payload will vary based on if the @sys.date
entity was recognized or if the @Date
entity you just created was recognized. The JSON payload for the 17 days back query
that your webhook will receive looks like this:
{
"responseId": "1f67167c-8840-42ed-b3ed-420e2c2b1c43",
"queryResult": {
"queryText": "17 days back",
"parameters": {
"Date": "17 days"
},
"allRequiredParamsPresent": true,
"fulfillmentMessages": [
{
"text": {
"text": [
""
]
}
}
],
"intent": {
"name": "projects/anotheragent-c5ea8/agent/intents/6743e47a-8cb5-458d-b573-626d1a392a46",
"displayName": "Date"
},
"intentDetectionConfidence": 1,
"languageCode": "en"
}
}
so you'll need to add some logic in your webhook to parse this date type in addition to the @sys.date
type.
You cannot add to system entities (entities that start with @sys
) but you can create your own composite date entity using a custom date unit entity (that includes "days back") and the system number entity:
- Create a new
date-unit
entity with the valuedays
and the synonymdays back
:
and save the entity - Create another entity called
Date
, uncheck the box forDefine synonyms
and enter@sys.number @date-unit
for the value of the entity:
and save the entity - Next add the
X days back
training example to an intent, which should be auto-annotated (if not highlight the training phrase and annotate it manually):
and save the intent. Try it out by querying your agent with aX days back
query.
The JSON you receive from this payload will vary based on if the @sys.date
entity was recognized or if the @Date
entity you just created was recognized. The JSON payload for the 17 days back query
that your webhook will receive looks like this:
{
"responseId": "1f67167c-8840-42ed-b3ed-420e2c2b1c43",
"queryResult": {
"queryText": "17 days back",
"parameters": {
"Date": "17 days"
},
"allRequiredParamsPresent": true,
"fulfillmentMessages": [
{
"text": {
"text": [
""
]
}
}
],
"intent": {
"name": "projects/anotheragent-c5ea8/agent/intents/6743e47a-8cb5-458d-b573-626d1a392a46",
"displayName": "Date"
},
"intentDetectionConfidence": 1,
"languageCode": "en"
}
}
so you'll need to add some logic in your webhook to parse this date type in addition to the @sys.date
type.
answered Nov 20 at 15:14
matthewayne
2,599814
2,599814
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53394393%2frecognizing-4-days-back-using-sys-date%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown