• Stars
    star
    190
  • Rank 203,739 (Top 5 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This repository contains examples of custom components for educational purposes.

Rasa NLU Examples

This repository contains Rasa compatible machine learning components. These components are open sourced in order to encourage experimentation and to quickly offer support to more tools. By hosting these components here they do not need to go through the same vetting process as the components in Rasa and we hope that this makes it easier for people to contribute new ideas.

The components in the repository are not officially supported. There will be units tests as well as documentation but this project should be considered a community project, not something that is part of core Rasa. If there's a component here that turns out to be useful to the larger Rasa community then we might port features from this repository to Rasa.

Install

To use these tools locally you need to install via git.

python -m pip install "rasa_nlu_examples @ git+https://github.com/RasaHQ/rasa-nlu-examples.git"

Note that if you want to install optional dependencies as well that you'll need to run:

python -m pip install "rasa_nlu_examples[flashtext] @ git+https://github.com/RasaHQ/rasa-nlu-examples.git"
python -m pip install "rasa_nlu_examples[dateparser] @ git+https://github.com/RasaHQ/rasa-nlu-examples.git"
python -m pip install "rasa_nlu_examples[thai] @ git+https://github.com/RasaHQ/rasa-nlu-examples.git"
python -m pip install "rasa_nlu_examples[fasttext] @ git+https://github.com/RasaHQ/rasa-nlu-examples.git"
python -m pip install "rasa_nlu_examples[all] @ git+https://github.com/RasaHQ/rasa-nlu-examples.git"

If you're using any models that depend on spaCy you'll need to install the Rasa dependencies for spaCy first.

python -m pip install rasa[spacy]

Documentation

You can find the documentation for this project here.

Compatibility

This project currently supports components for Rasa 3.0. For older versions, see the list below.

Tokenizers

Tokenizers can split up the input text into tokens. Depending on the Tokenizer that you pick you can also choose to apply lemmatization. For languages that have rich grammatical features this might help reduce the size of all the possible tokens.

  • rasa_nlu_examples.tokenizers.BlankSpacyTokenizer docs
  • rasa_nlu_examples.tokenizers.ThaiTokenizer docs

Featurizers

Dense featurizers attach dense numeric features per token as well as to the entire utterance. These features are picked up by intent classifiers and entity detectors later in the pipeline.

  • rasa_nlu_examples.featurizers.dense.FastTextFeaturizer docs
  • rasa_nlu_examples.featurizers.dense.BytePairFeaturizer docs
  • rasa_nlu_examples.featurizers.dense.GensimFeaturizer docs
  • rasa_nlu_examples.featurizers.sparse.TfIdfFeaturizer docs
  • rasa_nlu_examples.featurizers.sparse.HashingFeaturizer docs

Intent Classifiers

Intent classifiers are models that predict an intent from a given user message text. The default intent classifier in Rasa NLU is the DIET model which can be fairly computationally expensive, especially if you do not need to detect entities. We provide some examples of alternative intent classifiers here.

  • rasa_nlu_examples.classifiers.NaiveBayesClassifier docs
  • rasa_nlu_examples.classifiers.LogisticRegressionClassifier docs

Entity Extractors

  • rasa_nlu_examples.extractor.FlashTextEntityExtractor docs
  • rasa_nlu_examples.extractor.DateparserEntityExtractor docs

Name Lists

Language models are typically trained on Western datasets. That means that the reported benchmarks might not apply to your use-case. For example; detecting names in texts from France is not the same thing as detecting names in Madagascar. Even though French is used actively in both countries, the names of it's citizens might be so different that you cannot assume that the benchmarks apply universally.

To remedy this we've started collecting name lists. These can be used as a lookup table which can be picked up by Rasa's RegexEntityExtractor or our FlashTextEntityExtractor. It won't be 100% perfect but it should give a reasonable starting point.

You can find the namelists here. We currently offer namelists for the United States, Germany as well as common Arabic names. Feel free to submit PRs for more languages. We're also eager to receive feedback.

Usage

You can install the examples from this repo via pip. Let's say you download the standard tools.

pip install git+https://github.com/RasaHQ/rasa-nlu-examples

Once installed you can add tools to your config.yml file, here's an example;

language: en
pipeline:
- name: WhitespaceTokenizer
- name: CountVectorsFeaturizer
  OOV_token: oov.txt
  analyzer: word
- name: CountVectorsFeaturizer
  analyzer: char_wb
  min_ngram: 1
  max_ngram: 4
- name: rasa_nlu_examples.featurizers.dense.BytePairFeaturizer
  lang: en
  vs: 1000
  dim: 25
- name: DIETClassifier
  epochs: 200

An example config for using the Thai tokenizer would look like:

language: th
pipeline:
  - name: rasa_nlu_examples.tokenizers.ThaiTokenizer
  - name: CountVectorsFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: char_wb
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 200

And you can use this file to run benchmarks. From the root folder of the project typically that means running something like;

rasa test nlu --config basic-bytepair-config.yml \
          --cross-validation --runs 1 --folds 2 \
          --out gridresults/basic-bytepair-config

Open an Issue

If you've spotted a bug then you can submit an issue here. GitHub issues allow us to keep track of a conversation about this repository and it is the preferred communication channel for bugs related to this project.

Contribute

There are many ways you can contribute to this project.

  • You can suggest new features.
  • You can let us know if there are bugs.
  • You can share the results of an experiment you ran using these tools.
  • You can let us know if the components in this library help you.

Feel free to start the discussion by opening an issue on this repository. Before submitting code to the repository it would help if you first create an issue so that the maintainers can disucss the changes you would like to contribute. A more in-depth contribution guide can be found here.

To get started locally you can run:

python -m pip install -e ".[dev]"
pre-commit install
python tests/scripts/prepare_fasttext.py

Alternatively you may also run this via the Makefile:

make install

Documentation

If you want to build the documentation locally you can do so via;

mkdocs serve

If you want to deplot the docs to GitHub you can run;

mkdocs gh-deploy

This will deploy a new version to the docs branch, which is picked up by GitHub pages.

More Repositories

1

rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
Python
18,586
star
2

rasa_core

Rasa Core is now part of the Rasa repo: An open source machine learning framework to automate text-and voice-based conversations
Python
2,329
star
3

rasa-demo

🐯 Sara - the Rasa Demo Bot: An example of a contextual AI assistant built with the open source Rasa Stack
Python
929
star
4

financial-demo

A demo for a financial services bot
Python
308
star
5

rasalit

Visualizations and helpers to improve and debug machine learning models for Rasa Open Source
Jupyter Notebook
305
star
6

rasa-sdk

SDK for the development of custom actions for Rasa
Python
291
star
7

NLU-training-data

Crowd sourced training data for Rasa NLU models
Python
196
star
8

helpdesk-assistant

Python
185
star
9

rasa-voice-interface

🎤 A simple web interface for building voice assistants with Rasa
Vue
168
star
10

algorithm-whiteboard-resources

this is where we share notebooks/projects used in your youtube channel
Jupyter Notebook
146
star
11

rasa-masterclass

Data and code files for specific Rasa Masterclass episodes
Jupyter Notebook
139
star
12

medicare_locator

🏥Medicare Locator - Open source starter pack for developers to build contextual chatbots and AI assistants in healthcare
Python
138
star
13

tutorial-knowledge-base

Integrating Rasa with a knowledge base to encode domain knowledge and resolve entities
Python
122
star
14

rasa-x-helm

Rasa Enterprise Helm chart for deploying on Kubernetes (K8s) and OpenShift.
Go
77
star
15

paraphraser

Tool to generate paraphrases of sentences in many languages.
Python
74
star
16

rasa-x-demo

Demo app for running a bot with Rasa Enterprise
Python
69
star
17

conversational-ai-workshop-18

Example showing generalisation
Jupyter Notebook
69
star
18

DIET-paper

Source code to reproduce results of our paper "DIET: Lightweight Language Understanding for Dialogue Systems"
Python
60
star
19

rasa-for-beginners

Rasa for Beginners
Python
57
star
20

STAR

Python
55
star
21

rasa_lookup_demo

Improving entity extraction from text using the lookup table feature in rasa_nlu
Python
52
star
22

tutorial-tf-pipeline

Handling multiple intents using Rasa NLU Tensorflow pipeline
51
star
23

rasa-2.x-form-examples

This repository contains a few simple projects with forms.
Python
48
star
24

kb-demo-chatgpt

Python
46
star
25

nlu-hyperopt

Find the best hyperparameters for your Rasa NLU model
Python
46
star
26

rasa-calm-demo

Python
43
star
27

carbon-bot

Python
42
star
28

breakoutbot

A text based adventure game built with Rasa.
Python
41
star
29

TED-paper

Python
39
star
30

rasa-action-server-gha

A GitHub Action that simplifies using Rasa Actions and helps to prepare a Docker image with custom actions.
Dockerfile
39
star
31

retail-demo

Rasa's retail starter pack
Python
38
star
32

pokedex-demo

Rasa Demo for a digital assistant for pokemon
Python
35
star
33

tutorial-rasa-google-assistant

This repository contains the code of the tutorial 'Going beyond ‘Hey Google’: building a Rasa-powered Google Assistant'
Python
35
star
34

rasa-train-test-gha

A GitHub action to run easily rasa train and rasa test in the CIs.
Python
34
star
35

taipo

Experiments for data quality in Rasa.
Python
34
star
36

rasa-workshop-pydata-berlin

Jupyter Notebook
33
star
37

helm-charts

Helm charts for Rasa products
Smarty
32
star
38

conversational-ai-course-3.x

Containers code for the learning center course.
Python
29
star
39

rasa-workshop

A repository which contains the material for Rasa workshops
Jupyter Notebook
27
star
40

rasa-3.x-form-examples

This repository contains a few simple projects with forms.
Python
27
star
41

insurance-demo

Building a bot to handle general tasks for insurance.
Python
22
star
42

wellness-check-bot

A simple Rasa assistant that uses forms to conduct a daily health survey
Python
21
star
43

tutorial-rasa-alexa

Sample code for a Rasa virtual assistant with an Alexa connector.
Python
19
star
44

workshop-rasax

Python
18
star
45

rasactl

rasactl deploys Rasa X / Enterprise on your local or remote Kubernetes cluster and manages Rasa X / Enterprise deployments.
Go
15
star
46

tod-in-context-learning

Python
15
star
47

rasa-action-examples

A place to host demos for custom actions.
Python
14
star
48

forms_bot

bot which uses forms to do hotel and restaurant booking task
Python
13
star
49

how-to-rasa

Python
13
star
50

live-gdrive-demo

Starter pack for the Rasa Stack
Python
13
star
51

starter-pack-intentless-policy

Python
13
star
52

REI

Rasa Ephermal Installer
Shell
12
star
53

rasa-workshop-pydata-dc

This repository contains the code of the Rasa workshop at PyData DC 2018
Jupyter Notebook
12
star
54

rasa-workshop-pydata-nyc

This repository contains the code of the Rasa workshop at PyData NYC 2018
Jupyter Notebook
12
star
55

awesome-rasa

A list of Rasa resources curated by Rasa and the community.
11
star
56

rasa-custom-spelling-featurizer

This repo contains a tutorial on how to write your own spelling featurizer.
Python
11
star
57

tutorial-migrating-dialogflow-to-rasa

This repository contains the code of the assistant used to demonstrate the migration from DialogFlow to Rasa
Python
11
star
58

spaCy-integration-demo

Python
10
star
59

rasa-3.x-component-examples

A basic Rasa project with Custom Components
Python
10
star
60

livestream-tf-pipeline

Code of the Rasa Twitch livestream on building bots with multi-intents using Rasa NLU TensorFlow pipeline
Python
9
star
61

rasa_stack

A PyPI package which includes Rasa Core and Rasa NLU
Python
8
star
62

rasa-examples

Repository with small Rasa examples.
Python
8
star
63

rasa-custom-fasttext

This repo contains a tutorial on how to make a fasttext featurizer
Python
5
star
64

nlu-and-jupyter

Demonstration of Rasa NLU from Jupyter Lab
Jupyter Notebook
5
star
65

stroopbot

A demonstration of a custom action
Python
4
star
66

rasa-ted-demo

This repo contains a project shows why TED works.
Python
4
star
67

botsociety-py-client

A python client to connect to the Botsociety API
Python
4
star
68

OpenAI_func_calling

4
star
69

workshop-adv-actions

Java
3
star
70

pizza-rule-demo

A demo of rules, stories, actions and forms
Python
3
star
71

benchmark-lookup-ee

This repository contains code to benchmark lookup table entity extraction.
Python
3
star
72

rasa-custom-printer-component

part of a lesson on how to build custom components
Python
3
star
73

multiwoz-paper

Code to analyse MultiWOz and Google Taskmaster-1 dialogue datasets
Python
3
star
74

rei-vm-terraform-example

Example terraform code for creating a VM that is ready for REI installation
Shell
3
star
75

deployment-workshop-bot-2

Python
2
star
76

HandsOn_with_rasa

Python
2
star
77

frontend-coding-test

JavaScript
2
star
78

Hands-on-with-Rasa-2

Python
2
star
79

time-taken-experiment

Some experiments that track how long training might take.
Python
2
star
80

contributors

2
star
81

deploy-tags

TypeScript
2
star
82

deployment-workshop-bot-1

Python
2
star
83

rasa-nlu-eval-compare-gha

A GitHub Action that compares results of multiple Rasa NLU evaluation results and writes the output to an HTML table
Python
2
star
84

calm-guide-code

Python
2
star
85

golastmile.github.io

1
star
86

test-bot

Basic bot used as part of testing Rasa X
Python
1
star
87

rasa-2.0-user-tests-rules

Task for the user tests for rules as part of Rasa Open Source 2.0.
Python
1
star
88

frontend-test

Example Entity annotator (Mock repository)
JavaScript
1
star
89

workshop-rasax-short

Short version of Rasa X workshop
Python
1
star
90

financial-spaces-bot

Python
1
star
91

bart-examples

Repo with example bots on different branches
1
star
92

chatbotsummit-workshop

Python
1
star
93

deployment-workshop-bot-3

Bot for the exam project of the deployment workshop
Python
1
star
94

csm-onboarding

Repo to manage gitpod instances for CSM onboarding
Python
1
star
95

homebrew-rasactl

Homebrew Formula for rasactl
Ruby
1
star
96

webkit-voice-demo

This is a project that shows how to integrate webkit voice with Rasa.
HTML
1
star
97

tourist-agency-calm

Tourist agency example with CALM approach
Python
1
star