Adding and removing *labels* with fluid.labelset~ (for classification)

Basically I’m building a classifier, which I’ve discussed at length in this thread, and as part of the nice breakthrough I had yesterday I thought that it would be good to be able to update/replace the data for a single label. Like I do all my training for like 10 classes, but fuck up on the last one, or decide that I want to completely redo the 1st class, it would be nice to just replace that one individual label without having to redo everything.

I was pleased to see that this isn’t some crazy idea, and that fluid.labelset~ allows you to deletelabel. Hell, you can even getlabel!

However, unless there’s something that I’m completely missing here (this is obviously impossible), both of those messages instead refer to and impact the identifier. deletelabel deletes the corresponding identifier, leaving all of those labels intact, and if I want to iterate through the fluid.labelset~ manually with the getlabel, I’m instead get-ing identifiers.

Short of dumping it out to a dict or coll and manually parsing the whole labelset, it appears to be impossible to address the contents of fluid.labelset~ via a label.

Again, what I’d like to do in this use case is to completely re-do all of the entries for a specific label (e.g. “snare edge” or “oboe”).

Is this some kind of odd use case? What’s the intended approach here?

I guess I could keep a second labelset (via coll) for my fluid.labelset~ so I know what identifiers correspond with what labels, and then iterate through my labelset to delete things in my fluid.labelset~ but that starts getting a bit recursive.

6g0bsh

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

So on that note, how would one go about “removing all of a given label” in a fluid.labelset~?

And given how things are structured, how would then go about deleting the corresponding entries in a fluid.dataset~ as that seems like it would be even more complicated? (short of keeping a whole parallel data structure)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Here’s a code example:


----------begin_max5_patcher----------
1320.3ocyY00abhCE84Y9UXgz9R0TVai4q9z939eXypHOfmD2x.HvjlsUs+1
WaCzgogObXbnMnjHbb3x4368bO1yW2uy4XwyrZGvG.+CX2tute2N8PpA10c+
NmyzmSxn05o4jTb9LKW3bn8uIXOKziKdjAxnGYYf6bP24.30fL1IAnIWTzj7
HK8.flmB340BFMEnl963oxmD+DmU8tK+WorLlfk1GfLdNKoP9TTQA2MXdy4h
Fgbd52IX2n7T8aRwwO9dOu9++RpH4Qd9C2WwRDs.MLf3BO.PAgpeg8z+xyyE
B92KOedd+iGoF6a62q9wACY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gsyFe6QgzsQ39
RDe08lWYr9yAoOSX7yAAZdlfdF5co+SeBV5fpF+ZpotnoJo+0r+TiAWBTpbK
s7b8YnNbRwsSZT523HErUQhXRjTGi0fIUTkxpltuqogVc.gFG5aJRwlDH0aC
9VW2j44.jIQBYiHYDlt4bwHCvT+qyskK1tBLefrFjVh77sUfVBRHjshj2BQx
FBFgnecBFHCXS04pbyfr+gLejv1JRKUcEZi.gMYcyJPxD4VhkzKVh556usAM
IGOkGcSQ127.eaU0FDmnMS83sfIiLM8+5NyslFokkOwpp6lsNFRmyerP+dEc
PeKOu8V8FBbpXOw6mudWQNzJoyVgzVaSU6m6yyAsaTv4bgDg4M7NPJQmLjZW
4pOin5xtOAGs488ea++C2YCKa
-----------end_max5_patcher-----------

Are you asking for fluid.labelsetquery~?

I’d sooner shoot myself with an airsoft rifle than have to deal with SQL for this.

I think having having get/delete for labels and identifiers would be super handy. It can return a dict or something if list length is a concern.

Don’t know how you could then also remove the entries for a dataset as well, which is part of the same use case. Maybe the results of “detelelabel oboe” procures a dict of entries/identifiers that, if the same, can be used as a mask to remove them all from a dataset at the same time.

(on my phone at the moment otherwise I’d screenshot a pseudo code example but thinking “getlabel snare” → labelset → [prepend delete entries] → dataset)


