Skip to main content

No project description provided

Project description

Neon Transformers

About

Utterance Transformers

A utterance transformer takes utterances and a context as input, then returns the modified utterances and a new context

context is simply a python dictionary, it can contain anything

utterances is a list of transcription candidates, assumed to be a single utterance not a list of unrelated documents!

A transformer might change the utterances or simply return them unmodified with a context

eg.

  • The translator transformer will detect language and translate as necessary, it returns modified utterances
  • the NER transformer return unmodified utterances and the context contains extracted entities

Transformers may also depend on other transformers

from neon_utterance_KeyBERT_plugin import KeyBERTExtractor
from neon_utterance_wn_entailment_plugin import WordNetEntailments

# depends on keywords being tagged by a prev transformer
entail = WordNetEntailments()

kbert = KeyBERTExtractor()  # or RAKE or YAKE ...

utts = ["The man was snoring very loudly"]
_, context = kbert.transform(utts)
_, context = entail.transform(utts, context)
print(context)
# {'entailments': ['exhale', 'inhale', 'sleep']}

mycroft integration

Usage with mycroft-core is limited to skills, it is useful for fallback and common_qa skills

You can import individual transformers directly in skills

neon integration

neon-core integrate the neon_transformers service in the nlp pipeline transparently

  • neon_transformers are integrated into mycroft after STT but before Intent parsing
  • all enabled transformer plugins (mycroft.conf) are loaded
  • each plugin has a priority that the developer sets and the user can override (mycroft.conf)
  • utterances are passed to each transformer sequentially
    • utterances are replaced with the text returned by a transformer
    • if utterances are transformed, the next transformer receives the transformed utterances
    • context is merged with context returned by previous transformer
  • the transformed utterances are passed to the intent stage
  • context is available in message.context for skills during intent handling
    • skills can add transformers to their requirements.txt
    • for compatibility with vanilla mycroft-core skills should handle message.context as optional data
    • if a certain transformer is absolutely necessary, load it directly if message.context is missing data

ovos-core integration

WIP - not available

Audio Transformers

TODO

Project details


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

neon_transformers-0.0.1a1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file neon_transformers-0.0.1a1-py3-none-any.whl.

File metadata

  • Download URL: neon_transformers-0.0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for neon_transformers-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 a9bb42f665577ccbfb0c9c6045387be71d3df8975221bd55f5e5cc7b4c1066a7
MD5 a89cd09c2ce1aa4431f63fb20c53edc9
BLAKE2b-256 97451b109262b216db8ae34a664616570ffbe737cb28573f0f448738dd0485cf

See more details on using hashes here.

Supported by

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