class_docstr: Class for building label mappgings from a label set.
class_docstr_tok: ["Class","for","building","label","mappgings","from","a","label","set","."]
code: def __init__(self, all_labels=None):
      super(LabelModel, self).__init__()
      self.le = preprocessing.LabelEncoder()
      self.le.fit(list(all_labels))
      self.num_classes = len(self.le.classes_)
  
imports: import os
  import pickle
  from collections import OrderedDict
  import numpy
  import torch
  import torch.nn
  import yaml
  from scipy import sparse
  from sklearn import preprocessing
  from graph4nlp.pytorch.data.data import GraphData
label_desc: Use image node_id 1 to create a new LabelModel object from inherited base classes: object with example: obj = LabelModel(all_labels)