TypeChat icon indicating copy to clipboard operation
TypeChat copied to clipboard

How to model classical NLU intents and entities(slots)?

Open rmtuckerphx opened this issue 8 months ago • 0 comments

The calendar example's actions are similar to intents that one would define for Dialogflow or Alexa. How to use OpenAI as an intent NLU engine?

The issue is that "yes" and "yes, please" matches the YesIntent but "ok" or other affirmative responses do not.

Inputs:

  • yes
  • ok
  • sure
  • i will
  • yes, please

Type schema:

// The following types define the structure of an object of type BotIntent that represents a user request that matches most closely to the sample or synonyms

export type BotIntent = YesIntent | NoIntent | UnknownIntent;

// if the user types text that closely matches 'yes' or a synonym, this intent is used
export type YesIntent = {
  intentName: 'YesIntent';
  sample: 'yes';
  text: string;
};

// if the user types text that closely matches 'no' or a synonym, this intent is used
export type NoIntent = {
  intentName: 'NoIntent';
  sample: 'no';
  text: string;
};

// if the user types text that can not easily be understood as a bot intent, this intent is used
export interface UnknownIntent {
  intentName: 'UnknownIntent';
  sample: 'unknown';
  // text typed by the user that the system did not understand
  text: string;
}

How to model more complicated intents with required and optional entities?

rmtuckerphx avatar Oct 21 '23 00:10 rmtuckerphx