Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/OpenVoiceOS/padacioso
dead simple regex based intent parser
https://github.com/OpenVoiceOS/padacioso
Last synced: about 2 months ago
JSON representation
dead simple regex based intent parser
- Host: GitHub
- URL: https://github.com/OpenVoiceOS/padacioso
- Owner: OpenVoiceOS
- License: apache-2.0
- Created: 2021-04-28T18:34:43.000Z (over 3 years ago)
- Default Branch: dev
- Last Pushed: 2024-07-20T18:05:02.000Z (2 months ago)
- Last Synced: 2024-07-29T09:28:23.074Z (about 2 months ago)
- Language: Python
- Size: 54.7 KB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-mycroft-community - Project Link
README
# Padacioso
*A lightweight, dead-simple intent parser*
Built on top of [simplematch](https://github.com/tfeldmann/simplematch), inspired by [Padaos](https://github.com/MycroftAI/padaos)
## Example
```python
from padacioso import IntentContainercontainer = 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'})```