MycroftAI / padatious

A neural network intent parser
http://padatious.readthedocs.io
Apache License 2.0
159 stars 40 forks source link
intent intent-classification language-detection language-processing text-analysis text-processing

License CLA Team Status

PRs Welcome Join chat

Padatious

An efficient and agile neural network intent parser. Padatious is a core component of Mycroft AI.

Features

Getting Started

Installing

Padatious requires the following native packages to be installed:

Ubuntu:

sudo apt-get install libfann-dev python3-dev python3-pip swig libfann-dev python3-fann2

Next, install Padatious via pip3:

pip3 install padatious

Padatious also works in Python 2 if you are unable to upgrade.

Example

Here's a simple example of how to use Padatious:

program.py

from padatious import IntentContainer

container = IntentContainer('intent_cache')
container.add_intent('hello', ['Hi there!', 'Hello.'])
container.add_intent('goodbye', ['See you!', 'Goodbye!'])
container.add_intent('search', ['Search for {query} (using|on) {engine}.'])
container.train()

print(container.calc_intent('Hello there!'))
print(container.calc_intent('Search for cats on CatTube.'))

container.remove_intent('goodbye')

Run with:

python3 program.py

Learn More

Further documentation can be found at https://mycroft.ai/documentation/padatious/