Skip to main content

Rasa NLU engine backported from main Rasa project

Build Status Coverage Package version

rasa-nlu-contrib

Rasa NLU engine backported from main Rasa project

Rasa NLU (Natural Language Understanding) is a tool for understanding what is being said in short pieces of text. For example, taking a short message like:

"I'm looking for a Mexican restaurant in the center of town"

And returning structured data like:

  intent: search_restaurant
  entities: 
    - cuisine : Mexican
    - location : center

Rasa NLU is primarily used to build chatbots and voice apps, where this is called intent classification and entity extraction. To use Rasa, you have to provide some training data. That is, a set of messages which you've already labelled with their intents and entities. Rasa then uses machine learning to pick up patterns and generalise to unseen sentences.

You can think of Rasa NLU as a set of high level APIs for building your own language parser using existing NLP and ML libraries.

Installation

  • Minimal pip install rasa-nlu-contrib
  • Full pip install rasa-nlu-contrib[all]
    • server
    • spacy
    • tensorflow
  • HTTP server pip install rasa-nlu-contrib[server]
  • Spacy pip install rasa-nlu-contrib[spacy]
  • Tensorflow pip install rasa-nlu-contrib[tensorflow]
  • Chinise pip install rasa-nlu-contrib[zh]
  • Duckling pip install rasa-nlu-contrib[duckling]
  • Mitie pip install rasa-nlu-contrib[mitie]

Full list for copy-and-paste:

pip install rasa-nlu-contrib
pip install rasa-nlu-contrib[all]
pip install rasa-nlu-contrib[server]
pip install rasa-nlu-contrib[spacy]
pip install rasa-nlu-contrib[tensorflow]
pip install rasa-nlu-contrib[zh]
pip install rasa-nlu-contrib[duckling]
pip install rasa-nlu-contrib[mitie]

Changes

See release notes

Usage

For details see legacy documentation.

Python API

import os
import pprint

from rasa_nlu.model import Interpreter
from rasa_nlu.train import train

model_name = 'nlu'
project_name = 'project_demo'

here = os.path.abspath(os.path.dirname(__file__))
path_config = os.path.join(here, 'sample_configs', 'config_supervised_embeddings.yml')  # noqa E501
path_data = os.path.join(here, 'data', 'examples', 'rasa', 'demo-rasa.md')
path_models = os.path.join(here, 'demo_models')

trainer, interpreter, persisted_path = train(  # @UnusedVariable
    path_config,
    path_data,
    path=path_models,
    project=project_name,
    fixed_model_name=model_name
)
message = "let's see some italian restaurants"
result = interpreter.parse(message)
pprint.pprint(result)

interpreter = Interpreter.load(os.path.join(path_models, project_name, model_name))  # noqa E501
message = "let's see some italian restaurants"
result = interpreter.parse(message)
pprint.pprint(result)

HTTP API

python demo.py http

curl 'localhost:5000/'
curl 'localhost:5000/status'
curl 'localhost:5000/version'

curl 'localhost:5000/parse?q=hello&project=project_demo&model=nlu'

Docker

docker-compose up

curl 'localhost:5000/'
curl 'localhost:5000/status'
curl 'localhost:5000/version'

curl 'localhost:5000/parse?q=hello&project=project_demo&model=nlu'

License

This project is licensed under the terms of the MIT license. Code of Rasa is licensed under the terms of the Apache 2.0 license. Copy of the license and additional notes.

Development and how to contribute

Issues and suggestions are welcome through issues

Changes

0.16.1 (2022-04-05)

  • Fix issue with server dependency

0.16.0 (2021-01-21)

  • Minimize the bare installation
    • server (HTTP) can be installed now separately
  • Rasa-NLU version 0.15.1
  • Known issues:
    • Tests
      • tests/base/test_extractors.py :: 1 failing tests due Python version
      • tests/base/test_featurizers.py :: 4 failing tests due Python version
      • tests/base/test_multitenancy.py :: 5 failing tests due Python version
      • tests/training/test_train.py :: 5 failing tests due Python version
    • Requirements
      • tox is not used due to dependecy issue on six

0.15.1 (2021-01-20)

  • Initial release
  • Rasa-NLU version 0.15.1
  • Known issues:
    • tests/base/test_extractors.py :: 1 failing tests due Python version
    • tests/base/test_featurizers.py :: 4 failing tests due Python version
    • tests/base/test_multitenancy.py :: 5 failing tests due Python version
    • tests/training/test_train.py :: 5 failing tests due Python version

Metadata

Release files for rasa-nlu-contrib 0.16.1

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-nlu-contrib 0.16.1
File Size Uploaded
rasa-nlu-contrib-0.16.1.tar.gz 91.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rasa-nlu-contrib 0.16.1
File Interpreter ABI Platform
rasa_nlu_contrib-0.16.1-py3-none-any.whl Python 3 none any Details

Total release size: 208.6 kB

Release files / rasa-nlu-contrib-0.16.1.tar.gz

Download URL rasa-nlu-contrib-0.16.1.tar.gz
Size 91.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a9c91ff7674ddbc0d05a5263166d322419bda92f29561c0985194c9ef06cca0e
BLAKE2b-256 checksum
How to use checksums
6945b901ebcf04a936e2380700c4255980ffcb732e519767b17945685e82205b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.13

Release files / rasa_nlu_contrib-0.16.1-py3-none-any.whl

Download URL rasa_nlu_contrib-0.16.1-py3-none-any.whl
Size 117.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bca10e4e0e7687fe96c803f788d37347b70d87ca0d6afc6f142f2ec7077b1b49
BLAKE2b-256 checksum
How to use checksums
f8db44eee9dfac1672be7ae9b2b8bd930c86367bf4e8e1d846e45fd2d6a82f94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.13

Release history Release notifications | RSS feed

This release

0.16.1 This release

2 release files

0.16.0

2 release files

0.15.1

2 release files

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