1

I would like to perform an action based on a user specific number extracted from a text request: "Open contract number XYZ". Where 'XYZ' is the parameter value I need. There are no obvious boundaries for the content of XYZ. It could be a true number or it could be a string. Can an entity type be based on the term position within the request? I expect dialogflow can match the intent based on the first part of the phrase: "Open contract number". How can I get the parameter value that follows that phrase?

Ted
  • 75
  • 7

1 Answers1

0

In theory, yes. For this particular use case, you can use the @sys.any system entity. Just make sure to add many training phrases that can help your agent to detect it.

For example:

Training phrases with sys.any entity

Make sure to mark the contract numer (or id) in the training phrases, so it can be correctly detected as a parameter.

Actions and Parameters with contract Id

Now, you can use the value detected in your responses

Responses

Example of a detected intent

Intent detected

Keep in mind, that the use of any is not ideal (can lead to unintended behavior); however, if you add a good amount of training phrases and you use contexts to handle the conversation flow, it should work fine.

An additional suggestion. If there's any recognizable pattern in the contract id, you can use regexp entities instead of @sys.any, which will also increase the accuracy.

Tlaquetzal
  • 2,760
  • 1
  • 12
  • 18