NeonGeckoCom / neon-transformers

text and audio plugins for neon/ovos/mycroft
Other
0 stars 2 forks source link

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.

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

ovos-core integration

WIP - not available

Audio Transformers

TODO