category#

(s3prl.dataio.encoder.category)

Simple categorical encoder

Authors:

Leo 2022

CategoryEncoder#

class s3prl.dataio.encoder.category.CategoryEncoder(category: List[str])[source][source]#

Bases: object

encode(label: str) int[source][source]#
decode(index: int) str[source][source]#

CategoryEncoders#

class s3prl.dataio.encoder.category.CategoryEncoders(categories: List[List[str]])[source][source]#

Bases: object

encode(labels: List[str]) List[int][source][source]#
decode(indices: List[int]) List[str][source][source]#