Category is a util class that contains a label, its display name, a float value as score, and the
index of the label in the corresponding label file. Typically it’s used as the result of
classification tasks.
The display name of the label, which may be translated for different locales. For example, a
label, “apple”, may be translated into Spanish for display purpose, so that the display name is
“manzana”.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-05-08 UTC."],[],[],null,["# MediaPipeTasksText Framework Reference\n\nResultCategory\n==============\n\n class ResultCategory : NSObject\n\nCategory is a util class that contains a label, its display name, a float value as score, and the\nindex of the label in the corresponding label file. Typically it's used as the result of\nclassification tasks.\n- `\n ``\n ``\n `\n\n ### [index](#/c:objc(cs)MPPCategory(py)index)\n\n `\n ` \n The index of the label in the corresponding label file. Set to -1 if the index is\n not set. \n\n #### Declaration\n\n Swift \n\n var index: Int { get }\n\n- `\n ``\n ``\n `\n\n ### [score](#/c:objc(cs)MPPCategory(py)score)\n\n `\n ` \n Confidence score for this class. \n\n #### Declaration\n\n Swift \n\n var score: Float { get }\n\n- `\n ``\n ``\n `\n\n ### [categoryName](#/c:objc(cs)MPPCategory(py)categoryName)\n\n `\n ` \n The label of this category object. \n\n #### Declaration\n\n Swift \n\n var categoryName: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [displayName](#/c:objc(cs)MPPCategory(py)displayName)\n\n `\n ` \n The display name of the label, which may be translated for different locales. For example, a\n label, \"apple\", may be translated into Spanish for display purpose, so that the display name is\n \"manzana\". \n\n #### Declaration\n\n Swift \n\n var displayName: String? { get }\n\n- `\n ``\n ``\n `\n\n ### [init(index:score:categoryName:displayName:)](#/c:objc(cs)MPPCategory(im)initWithIndex:score:categoryName:displayName:)\n\n `\n ` \n Initializes a new `ResultCategory` with the given index, score, category name and display name. \n\n #### Declaration\n\n Swift \n\n init(index: Int, score: Float, categoryName: String?, displayName: String?)\n\n #### Parameters\n\n |----------------------|---------------------------------------------------------|\n | ` `*index*` ` | The index of the label in the corresponding label file. |\n | ` `*score*` ` | The probability score of this label category. |\n | ` `*categoryName*` ` | The label of this category object. |\n | ` `*displayName*` ` | The display name of the label. |\n\n #### Return Value\n\n An instance of `ResultCategory` initialized with the given index, score, category name\n and display name.\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)MPPCategory(im)init)\n\n `\n ` \n Undocumented\n- `\n ``\n ``\n `\n\n ### [+new](#/c:objc(cs)MPPCategory(cm)new)\n\n `\n ` \n Undocumented"]]