Skip to main content

Rasa NLU engine backported from main Rasa project

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rasa-nlu-contrib-0.16.1.tar.gz (91.7 kB view hashes)

Uploaded Source

Built Distribution

rasa_nlu_contrib-0.16.1-py3-none-any.whl (117.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page