Rasa NLU engine backported from main Rasa project
Project description
Rasa NLU engine backported from main Rasa project
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 onsix
- Tests
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rasa-nlu-contrib-0.16.1.tar.gz
.
File metadata
- Download URL: rasa-nlu-contrib-0.16.1.tar.gz
- Upload date:
- Size: 91.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9c91ff7674ddbc0d05a5263166d322419bda92f29561c0985194c9ef06cca0e |
|
MD5 | d5091010e6553779a8fbd11b304abc4a |
|
BLAKE2b-256 | 6945b901ebcf04a936e2380700c4255980ffcb732e519767b17945685e82205b |
File details
Details for the file rasa_nlu_contrib-0.16.1-py3-none-any.whl
.
File metadata
- Download URL: rasa_nlu_contrib-0.16.1-py3-none-any.whl
- Upload date:
- Size: 117.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bca10e4e0e7687fe96c803f788d37347b70d87ca0d6afc6f142f2ec7077b1b49 |
|
MD5 | e973dbd03385497f5288f3891d1e14e7 |
|
BLAKE2b-256 | f8db44eee9dfac1672be7ae9b2b8bd930c86367bf4e8e1d846e45fd2d6a82f94 |