Skip to main content

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


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.2a1.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

padacioso-1.0.2a1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file padacioso-1.0.2a1.tar.gz.

File metadata

  • Download URL: padacioso-1.0.2a1.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for padacioso-1.0.2a1.tar.gz
Algorithm Hash digest
SHA256 80b7dcf4c4805eeaf04a04e56d40315ec2cd415bd800d4d482192fb7bc18d9db
MD5 0b11a3ab1bccf239cd5b371a9ae54c3a
BLAKE2b-256 9d1769e17b3ca1cbff2b8d9ef2774e719728cc9f177c35b272c2677dd959d4c3

See more details on using hashes here.

File details

Details for the file padacioso-1.0.2a1-py3-none-any.whl.

File metadata

  • Download URL: padacioso-1.0.2a1-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

Hashes for padacioso-1.0.2a1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1095f2bf0cffffffe72b9f597f4e35e97ba7d9edb0b23c6f814bcefa104ec82
MD5 b81094f7fde2a8549205a60ccd1fe0be
BLAKE2b-256 ea2e4b8b99f79eb916fd695e3f68a01e5b6c0b81c83eb47e55e99896f479810f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page