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).
Module Attributes
Subcategories that name no particular sound ( |
|
Categories whose rows are production bookkeeping ( |
Classes
|
AudioSet-label -> UCS-CatID overlap map (report 04 §5.3). |
|
The result of resolving free tags/caption/labels to a UCS CatID. |
|
Every field of a UCS filename ( |
|
One Universal Category System entry. |
|
A loaded UCS lookup by CatID: exact, case-insensitive, or a legacy CatID. |
- class foley.index.taxonomy.model.AudioSetUcsMap(by_name=dict(), by_mid=dict())[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=list())[source]#
Bases:
objectThe result of resolving free tags/caption/labels to a UCS CatID.
catidfeedsucs_categoryandsubcategoryfeedsucs_subcategoryon ingest, anducs_catidon the query side.
- foley.index.taxonomy.model.GENERIC_SUBCATEGORIES: frozenset = frozenset({'general', 'misc'})#
Subcategories that name no particular sound (
RAIN/GENERAL,AIR/MISC).
- foley.index.taxonomy.model.NON_SOUND_CATEGORIES: frozenset = frozenset({'ARCHIVED'})#
Categories whose rows are production bookkeeping (
TMARK,WIP,SCNE), not kinds of sound: a filename may name them, a tagger or keyword match never does.
- class foley.index.taxonomy.model.UcsName(catid, category, subcategory, fx_name=None, creator_id=None, source_id=None, user_category=None, vendor_category=None, user_data=None)[source]#
Bases:
objectEvery field of a UCS filename (
foley.index.taxonomy.ucs.parse_ucs_name).CatID[-UserCategory]_[VendorCategory-]FXName_CreatorID_SourceID[_UserData].ext: underscores separate the blocks; a hyphen attaches the optional UserCategory to the CatID and the optional VendorCategory to the FXName.categoryandsubcategorycome from the table row ofcatid; a block the name does not have isNone.
- class foley.index.taxonomy.model.UcsRow(catid, category, subcategory, synonyms=(), confident=False, explanation='')[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 unverified row (a house drop’s); the keyword resolver bands its matches one notch lower.
- class foley.index.taxonomy.model.UcsTable(by_catid=dict(), order=list(), _ci_index=dict(), legacy=dict())[source]#
Bases:
objectA loaded UCS lookup by CatID: exact, case-insensitive, or a legacy CatID.
Plain data, compared by identity (a matcher caches its index per table).
- legacy#
lower(old CatID) -> CatIDfor CatIDs foley once stamped that are not UCS (weathrain->RAIN), so a stored record still finds its row.