10.53.4 • Published 7 years ago

botpress-nlu-mod v10.53.4

Weekly downloads
2
License
AGPL-3.0-only
Repository
github
Last release
7 years ago

Botpress NLU ⚔

Botpress NLU is a Botpress module that adds NLU capatibilities to your bot by connecting to the NLU provider of your choice.

🚧 I'm looking for help to support more providers

Provider🚩 Status
Native (built-in)āœ…
LUISāœ…
DialogflowHelp needed
RASAāœ…
Recastāœ…

We believe NLP/NLU is a commodity, so this package abstracts the provider by providing a standard, clean interface that allows you (and the non-technicals) to easily edit the NLU data within Botpress.

With Botpress NLU,

  • You own your data
  • You can seamlessly switch to another NLP provider
  • (soon) You can continously train your bot on misunderstood phrases
  • (soon) You can share and import open-source, community-curated intents & entities

Installation

āš ļø This module only works with the upcoming Botpress X.

  • Install the module yarn add @botpress/nlu
  • Configure a provider (see below)

Usage

  1. You need to chose a Provider (currently dialogflow, luis, rasa, recast or native)
  2. Set the provider config
  3. Configure the provider

Global Configuration (source)

KeyEnvironment VariableRequiredDefault
providerNLU_PROVIDERYes*native
intentsDirNLU_INTENTS_DIRYes./intents
entitiesDirNLU_ENTITIES_DIRYes./entities

'*': Provider is one of dialogflow, rasa, luis, recast or native

Standard NLU Object (event.nlu)

Botpress NLU will instrument incoming events by providing a standardized object with the structure below.

PathDescriptionSupported by
nlu.intentBest classified intent based on confidence (same structure as below)Dialogflow, LUIS, Rasa, Recast
nlu.intents[i].nameThe name of the classified intentLUIS, Rasa, Recast
nlu.intents[i].confidenceConfidence of the classification, between 0 and 1, higher the betterLUIS, Rasa, Recast
nlu.intents[i].providerThe provider that provided the classification*
nlu.entities[i].nameThe name of the extracted entitiyDialogflow
nlu.entities[i].typeThe type of entity that was extractedLUIS, Rasa, Recast
nlu.entities[i].valueThe normalized value of the extracted entityDialogflow, LUIS, Rasa
nlu.entities[i].originalThe original (raw) value of the extracted entityRasa, Recast
nlu.entities[i].confidenceConfidence of the extraction, between 0 and 1LUIS, Recast
nlu.entities[i].providerThe provider that extracted the entity*
nlu.entities[i].positionThe position where it was found in the input string (start position)LUIS, Rasa
nlu.sentimentTBDRecast
nlu.languageTBDRecast

Botpress NLU also provides two convenient methods to the NLU Object : nlu.intent.is(intentName) and nlu.intents.has(intentName).

Providers – Features Matrix

ProviderSynchronizationIntent ClassificationEntity ExtractionScopes (coming soon)
DialogflowāŒāœ…āœ…āŒ
LUISāœ…āœ…āœ…āŒ
RASAāœ…āœ…āœ…āŒ
Recastāœ…āœ…āœ…āŒ
Nativeāœ…āœ…āŒāŒ

DIALOGFLOW

NOTE: Dialogflow-provider is not fully implemented yet and isn't recommended to use at this point.

Botpress NLU use the V2 API of Dialogflow, checkout this link for more information.

Dialogflow Specific Configuration (source)

KeyEnvironment VariableRequired
googleProjectIdGOOGLE_PROJECT_IDYes
https://cloud.google.com/docs/authentication/getting-startedGOOGLE_APPLICATION_CREDENTIALSYes

LUIS

LUIS Specific Configuration (source)

KeyEnvironment VariableRequired
luisAppIdNLU_LUIS_APP_IDYes
luisProgrammaticKeyNLU_LUIS_PROGRAMMATIC_KEYYes
luisAppSecretNLU_LUIS_APP_SECRETYes
luisAppRegionNLU_LUIS_APP_REGIONNo (default is westus)

LUIS Caveats

There are some entities that LUIS doesn't support in some languages, make sure that the language you are using supports the entities you are using in Botpress (this module doesn't do this check for you).

LUIS FAQ

RASA

Botpress NLU will create and train and maintain your projects and models automatically for you.

Note: By default, Botpress creates separate projects for development and production environment, e.g. dev__botpress__all and prod__botpress__all.

Rasa Specific Configuration (source)

KeyEnvironment VariableRequired
rasaEndpointNLU_RASA_URLNo (default is http://localhost:5000/)
rasaTokenNLU_RASA_TOKENNo (none by default)
rasaProjectNLU_RASA_PROJECTNo (default is botpress)

RECAST

Recast Specific Configuration (source)

KeyEnvironment VariableRequired
recastTokenNLU_RECAST_TOKENYes
recastUserSlugNLU_RECAST_USER_SLUGYes
recastBotSlugNLU_RECAST_BOT_SLUGYes

Note: Make sure to use developer token for Recast not request one.

Contributing

The best way to help right now is by helping with the exising issues here on GitHub and by reporting new issues!

License

Botpress is dual-licensed under AGPLv3 and the Botpress Proprietary License.

By default, any bot created with Botpress is licensed under AGPLv3, but you may change to the Botpress License from within your bot's web interface in a few clicks.

For more information about how the dual-license works and why it works that way please see the FAQS.