Skip to main content

NLP Parser

NLP Parser parses the text into token model. Token model is a model that contains the structure of the text. Parser classifies these model into several queries.

Query and Transformation

Query is a set pattern that will parse token model. The matches result will be transformed into command model. The command model properties are as following.

  • command - The command that will tell Execution Router
  • target - The target of execution
  • related_tokens - The tokens that are related to the target. For example, in current date, current is related tokens
  • type - The type of command
  • source - It can be an input for the target for execution

1. WhatQuery

The match pattern:

  1. Index 0 → Position: DET
  2. Index 1 → Position: NOUN
  3. Index 2 → Position: AUX, optional
  4. Index 3 → Position: ADV
  5. Index 4 → Position: PUNCT, optional

Example matches:

  • What time is it now?
  • What time is now?
  • What time now?

Token transformation:

  1. command: NOUN

2. WhoQuery

The match pattern:

  1. Index 0 → Position: PRON
  2. Index 1 → Position: AUX
  3. Index 2 → Position: PRON

Example matches:

  • Who are you?
  • Who is that?

Token transformation:

None

3. AuxiliaryQuery

Example matches:

  1. Index 0 → Position: NOUN
  2. Index 1 → Position: ADV, optional
  3. Index 2 → Position: AUX
  4. Index 3 → Position: PUNCT, optional

Example matches:

  • Current time is?

Token transformation:

  1. command: NOUN

4. CommandQuery

Pattern 1

Example matches:

  1. Index 0 → Position: VERB
  2. Index 1 → Position: PRON, optional
  3. Index 2 → Position: DET, optional
  4. Index 3 → Position: ADJ, optional
  5. Index 4 → Position: NOUN

Example matches:

  • Show me directory media

Pattern 2

Example matches:

  1. Index 0 → Position: VERB
  2. Index 1 → Position: PRON, optional
  3. Index 2 → Position: DET, optional
  4. Index 3 → Position: ADJ, optional
  5. Index 4 → Position: PROPN

Example matches:

  • Show me running containers

Token transformation:

  1. target: NOUN or PROPN