class_docstr: Produces labels for a group relation model.
  
  Labels are of shape [n_groups, seq_len], where each element is a 0 or 1 and
  represents whether a token belongs to a certain group, and where the last
  group represents the pad group
class_docstr_tok: ["Produces","labels","for","a","group","relation","model",".","Labels","are","of","shape","[","n_groups",",","seq_len","]",",","where","each","element","is","a","0","or","1","and","represents","whether","a","token","belongs","to","a","certain","group",",","and","where","the","last","group","represents","the","pad","group"]
code: def fit(self, labels):
      # PAD and GROUP represent tokens in the pad group and all other tokens
      # PAD and GROUP only matter when class weights are being used - see
      # GroupRelationsPipeline and util.imabalance.class_weight_tensor
      # Note: This means finetune's n_targets count used elsewhere is broken
      self.classes_ = ["GROUP", "PAD"]
      self.lookup = {c: i for i, c in enumerate(self.classes_)}
  
imports: from abc import ABCMeta
  import logging
  import json
  import numpy
  from finetune.encoding.target_encoders import BaseEncoder, Seq2SeqLabelEncoder, SequenceLabelingEncoder
label_desc: Use image node_id 2 for calling the GroupRelationEncoder obj's underlying member method code with example usage: obj.fit(labels) without return types