npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

botpress-nlu-mod

v10.53.4

Published

Botpress NLU module MODIFIED

Downloads

4

Readme

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 | ✅ | | Dialogflow | Help 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)

| Key | Environment Variable | Required | Default | | ------------- | -------- | ----- | ---- | | provider | NLU_PROVIDER | Yes* | native | | intentsDir | NLU_INTENTS_DIR | Yes | ./intents | | entitiesDir | NLU_ENTITIES_DIR | Yes | ./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.

| Path | Description | Supported by | | ---- | ----------- | ---- | | nlu.intent | Best classified intent based on confidence (same structure as below) | Dialogflow, LUIS, Rasa, Recast | | nlu.intents[i].name | The name of the classified intent | LUIS, Rasa, Recast | | nlu.intents[i].confidence | Confidence of the classification, between 0 and 1, higher the better | LUIS, Rasa, Recast | | nlu.intents[i].provider | The provider that provided the classification | * | | nlu.entities[i].name | The name of the extracted entitiy | Dialogflow | | nlu.entities[i].type | The type of entity that was extracted | LUIS, Rasa, Recast | | nlu.entities[i].value | The normalized value of the extracted entity | Dialogflow, LUIS, Rasa | | nlu.entities[i].original | The original (raw) value of the extracted entity | Rasa, Recast | | nlu.entities[i].confidence | Confidence of the extraction, between 0 and 1 | LUIS, Recast | | nlu.entities[i].provider | The provider that extracted the entity | * | | nlu.entities[i].position | The position where it was found in the input string (start position) | LUIS, Rasa | | nlu.sentiment | TBD | Recast | | nlu.language | TBD | Recast |

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

Providers – Features Matrix

| Provider | Synchronization | Intent Classification | Entity Extraction | Scopes (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)

| Key | Environment Variable | Required | | ------------- | -------- | ----- | | googleProjectId | GOOGLE_PROJECT_ID | Yes | | https://cloud.google.com/docs/authentication/getting-started | GOOGLE_APPLICATION_CREDENTIALS | Yes |

LUIS

LUIS Specific Configuration (source)

| Key | Environment Variable | Required | | ------------- | -------- | ----- | | luisAppId | NLU_LUIS_APP_ID | Yes | | luisProgrammaticKey | NLU_LUIS_PROGRAMMATIC_KEY | Yes | | luisAppSecret | NLU_LUIS_APP_SECRET | Yes | | luisAppRegion | NLU_LUIS_APP_REGION | No (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

  • You have enough labels (min 2) for the intent
  • The entities you are using are supported by your app's language

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)

| Key | Environment Variable | Required | | ------------- | -------- | ----- | | rasaEndpoint | NLU_RASA_URL | No (default is http://localhost:5000/) | | rasaToken | NLU_RASA_TOKEN | No (none by default) | | rasaProject | NLU_RASA_PROJECT | No (default is botpress) |

RECAST

Recast Specific Configuration (source)

| Key | Environment Variable | Required | | ------------- | -------- | ----- | | recastToken | NLU_RECAST_TOKEN | Yes | | recastUserSlug | NLU_RECAST_USER_SLUG | Yes | | recastBotSlug | NLU_RECAST_BOT_SLUG | Yes |

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.