Get Variable from User Intent

Im looking for a way to get a variable from the users intent that wont be a list. The user intent is “Get Server Logs” and I want to be able to pick up the server name from the intent i.e. “Get server logs from abcserver” or Get abcserver logs" I then use this with a service to an API.

Hello Anthony,

If the understanding is correct, the usecase is: User utterance is “get logs from adcserver” then you want to able to capture adcserver as the entity value.

This can be achieved by using NER

But, ensure that all possible combinations for utterance have been trained and NER mapped for each.

Let us know if this solves your query.

Reading through NER I think this may be impossible to achieve with this product. We have over 26,000 servers and new ones everyday. If I am reading it right I would have to train it with every server utterance? I was hoping to try and use some sort of regex that would recognize the pattern as they are all the same pattern but different numbers i.e. aaaa1001a or bbbb2001b so using something like [a-zA-Z]{4}|d{4}[a-zA-Z]{1}. I currently request it as a string in an entity but was looking for a way to make it more natural and capture it in the initial intent.

We request you to try the NER feature hands-on. It should work for you.
You will notice that when you configure the intent training like shown below AND train the bot.

It will follow the proper pattern and for utterances like get logs from server1, get logs from server2 it will work fine.


With NER you don’t have to train with every known value of an entity. What the model is doing is looking at the surrounding words to determine where in a user’s utterance a suitable value might exist.

But there are other alternatives beyond NER.

In parlance what you are trying to do is extract an entity, and this is distinct and not necessarily connected to the intent identification. The intent training gets you to a dialog and then the flow within that determines which entities are extracted and when, either from the initial utterance or by further prompting the user. It is a two step process.

The results from the NER model are not even looked at until the underlying entity is processed in the flow. So when the dialog transitions into an entity, it:

  1. Checks to see if NER has found a potential value,
  2. If not, checks to see if there are any entity patterns to guide where to look,
  3. Start looking through the unused words for a possible value

Each entity has a type that any found value must conform to (and if not the entity moves on to the next technique for finding a value from the above list).

So for some types of entities (eg. dates, times) you don’t need any training at all because the platform knows how to validate them. But others (e.g. list of items, regex) you may need to provide details.

And there is a third type, such as string, where there is no possible training of values, just the ability to indicate the prefix and suffix words that bound a possible value. The string entity type is greedy by nature and will just grab as many words as are available in the chunk of sentence it is considering. Generally I advise using string entities as a last resort because of this, but if you want to do this then you ought to use NER and/or entity patterns to guide and limit the extraction. Indeed you have to use those two schemes if you want to extract a string entity from the user’s initial utterance.

You could also use a combination of entities, perhaps as hidden ones, to attempt to find different styles of server name.

  1. The custom entity supports a regex pattern which could be used for a dotted ip address.
  2. The custom entity can, instead of a regex, reference a concept. There is an internal concept that is dynamically marked on words that are a combination of letters and numbers. It is called ~modelnumber
  3. There is URL entity type in case the user is overzealous (copy/paste), your would need to post-process the value to extract the server
  4. A list of items entity, which can be dynamically built, could contain a list of servers. In your case 26000 is probably too much, but perhaps a user’s favorites?

As a fallback if nothing is found, because the user didn’t specify anything, then you have an entity to prompt for a value.

Swagata and Andy, thank you very much I was able to figure it out from what both of you suggested with Utternces using the NLM. I even took it one step further to teach it how to find the amount of time as well.

Thank you