class_docstr: The ``CrfTagger`` encodes a sequence of text with a ``Seq2SeqEncoder``,
  then uses a Conditional Random Field model to predict a tag for each token in the sequence.
  
  Parameters
  ----------
  vocab : ``Vocabulary``, required
      A Vocabulary, required in order to compute sizes for input/output projections.
  text_field_embedder : ``TextFieldEmbedder``, required
      Used to embed the tokens ``TextField`` we get as input to the model.
  encoder : ``Seq2SeqEncoder``
      The encoder that we will use in between embedding tokens and predicting output tags.
  label_namespace : ``str``, optional (default=``labels``)
      This is needed to compute the SpanBasedF1Measure metric.
      Unless you did something unusual, the default value should be what you want.
  feedforward : ``FeedForward``, optional, (default = None).
      An optional feedforward layer to apply after the encoder.
  dropout:  ``float``, optional (detault=``None``)
  verbose_metrics : ``bool``, optional (default = False)
      If true, metrics will be returned per label class in addition
      to the overall statistics.
  constraint_type : ``str``, optional (default=``None``)
      If provided, the CRF will be constrained at decoding time
      to produce valid labels based on the specified type (e.g. "BIO", or "BIOUL").
  include_start_end_transitions : ``bool``, optional (default=``True``)
      Whether to include start and end transition parameters in the CRF.
  initializer : ``InitializerApplicator``, optional (default=``InitializerApplicator()``)
      Used to initialize the model parameters.
  regularizer : ``RegularizerApplicator``, optional (default=``None``)
      If provided, will be used to calculate the regularization penalty during training.
class_docstr_tok: ["The","``","CrfTagger","``","encodes","a","sequence","of","text","with","a","``","Seq2SeqEncoder","``",",","then","uses","a","Conditional","Random","Field","model","to","predict","a","tag","for","each","token","in","the","sequence",".","Parameters","--","--","--","--","--","vocab",":","``","Vocabulary","``",",","required","A","Vocabulary",",","required","in","order","to","compute","sizes","for","input\/output","projections",".","text_field_embedder",":","``","TextFieldEmbedder","``",",","required","Used","to","embed","the","tokens","``","TextField","``","we","get","as","input","to","the","model",".","encoder",":","``","Seq2SeqEncoder","``","The","encoder","that","we","will","use","in","between","embedding","tokens","and","predicting","output","tags",".","label_namespace",":","``","str","``",",","optional","(","default=","``","labels","``",")","This","is","needed","to","compute","the","SpanBasedF1Measure","metric",".","Unless","you","did","something","unusual",",","the","default","value","should","be","what","you","want",".","feedforward",":","``","FeedForward","``",",","optional",",","(","default","=","None",")",".","An","optional","feedforward","layer","to","apply","after","the","encoder",".","dropout",":","``","float","``",",","optional","(","detault=","``","None","``",")","verbose_metrics",":","``","bool","``",",","optional","(","default","=","False",")","If","true",",","metrics","will","be","returned","per","label","class","in","addition","to","the","overall","statistics",".","constraint_type",":","``","str","``",",","optional","(","default=","``","None","``",")","If","provided",",","the","CRF","will","be","constrained","at","decoding","time","to","produce","valid","labels","based","on","the","specified","type","(","e.g",".","``","BIO","''",",","or","``","BIOUL","''",")",".","include_start_end_transitions",":","``","bool","``",",","optional","(","default=","``","True","``",")","Whether","to","include","start","and","end","transition","parameters","in","the","CRF",".","initializer",":","``","InitializerApplicator","``",",","optional","(","default=","``","InitializerApplicator","(",")","``",")","Used","to","initialize","the","model","parameters",".","regularizer",":","``","RegularizerApplicator","``",",","optional","(","default=","``","None","``",")","If","provided",",","will","be","used","to","calculate","the","regularization","penalty","during","training","."]
docstr: Converts the tag ids to the actual tags.
  ``output_dict["tags"]`` is a list of lists of tag_ids,
  so we use an ugly nested list comprehension.
docstr_tok: ["Converts","the","tag","ids","to","the","actual","tags",".","``","output_dict","[","``","tags","''","]","``","is","a","list","of","lists","of","tag_ids",",","so","we","use","an","ugly","nested","list","comprehension","."]
code: def decode(self, output_dict):
      """
      Converts the tag ids to the actual tags.
      ``output_dict["tags"]`` is a list of lists of tag_ids,
      so we use an ugly nested list comprehension.
      """
      output_dict["tags"] = [
          [
              self.vocab.get_token_from_index(
                  tag, namespace=self.label_namespace
              )
              for tag in instance_tags
          ]
          for instance_tags in output_dict["tags"]
      ]
  
      return output_dict
  
file_path: magnitude/pymagnitude/third_party/allennlp/models/crf_tagger.py
imports: from __future__ import absolute_import
  import torch
  from torch.nn.modules.linear import Linear
  from allennlp.common.checks import check_dimensions_match
  from allennlp.data import Vocabulary
  from allennlp.modules import Seq2SeqEncoder, TimeDistributed, TextFieldEmbedder
  from allennlp.modules import ConditionalRandomField, FeedForward
  from allennlp.modules.conditional_random_field import allowed_transitions
  from allennlp.models.model import Model
  from allennlp.nn import InitializerApplicator, RegularizerApplicator
  import allennlp.nn.util
  from allennlp.training.metrics import SpanBasedF1Measure
label_desc: Use image node_id 3 for calling the CrfTagger obj's underlying member method code with example usage: obj.decode(output_dict) and returns: output_dict