class_docstr: This base class defines abstract methods for manipulating a State.
  
  Applying transitions may change important metadata about a State
  such as the vectors associated with LSTM hidden states, for example.
  
  The constructor forwards all unused arguments to other classes in the
  constructor sequence, so put this before other classes such as nn.Module
class_docstr_tok: ["This","base","class","defines","abstract","methods","for","manipulating","a","State",".","Applying","transitions","may","change","important","metadata","about","a","State","such","as","the","vectors","associated","with","LSTM","hidden","states",",","for","example",".","The","constructor","forwards","all","unused","arguments","to","other","classes","in","the","constructor","sequence",",","so","put","this","before","other","classes","such","as","nn.Module"]
docstr: Return a ParseResult for each tree in the trees list
  
  The transitions run will be the transitions represented by the tree
  The output layers will be available in result.state for each result
  
  keep_state=True as a default here as a method which keeps the grad
  is likely to want to keep the resulting state as well
docstr_tok: ["Return","a","ParseResult","for","each","tree","in","the","trees","list","The","transitions","run","will","be","the","transitions","represented","by","the","tree","The","output","layers","will","be","available","in","result.state","for","each","result","keep_state=True","as","a","default","here","as","a","method","which","keeps","the","grad","is","likely","to","want","to","keep","the","resulting","state","as","well"]
code: def analyze_trees(
      self,
      trees,
      batch_size=None,
      keep_state=True,
      keep_constituents=True,
      keep_scores=True,
  ):
      """
      Return a ParseResult for each tree in the trees list
  
      The transitions run will be the transitions represented by the tree
      The output layers will be available in result.state for each result
  
      keep_state=True as a default here as a method which keeps the grad
      is likely to want to keep the resulting state as well
      """
      if batch_size is None:
          # TODO: refactor?
          batch_size = self.args["eval_batch_size"]
      tree_iterator = iter(trees)
      treebank = self.parse_sentences(
          tree_iterator,
          self.build_batch_from_trees_with_gold_sequence,
          batch_size,
          self.predict_gold,
          keep_state,
          keep_constituents,
          keep_scores=keep_scores,
      )
      return treebank
  
imports: from abc import ABC, abstractmethod
  from collections import defaultdict
  import logging
  import torch
  from stanza.models.common import utils
  from stanza.models.constituency import parse_transitions
  from stanza.models.constituency import transition_sequence
  from stanza.models.constituency.parse_transitions import State, TransitionScheme, CloseConstituent
  from stanza.models.constituency.parse_tree import Tree
  from stanza.models.constituency.tree_stack import TreeStack
  from stanza.server.parser_eval import ParseResult, ScoredTree
label_desc: Use image node_id 30 for calling the BaseModel obj's underlying member method code with example usage: obj.analyze_trees(trees, batch_size, keep_state, keep_constituents, keep_scores) and returns: treebank