Yoctol Natural Language Understanding SDK
Project description
# yoctol-nlu-py
[![Build Status](https://travis-ci.org/Yoctol/yoctol-nlu-py.svg?branch=master)](https://travis-ci.org/Yoctol/yoctol-nlu-py)
[![PyPI version](https://badge.fury.io/py/yoctol-nlu.svg)](https://badge.fury.io/py/yoctol-nlu)
Yoctol Natural Language Understanding SDK for python.
## Install
Use Python3
```
pip install yoctol-nlu
```
## Usage
### Intent Classifier Service
For existing classifier:
```python
from ynlu import NLUClient
client = NLUClient(token='YOUR_TOKEN_HERE')
# Get all possible clf ids
ids = client.get_all_available_clf_ids()
print(ids)
# Get model by id
model = client.get_model_by_id(ids[0])
# Predict
intent_result, entity_result = model.predict('飲料喝到飽')
# Also could get the clf by clf's name
# Get all possible clf names
names = clf.get_all_available_clf_names()
print(names)
# Get model by name
model = client.get_model_by_name(names[0])
# Predict
intent_result, entity_result = model.predict('飲料喝到飽')
```
## Documentation
We rely on Sphinx for user and API documentation.
You can run just make to do rebuild the API stubs and then build the HTML documentation.
```
cd docs
make # equivalent to `make apidoc && make html`
```
To only build the html pages:
```
cd docs
make html
```
To just re-generate the API reference.
```
cd docs
make apidoc # calls sphinx-apidoc
```
Run `make help` for a full list of build options.
[![Build Status](https://travis-ci.org/Yoctol/yoctol-nlu-py.svg?branch=master)](https://travis-ci.org/Yoctol/yoctol-nlu-py)
[![PyPI version](https://badge.fury.io/py/yoctol-nlu.svg)](https://badge.fury.io/py/yoctol-nlu)
Yoctol Natural Language Understanding SDK for python.
## Install
Use Python3
```
pip install yoctol-nlu
```
## Usage
### Intent Classifier Service
For existing classifier:
```python
from ynlu import NLUClient
client = NLUClient(token='YOUR_TOKEN_HERE')
# Get all possible clf ids
ids = client.get_all_available_clf_ids()
print(ids)
# Get model by id
model = client.get_model_by_id(ids[0])
# Predict
intent_result, entity_result = model.predict('飲料喝到飽')
# Also could get the clf by clf's name
# Get all possible clf names
names = clf.get_all_available_clf_names()
print(names)
# Get model by name
model = client.get_model_by_name(names[0])
# Predict
intent_result, entity_result = model.predict('飲料喝到飽')
```
## Documentation
We rely on Sphinx for user and API documentation.
You can run just make to do rebuild the API stubs and then build the HTML documentation.
```
cd docs
make # equivalent to `make apidoc && make html`
```
To only build the html pages:
```
cd docs
make html
```
To just re-generate the API reference.
```
cd docs
make apidoc # calls sphinx-apidoc
```
Run `make help` for a full list of build options.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
yoctol_nlu-0.6.0-py3-none-any.whl
(29.1 kB
view hashes)
Close
Hashes for yoctol_nlu-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8ffb815cb813f482cf3e727b5ee4f69bbf0d708b517b16ec4615cc80d1082c6 |
|
MD5 | 0a7c5623226f95527dbe106f6554dc23 |
|
BLAKE2b-256 | 60841a6c07ba30a52744b0ee9c028b78a4f8b34c9064827955b672534e979716 |