class_docstr: Implements a cache + dynamic programming to find the relative depth of every word in a subphrase given the head word for every word.
docstr: Return the relative depth for every word
  
  Args:
      heads (list): List where each entry is the index of that entry's head word in the dependency parse
      start (int): starting index of the heads for the subphrase
      end (int): ending index of the heads for the subphrase
  
  Returns:
      list: Relative depth in the dependency parse for every word
docstr_tok: ["Return","the","relative","depth","for","every","word","Args",":","heads","(","list",")",":","List","where","each","entry","is","the","index","of","that","entry","'s","head","word","in","the","dependency","parse","start","(","int",")",":","starting","index","of","the","heads","for","the","subphrase","end","(","int",")",":","ending","index","of","the","heads","for","the","subphrase","Returns",":","list",":","Relative","depth","in","the","dependency","parse","for","every","word"]
code: def get_parse_depths(self, heads, start, end):
      """Return the relative depth for every word
  
      Args:
          heads (list): List where each entry is the index of that entry's head word in the dependency parse
          start (int): starting index of the heads for the subphrase
          end (int): ending index of the heads for the subphrase
  
      Returns:
          list: Relative depth in the dependency parse for every word
      """
      self.heads = heads[start:end]
      self.relative_heads = [
          h - start if h else -100 for h in self.heads
      ]  # -100 to deal with 'none' headwords
  
      depths = [
          self._get_depth_recursive(h)
          for h in range(len(self.relative_heads))
      ]
  
      return depths
  
file_path: stanza/stanza/utils/datasets/coref/convert_ontonotes.py
imports: from collections import defaultdict
  from functools import lru_cache
  import json
  import os
  import stanza
  from stanza.models.constituency import tree_reader
  from stanza.utils.default_paths import get_default_paths
  from stanza.utils.get_tqdm import get_tqdm
label_desc: Use image node_id 1 for calling the DynamicDepth obj's underlying member method code with example usage: obj.get_parse_depths(heads, start, end) and returns: depths