dead simple intent parser
Project description
Padacioso
A lightweight, dead-simple intent parser
Built on top of simplematch, inspired by Padaos
Example
from padacioso import IntentContainer
container = IntentContainer()
## samples
container.add_intent('hello', ['hello', 'hi', 'how are you', "what's up"])
## "optionally" syntax
container.add_intent('hello world', ["hello [world]"])
## "one_of" syntax
container.add_intent('greeting', ["(hi|hey|hello)"])
## entity extraction
container.add_intent('buy', [
'buy {item}', 'purchase {item}', 'get {item}', 'get {item} for me'
])
container.add_intent('search', [
'search for {query} on {engine}', 'using {engine} (search|look) for {query}',
'find {query} (with|using) {engine}'
])
container.add_entity('engine', ['abc', 'xyz'])
container.calc_intent('find cats using xyz')
# {'conf': 1.0, 'name': 'search', 'entities': {'query': 'cats', 'engine': 'xyz'}}
## wildcards syntax
container.add_intent('say', ["say *"])
container.calc_intent('say something, whatever')
# {'conf': 0.85, 'entities': {}, 'name': 'test'}
## typed entities syntax
container.add_intent('pick_number', ['* number {number:int}'])
container.calc_intent('i want number 3')
# {'conf': 0.85, 'entities': {'number': 3}, 'name': 'pick_number'})
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
padacioso-1.0.2a2.tar.gz
(19.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file padacioso-1.0.2a2.tar.gz.
File metadata
- Download URL: padacioso-1.0.2a2.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a4be15355b033967bd7066037a3267bc8edd899b3df824172be5bb0eb9da6bc
|
|
| MD5 |
cf97676811815e5573c58162b1d8e63b
|
|
| BLAKE2b-256 |
8df225ed39b8e34a12b1e142a7558c39bcc6c75852e0555d29df2f98a88fb325
|
File details
Details for the file padacioso-1.0.2a2-py3-none-any.whl.
File metadata
- Download URL: padacioso-1.0.2a2-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
468db16eb6de9c2230b0363ab52047672daefd8f891d74e06fcc2d6fda76f646
|
|
| MD5 |
3040d7b58e1a18a032287aa56368948c
|
|
| BLAKE2b-256 |
d9ad339c4387bbd23f9b05b82394e642160d742ae7fd62859e0d750754b1c066
|