Skip to main content

Rasa Addons

PyPI Travis

A set of 🚀🚀🚀 components to be used with Botfront and/or Rasa.

Botfront is an open source chatbot platform built with Rasa.

rasa_addons.core.policies.BotfrontDisambiguationPolicy

This policy implements fallback and suggestion-based disambiguation.

It works with actions rasa_addons.core.actions.ActionBotfrontDisambiguation, rasa_addons.core.actions.ActionBotfrontDisambiguationFollowup and rasa_addons.core.actions.ActionBotfrontFallback, and NLU pipeline component rasa_addons.nlu.components.intent_ranking_canonical_example_injector.IntentRankingCanonicalExampleInjector.

Example usage

policies:
  ...
  - name: rasa_addons.core.policies.BotfrontDisambiguationPolicy
    fallback_trigger: 0.30 # default value
    disambiguation_trigger: '$0 < 2 * $1' # default value
    disambiguation_template: 'utter_disambiguation' # default value
    n_suggestions: 2 # default value
    excluded_intents:
      - ^chitchat\..* # default value
      - ^basics\..*
  ...

Note: Automatic generation of suggestion button titles

Botfront introduces the notion of "canonical" training examples, which provide a canonical human-readable text for intent labels. For example, for an intent pay_bills with examples "Pay bills", "I want to pay my bills", "How does one pay the bills on this website?", the first example may be selected as canonical. Canonical status serves as a cue to the bot designer, since intent labels can become untractable over time. It may also come to serve more Botfront-internal roles in the future.

The Botfront Disambiguation Policy uses canonical status to provide localized text for the suggestion buttons shown to users during disambiguation. In order to enable this feature, the NLU pipeline for each language model needs to be extended in the following way:

pipeline:
  ...
  - name: rasa_addons.nlu.components.intent_ranking_canonical_example_injector.IntentRankingCanonicalExampleInjector
  ...

This NLU component enriches the intent_ranking key of user messages in the tracker with canonical text, so that the Disambiguation Policy may pick it up. If the NLU component is not used, buttons will have the intent name as their title.

Parameters

fallback_trigger

Float (default 0.30): if confidence of top-ranking intent is below this threshold, fallback is triggered. Fallback is an action that utters the template utter_fallback and returns to the previous conversation state.

disambiguation_trigger

String (default '$0 < 2 * $1'): if this expression holds, disambiguation is triggered. (If it has already been triggered on the previous turn, fallback is triggered instead.) Here this expression resolves to "the score of the top-ranking intent is below twice the score of the second-ranking intent". Disambiguation is an action that lets the user to choose from the top-ranking intents using a button prompt.

disambiguation_template

String (default 'utter_disambiguation'): a response name resolving to a template containing a text field with a message, e.g. "I could not quite understand. Did you mean...". Any button included under the buttons field of this template will also appear at the end of autogenerated suggestions, e.g. {"title": "None of the above", "type": "postback", "payload": "/deny_suggestions"}.

n_suggestions

Int (default 2): the maximum number of suggestions to display (excluding the 'Other' options).

excluded_intents

List (default ["^chitchat\..*", "^basics\..*"]): any intent (exactly) matching one of these regular expressions will not be shown as a suggestion.

rasa_addons.core.policies.BotfrontMappingPolicy

This policy implements regular expression-based direct mapping from intent to action.

Example usage

policies:
  ...
  - name: rasa_addons.core.policies.BotfrontMappingPolicy
    triggers:
      - trigger: '^map\..+'
        action: 'action_botfront_mapping'
        extra_actions:
          - 'action_myaction'
  ...

ActionBotfrontMapping

The default action ActionBotfrontMapping takes the intent that triggered the mapping policy, e.g. map.my_intent and tries to generate the template utter_map.my_intent.

rasa_addons.core.channels.webchat.WebchatInput

Example usage

credentials:
  ...
  rasa_addons.core.channels.webchat.WebchatInput:
    session_persistence: true
    base_url: {{rasa_url}}
    socket_path: '/socket.io/'
  ...

rasa_addons.core.channels.rest.BotfrontRestInput

Rest Input Channel with multilanguage and metadata support.

Example usage

credentials:
  ...
  rasa_addons.core.channels.rest.BotfrontRestInput:
    # POST {{rasa_url}}/webhooks/rest/webhook/
  ...

rasa_addons.core.nlg.BotfrontTemplatedNaturalLanguageGenerator

Idential to Rasa's TemplatedNaturalLanguageGenerator, except in handles templates with a language key.

rasa_addons.core.nlg.GraphQLNaturalLanguageGenerator

The new standard way to connect to the Botfront NLG endpoint. Note that support for the legacy REST endpoint is maintained for the moment. This feature is accessed by supplying a URL that doesn't contain the substring "graphql".

Example usage

endpoints:
  ...
  nlg:
    url: 'http://localhost:3000/graphql'
    type: 'rasa_addons.core.nlg.GraphQLNaturalLanguageGenerator'
  ...

Release files for rasa-addons 0.9.29.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rasa-addons 0.9.29.3
File Size Uploaded
rasa_addons-0.9.29.3.tar.gz 23.5 kB Details

Release files / rasa_addons-0.9.29.3.tar.gz

Download URL rasa_addons-0.9.29.3.tar.gz
Size 23.5 kB
Tags Source
SHA-256 checksum
How to use checksums
46a668e2fe7c6cbba7ca99f8c993640a0a4bf175039b6e5c2a3aaff5c273cdb3
BLAKE2b-256 checksum
How to use checksums
e4a4fef89049bb7e9af0363ac6a1837148d377b951f606c9971d900e978920e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.9.29.3 This release

1 release file

0.9.29

1 release file

0.9.28

1 release file

0.9.27

1 release file

0.9.26

1 release file

0.9.25

1 release file

0.9.24

1 release file

0.9.23

1 release file

0.9.22

1 release file

0.9.21

1 release file

0.9.20

1 release file

0.9.19

1 release file

0.9.18

1 release file

0.9.17

1 release file

0.9.16

1 release file

0.9.15

1 release file

0.9.14

1 release file

0.9.13

1 release file

0.9.12

1 release file

0.9.11

1 release file

0.9.10

1 release file

0.9.9

1 release file

0.9.8

1 release file

0.9.7

1 release file

0.9.6

1 release file

0.9.5

1 release file

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.8.6

1 release file

0.8.5

1 release file

0.8.4

1 release file

0.8.3

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.7.5

1 release file

0.7.4

1 release file

0.7.3

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.9

1 release file

0.5.7

1 release file

0.5.5

1 release file

0.5.4

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.3

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page