foley.index.taxonomy.model#
Data structures for the UCS/AudioSet taxonomy resolver (stdlib-only).
These are plain, immutable-ish records — the resolver logic lives in
ucs, audioset, and
resolver. Nothing here imports numpy/torch; the
whole taxonomy layer is a pure lookup over dicts (report 04 §5.3 — “taxonomies do
faceting and browse”, the CLAP vector does the heavy retrieval).
Classes
|
AudioSet-label -> UCS-CatID overlap map (report 04 §5.3). |
|
The result of resolving free tags/caption/labels to a UCS CatID. |
|
One Universal Category System entry. |
|
A loaded UCS lookup: by CatID (exact + case-insensitive) and by synonym. |
- class foley.index.taxonomy.model.AudioSetUcsMap(by_name=<factory>, by_mid=<factory>)[source]#
Bases:
objectAudioSet-label -> UCS-CatID overlap map (report 04 §5.3).
Keyed primarily by lowercased label name (robust);
by_midcarries the best-effort/m/...machine ids as a secondary key. Every target CatID is validated against the UCS table at load time (fail-fast on a broken map).
- class foley.index.taxonomy.model.CatIdResolution(catid=None, category=None, subcategory=None, source=None, confidence=0.0, matched_terms=<factory>)[source]#
Bases:
objectThe result of resolving free tags/caption/labels to a UCS CatID.
catidfeedsucs_categoryandsubcategoryfeedsucs_subcategoryon ingest, anducs_catidon the query side.
- class foley.index.taxonomy.model.UcsRow(catid, category, subcategory, synonyms=(), confident=False)[source]#
Bases:
objectOne Universal Category System entry.
A
catid(e.g.'DOORWood') is an OPAQUE key — the category prefix is variable-length and not reliably splittable — socatid -> (category, subcategory)is always a table lookup, never a string split (report 04 §5.2).confident=Falsemarks an APPROXIMATE CatID reconstructed for the seed table; verify it against the UCS master before treating it as authoritative.
- class foley.index.taxonomy.model.UcsTable(by_catid=<factory>, order=<factory>, _ci_index=<factory>)[source]#
Bases:
objectA loaded UCS lookup: by CatID (exact + case-insensitive) and by synonym.
- by_catid#
CatID -> UcsRow(case-sensitive primary key).
- order#
The CatIDs in stable insertion order (deterministic tie-breaking).