4

I want to extract multiple entities from a user input. Example- "Service httpd is not responding because of high CPU usage and DNS Error" So here I want to identify below: Httpd High CPU usage DNS Error

And I will be using this keywords to get a response from a Database.

SUBHOJEET
  • 390
  • 1
  • 10

1 Answers1

6

Just annotate them accordingly, e.g.

## intent: query_error
- Service [httpd](keyword) is not responding because of [high CPU usage](keyword) and [DNS Error](keyword)

Having the sentence from above, Rasa NLU would extract 3 entities of type keyword. You can then access these entities in a custom action and query your database.

Regarding the number of examples which are required: this depends on

  • the NLU pipeline which you are using. Typically tensorflow_embedding requires more training examples than spacy_sklearn since it does not use pretrained language models.
  • the number of different values your entities can have. If it is only httpd, high CPU usage, and DNS error then you don't need a lot of examples. However, if you have a thousand different values for your entity, then you need more training examples

One intent is enough if you always want to trigger the same custom action. However, if you want to classify different type of problems, e.g. server problems and client problems, and trigger different databases depending on the type of problems, you might consider having multiple intents.

Sorry for the vague answers, but in machine learning most things are highly dependent on the use case and the dataset.

Tobias
  • 1,880
  • 11
  • 17
  • how many such examples do I need to train to extract the entities correctly. also is it necessary that all training example should consists of three similar entities. – SUBHOJEET Nov 21 '18 at 13:28
  • added it to my answer – Tobias Nov 21 '18 at 14:00
  • How to fill the slot in stories.md with the list of keywords, so it can be used in a custom action? – asmaier Nov 27 '18 at 12:26
  • @asmaier: autofilled by default from the intent (unless the slot has the parameter autofilled: false, or the slot has the type=unfeaturized) – peter.cyc Dec 30 '19 at 21:14