This release is a pre-release and may not be stable for production use.
ovos-typed-slots-transformer
The reference typed-slots transformer for OVOS. It reads the candidate utterances
and returns the typed-slots map of OVOS-INTENT-1 §5.6: for each type it was asked
for, a list of {"span": [start, end], "surface", "value"} entries whose offsets
are half-open code-point positions, so utterance[start:end] == surface always
holds. It computes four types with the OVOS parsers — number as a JSON number,
date as (an RFC 3339 timestamp in the session's zone, taken from location.tz and
falling back to the deployment zone), duration (seconds) and color (a
{"hex": "#rrggbb", "name"} pair). It never touches the utterances or the
message context, and every map it returns is checked against the spec before it
leaves the plugin. A type whose entries fail validation is logged and dropped
rather than raised.
The orchestrator loads one typed-slots transformer, hands it the set of types the registered intents declared, and carries the resulting map to intent matching. Because the plugin sees every candidate utterance and computes over all of them, an entry's span indexes the candidate it was read from, and the surface invariant is what lets a consumer tell which candidate an entry belongs to. The map carries only types with at least one entry, never an empty list: a key is present exactly when extraction produced something. A type is therefore absent whether its parser found no such expression, is not installed, does not cover the session language, or raised, and a consumer reads absence as "no slots of this type" without having to distinguish those cases. All the parsers are hard dependencies, so a normal install can compute all four types, and the lazy per-type imports only matter to someone who has pruned one of them out.
Numbers come from numtag. Each number in a candidate gives one entry, so "twenty one and twenty" gives 21 and 20. A whole value is a JSON integer, and a decimal or a fraction ("a third") is a JSON float. An article alone before its noun, such as "uma" in "uma casa", is not written as a number.
Dates come from chronologia. Each date or time in a candidate gives one entry, whose span is the mention chronologia reports. The value is the moment the named time starts, in the session's zone: "tomorrow" is its midnight, "this weekend" its Saturday, "2022" the first of January. Durations come from ovos-date-parser, because chronologia gives the length of a duration but not its span.
Language coverage is the parser's, not the plugin's. numtag and chronologia refuse
a language they have no data for, so nothing is written for number or date
under one. The duration parser instead answers any language by falling back to an
English-driven parser, so its results for an uncovered language are only as good
as that fallback.
Configuration
Under typed_slots_transformers in mycroft.conf:
{
"typed_slots_transformers": {
"ovos-typed-slots-transformer": {
"priority": 50,
"all_types": false
}
}
}
all_types computes all four supported types regardless of what the intents
declared, which is useful when something downstream of intent matching wants the
slots. It costs time on every utterance and is off by default.
Cost
Extraction is per type and per candidate utterance, so the price is the sum of the declared types times the number of candidates. On a ten-word English sentence the date and duration parsers dominate at roughly 8 ms each, numbers cost under 2 ms, and colours are effectively free at well under a millisecond. Asking for all four costs under 20 ms. Declaring only the types an intent actually needs is the cheapest thing a skill can do here.
Metadata
Release files for ovos-typed-slots-transformer 0.0.1a7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ovos_typed_slots_transformer-0.0.1a7.tar.gz | 14.4 kB | Without provenance | Details for ovos_typed_slots_transformer-0.0.1a7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ovos_typed_slots_transformer-0.0.1a7-py3-none-any.whl | Python 3 | none | any | Details for ovos_typed_slots_transformer-0.0.1a7-py3-none-any.whl |
Total release size: 25.6 kB
Release files / ovos_typed_slots_transformer-0.0.1a7.tar.gz
| Download URL | ovos_typed_slots_transformer-0.0.1a7.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
977767df44eaa8d1ad9c887acb0b946bfe2cb879e43c10be944c9cd042d88e48
|
|
BLAKE2b-256 checksum How to use checksums |
d7aee09c81bc6290479553e16d74addd1cec9dd93377940d18a75b8f1efa7332
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ovos_typed_slots_transformer-0.0.1a7-py3-none-any.whl
| Download URL | ovos_typed_slots_transformer-0.0.1a7-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3756a92e7079cae55f33061adb2da28d6991418529948bb9401062354a6c732
|
|
BLAKE2b-256 checksum How to use checksums |
6fae6d8b67f4f2c88357e9740cf7c7e978a5d4ecb4450dabecc96618211a8150
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for ovos-typed-slots-transformer 0.0.1a7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.