class_docstr: A ``MultiLabelField`` is an extension of the :class:`LabelField` that allows for multiple labels.
  It is particularly useful in multi-label classification where more than one label can be correct.
  As with the :class:`LabelField`, labels are either strings of text or 0-indexed integers (if you wish
  to skip indexing by passing skip_indexing=True).
  If the labels need indexing, we will use a :class:`Vocabulary` to convert the string labels
  into integers.
  
  This field will get converted into a vector of length equal to the vocabulary size with
  one hot encoding for the labels (all zeros, and ones for the labels).
  
  Parameters
  ----------
  labels : ``Sequence[Union[str, int]]``
  label_namespace : ``str``, optional (default="labels")
      The namespace to use for converting label strings into integers.  We map label strings to
      integers for you (e.g., "entailment" and "contradiction" get converted to 0, 1, ...),
      and this namespace tells the ``Vocabulary`` object which mapping from strings to integers
      to use (so "entailment" as a label doesn't get the same integer id as "entailment" as a
      word).  If you have multiple different label fields in your data, you should make sure you
      use different namespaces for each one, always using the suffix "labels" (e.g.,
      "passage_labels" and "question_labels").
  skip_indexing : ``bool``, optional (default=False)
      If your labels are 0-indexed integers, you can pass in this flag, and we'll skip the indexing
      step.  If this is ``False`` and your labels are not strings, this throws a ``ConfigurationError``.
  num_labels : ``int``, optional (default=None)
      If ``skip_indexing=True``, the total number of possible labels should be provided, which is required
      to decide the size of the output tensor. `num_labels` should equal largest label id + 1.
      If ``skip_indexing=False``, `num_labels` is not required.
class_docstr_tok: ["A","``","MultiLabelField","``","is","an","extension","of","the",":","class",":","`","LabelField","`","that","allows","for","multiple","labels",".","It","is","particularly","useful","in","multi-label","classification","where","more","than","one","label","can","be","correct",".","As","with","the",":","class",":","`","LabelField","`",",","labels","are","either","strings","of","text","or","0-indexed","integers","(","if","you","wish","to","skip","indexing","by","passing","skip_indexing=True",")",".","If","the","labels","need","indexing",",","we","will","use","a",":","class",":","`","Vocabulary","`","to","convert","the","string","labels","into","integers",".","This","field","will","get","converted","into","a","vector","of","length","equal","to","the","vocabulary","size","with","one","hot","encoding","for","the","labels","(","all","zeros",",","and","ones","for","the","labels",")",".","Parameters","--","--","--","--","--","labels",":","``","Sequence","[","Union","[","str",",","int","]","]","``","label_namespace",":","``","str","``",",","optional","(","default=","''","labels","''",")","The","namespace","to","use","for","converting","label","strings","into","integers",".","We","map","label","strings","to","integers","for","you","(","e.g.",",","``","entailment","''","and","``","contradiction","''","get","converted","to","0",",","1",",","...",")",",","and","this","namespace","tells","the","``","Vocabulary","``","object","which","mapping","from","strings","to","integers","to","use","(","so","``","entailment","''","as","a","label","does","n't","get","the","same","integer","id","as","``","entailment","''","as","a","word",")",".","If","you","have","multiple","different","label","fields","in","your","data",",","you","should","make","sure","you","use","different","namespaces","for","each","one",",","always","using","the","suffix","``","labels","''","(","e.g.",",","``","passage_labels","''","and","``","question_labels","''",")",".","skip_indexing",":","``","bool","``",",","optional","(","default=False",")","If","your","labels","are","0-indexed","integers",",","you","can","pass","in","this","flag",",","and","we","'ll","skip","the","indexing","step",".","If","this","is","``","False","``","and","your","labels","are","not","strings",",","this","throws","a","``","ConfigurationError","``",".","num_labels",":","``","int","``",",","optional","(","default=None",")","If","``","skip_indexing=True","``",",","the","total","number","of","possible","labels","should","be","provided",",","which","is","required","to","decide","the","size","of","the","output","tensor",".","`","num_labels","`","should","equal","largest","label","id","+","1",".","If","``","skip_indexing=False","``",",","`","num_labels","`","is","not","required","."]
code: def count_vocab_items(self, counter):
      if self._label_ids is None:
          for label in self.labels:
              counter[self._label_namespace][label] += 1
  
file_path: magnitude/pymagnitude/third_party/allennlp/data/fields/multilabel_field.py
imports: from __future__ import absolute_import
  import logging
  import torch
  from allennlp.data.fields.field import Field
  from allennlp.data.vocabulary import Vocabulary
  from allennlp.common.checks import ConfigurationError
label_desc: Use image node_id 3 for calling the MultiLabelField obj's underlying member method code with example usage: obj.count_vocab_items(counter) without return types