Cognigy

Cognigy.AI Docs

COGNIGY.AI is the Conversational AI Platform focused on the needs of large enterprises to develop, deploy and run Conversational AI’s on any conversational channel.

Given the arising need of voice interfaces as the most natural way of communicating with brands, Cognigy was founded in 2016 by Sascha Poggemann and Phil Heltewig. Our mission: to enable all devices and applications to intelligently communicate with their users via naturally spoken or written dialogue.

Get Started

Slot Mapping

Detect slots & keyphrases in the user input

Description

Slots are specific data types or custom keyphrases which are detected by the Cognigy NLU and placed into the Input Object under the property input.slots.

There are two type of slots:

  • System-defined Slots
  • User-defined Slots (Lexicons / keyphrases)

👍

Tokenize Your Slots

Create Tokens for your slots so your can speed up the process of adding them to conversation logic and output fields.

Accessing Slots via CognigyScript

System and User-Created slots can be accessed quite simply through CognigyScript.

{{input.slots}} contains all found slots, tags and keyphrases.

CognigyScript

Description

{{input.slots.tagName}}

Returns the keyphrase array for the tag tagName

System-defined Slots

Cognigy.AI automatically detects the following Slots. All system-defined slot tags are capitalized.

Slot Tag

Example

Slot JSON

DATE

tomorrow, August 1st at 5pm

"DATE": [
      {
        "start": {
          "day": 2,
          "month": 6,
          "year": 2018,
          "hour": 12,
          "minute": 0,
          "second": 0,
          "millisecond": 0,
          "text": "tomorrow",
          "weekday": 6,
          "dayOfWeek": "Saturday",
          "ISODate": "2018-06-02T12:00:00Z"
        },
        "end": null
      }

NUMBER

one hundred, 143

"NUMBER": [
      100,
      143
    ]

DURATION

10 minutes 20 seconds

"DURATION": {
      "hour": null,
      "minute": 10,
      "second": 20
    }

TEMPERATURE

50 degrees

"TEMPERATURE": [
      50
    ]

AGE

32 years old

"AGE": [
      32
    ]

EMAIL

[email protected]

"EMAIL": [
      "[email protected]"
    ]

PERCENTAGE

5 percent

"PERCENTAGE": [
      5
    ]

URL

https://cognigy.com

"URL": [
      "https://cognigy.com"
    ]

MONEY

500 dollars

"MONEY": [
      {
      "value": 500,
      "unit": "$"
    }
    ]

DISTANCE

12 kilometers

"DISTANCE": [
      {
      "value": 12,
      "unit": "kilometre"
    }
    ]

Date formats


🚧

Time Zone & Date Slots

Detection of dates depends on the time zone set for the Agent (see Settings) or User (see here)

The following tables provide an overview of supported input patterns and formats.

Languages

Supported input pattern examples

English

Now, Today, Tomorrow, Yesterday, Last Friday, Last night
17 August 2013 - 19 August 2013
This Friday from 13:00 - 16.00
5 days ago
2 weeks from now
Sat Aug 17 2013 18:40:39 GMT+0900 (JST)
2014-11-30T08:15:30-05:30
Day after tomorrow
Days before yesterday
Next Tuesday

German

Jetzt, Heute, Morgen, Gestern, Vorgestern
Letzte Nacht, Heute Nacht, Diese Nacht, Morgen Vormittags, Gestern Abend
Nach einem Tag, In einer Woche
15/01/2021, 15.01.2021, 15. Jan 2021, Freitag den 15. Januar 2021
17.08.2013 - 19.08.2013, 17.08.2013 bis 19.08.2013
Kommenden Montag

Dutch

Nu, Deze Nacht, Deze Vannacht, Gisteren, Morgen, Gisteravond, Eergisteren, Overmorgen
Morgen Middag, Deze Ochtend, Gisteren Voormiddag, Deze Namiddag, Morgen Avond, Overmorgen Nacht
Binnen Een Dag, Na een halve Maand
15/01/2021, 15.01.2021, 15. Jan 2021, Vrijdag de 15de Januari 2021
17.08.2013 - 19.08.2013, 17.08.2013 tot 19.08.2013
Laatste/vorige/volgende/komende Woensdag

Japanese

今日, 当日, 昨日, 明日, 今夜, 今夕, 今晩, 今朝
2016年2月17日です
Sat Aug 17 2013
01/30/2018

Other languages

By example of French, the following patterns are supported. Some advanced patterns involving more advanced casual expressions such as "day before yesterday" or "next friday" would not be supported:

15.04.2023 12:00
15 aout 2015
15 aout 2015 a 12 octobre 2016
aujourd'hui, demain, hier
hier soir, demain après-midi

DATE Slot parsing depends on the language set in the Flow. See here for an overview of date formats by country we aim to support. The following table outlines the language-specific behaviors on slash-formatted dates:

Languages

Slash date format ordering (01/01/2019)

Default (English UK, German, Generic etc.)

dd/mm/YYYY

English US, Japanese, Chinese

mm/dd/YYYY

Note if mm/dd/YYYY yields an illegal date the parser falls back to dd/mm/YYYY.

🚧

Future Dates Only

You can force the DATE slot to only detect dates in the future for relative expressions (e.g. "Monday", "Friday"). For more information, see the Code Node Action setForwardDatesOnly

🚧

Invalid DATES

Cognigy.AI checks the validity of provided dates, including leap years, etc. Invalid dates will not appear in the detected slots.

User-defined Slots (Lexicons)

User-defined Slots in Cognigy are called Keyphrases, which are created and maintained in the Lexicons Editor.

In Cognigy AI, Lexicons are lists of Keyphrases with Tags. A Lexicon can have any number of Keyphrases, which in turn can have any number of Tags and Synonyms.

If a Lexicon is assigned to a Flow, the Flow will parse the user input for all Keyphrases. When detected Keyphrases with same Tag are assigned to Slots.

Accessing Keyphrases

Detected Keyphrases will be exposed in the Input property input.slots.lexiconTagName.keyphrase (e.g. input.slots.product.keyphrase.shirt).

{
    "slots": {
        "tag1": [
            {
                "keyphrase": "found keyphrase",
                "lower": "found keyphrase in lower case",
                "synonym": "found synonym, otherwise keyphrase",
                "count": "how often the keyphrase was found"
            }
        ]
    }
}

Keyphrases and Synonyms are detected in order of their word count, with the longest Keyphrase first. If cake and cheese cake are defined and the text is I love cheese cake, only cheese cake will be found.

If a Synonym is found, the returned Keyphrase is the Keyphrase the Synonym is mapped to, whilst the Synonym itself is recorded in a special synonym property of the result.

📘

Example of how Slots are filled

If the user says I love pizza pie, the slots Input property will look like this:

{
    "food": [
        {
            "keyphrase": "pizza",
            "count": 1,
            "synonym": "pizza pie"
        }
    ]
}

🚧

Attach Lexicons to your flows

Lexicons must be attached to NLU training data for the NLU model to recognize the keyphrases and synonyms that have been created. Find out more on the Attached Lexicons Page.

Updated about a month ago


Slot Mapping


Detect slots & keyphrases in the user input

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.