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","."]
code: def get_metrics(self, reset=False):
      metric_dict = self.span_metric.get_metric(reset=reset)
      if self._verbose_metrics:
          return metric_dict
      else:
          return dict(
              (x, y)
              for x, y in list(metric_dict.items())
              if "overall" in x
          )
  
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 4 for calling the CrfTagger obj's underlying member method code with example usage: obj.get_metrics(reset) and returns: metric_dict, dict