----------begin_max5_patcher----------
879.3ocyX1saaBCEG+5jmBKztLKByWA5qxTUkAbScGXPfoKaUcO6y9XnocMP
LEyztAjMFN9m+eNGeLOuciSZ0IZqC5Fz2Pa1771MaftTcrou8FmRxorBRKLL
mRZaK4H0Ym9YB5IAzecCiKF5spSTPEheVS0eZGGzs8OhkCCuJ8wu56MLddWI
iKeCvDdm6T+cfdw88VSDYOv3GuqglIzeceW+8t6PAGTW88TW8jWQ2pdiW1tU
cY2BwKkLS37RrCbAAAZfbgaI6CW.cb5OjysO.2QhfNS5hrjz4GBhlKdE0tbp
blPKHozBzWvyDzP6BpOnlw9KBzQjwBVqXeaAKihlfxciQp+LH0aBRCheiCaD
dMHMmkI1yDzlYJl3KhHd1hoFQbbz47NqBhc7ZR12Q4DA4lYhpqcQMDbeSRVC
TajSEJJuqrd9ds3Dq50h8f3ynjUK9LqprlzP+DjFaIRSz6jDBtsG7WmTtSJl
WDuC1IQqW3aKFXUzw6K5X46g8SZoheiZEc2ee6mPQ8mQLp2UQVmMBiCVClqa
n0TdNRBL.9LEWKkM5fVOSfMURVVd2zNgnhOJGoD9wKxxqIbjgwjRYgEM2Q4j
zB3EcsSR23237FLb0lx4iUL97jPKEd1qfgAqW0rPZ1RwCH24GRFYmbruFDBA
lgGVup8xj9fJeuYSZnUIEGq2MIbMHUfXnzQIDN14DwqA1IIq1wEulGCCTzF5
QzwpJzjG3bLQ02thpNJMdUbe69EC44Nc52cmuqT4KVm6LH1ephh.RAwM.+ec
QC1zct+ToiUy.XeoaI+u+EQvGT0+6WGZq5ZxFHX3O7fbeEibZqfwIBlbe2yC
RUFDZr0ZSsj5b5Fao9AUxxqk6CJZGNBPfJp1OTe9UsKw6aEq+AEQdpAFOtGh
wy5HCl0CnsHKoN8v0sTzjqOI5rdwvs9UKn0RWERLQ6T.fWpk7McUvJVBaBSK
1GBaBSVIFy0DKgsg2pIdDCSmkYIizoDaXoC+qxEhMQmrgLYDQ1PkLxcvB1Iv
.6bvB1IxP6rzrPlroXjE3wjzpgVRetVvpUxzI+FdWwNAevN5xkH00OQaZ6GL
XBYAhOV0nZFuCZx35lPEoNMzmXCiG9ABNjFY8ZBYwZcMvzx4Tj9XLNkU4zFd
GCJ5aqBNoIghO4jRZaMQyATi51W19Gv170Um
-----------end_max5_patcher-----------
1 Like

Here it is updated to also delete the fluid.dataset~ entries at the same time:


----------begin_max5_patcher----------
1600.3oc0ZssbbhCD84weEplZ22bX0Mtkm1G2+gs1JECnwlDtLEnwwwoR91W
IALlwFFZCZHNlpbUHzPqSe4zsZz2uYy1ckOJp2h9H5eQa178a1rwLjdfMs2u
YadziwYQ0lossP70xced6sMORJdTZFNqLJYWTwccOn3Xd4QYlPZ9Uj1QSSLS
V8B9fqe2Talm7aGDMqisl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ZEJb7
ozwHyXC.4oqLDZEhDU0PJE.wKvgQ6Wg.UG4uZA4+kdS9XGvF8fkXyaRxQCbc
n8C04JdM950vr17+ZbCF19ymdqEzpT6T2dd5Jau+UnnncGkxxB371gy+Cw6E
1UxhFdc+eDBqSulJUgSRQ0mDEQ6xLxBaWRbEM9XD47A1qWvTD484ygvqS7Mo
nIpbW8pUwi4qxm4hsOu9X0pDmIhf2SX+Y1YzVmfAKUY8Bo6pSsWZr2dkpDr0
pTkGbdkpALcZMexpssuZSkp6068uQa7mIyJG+L+hPsw.C5VP7WuuTfN6tlmG
ivfywysVJ9FegPrCG2+OOM4vuUGkgEbRF57DFtOHugSxfYFlco+hSrlQn5wO
W0TWdrJtaY1c.rPOKnD0VZSKhjoprk8ljayjFT8CURLW.RR+Ml6Mo7zl.05t
tCvaNGL7.GuW+AmBF4YKbgqO8FStvMnaoRR+gW0ujokzRMFTHXxrbv1.SfL6
K1N4CPR7PKfI8gVa5fFhEjzKhGFQRmubJqRDUimx.rgycsXFzmJt0QcxAoNw
1fsCBuJy2FRxGBoA2FNi70BSfb6egC5I2d7xTmDHh1JtHfTm1vsO.BEL0BTv
9PTdjqAaEDt+.avUAGfKiox6WkljCfNoa0sL+eHA41f2hQg5+uXIgAn77skf
lj6vFPR2bWDcJIYC9PXjGrqAouteWH1Dh1FUNZDzTZSBwVRZxRcrASE.DQCr
EhlJ3hZEcGHOw.aIIBDIszTygPgDcoDFAugv3UHGI.BiltnDc3vChp51etQp
ayi9boY5A2ZtMsn4VSGx1VIdHsa9l1DtMpJ99ToHVdrp4fP7nWSmy1lWpDbw
wz1DzJ7pDooMU5CMQ8g1izfoaV27ia9e.xEv6dB
-----------end_max5_patcher-----------

Still need to manage an incremental counter externally to keep adding new (unused) identifiers to the parallel fluid.dataset~, but this should work alright.