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: Recursively get the depths of every index using a cache and recursion
  
  Args:
      index (int): Index of the word for which to calculate the relative depth
  
  Returns:
      int: Relative depth of the word at the index
docstr_tok: ["Recursively","get","the","depths","of","every","index","using","a","cache","and","recursion","Args",":","index","(","int",")",":","Index","of","the","word","for","which","to","calculate","the","relative","depth","Returns",":","int",":","Relative","depth","of","the","word","at","the","index"]
code: def _get_depth_recursive(self, index):
      """Recursively get the depths of every index using a cache and recursion
  
      Args:
          index (int): Index of the word for which to calculate the relative depth
  
      Returns:
          int: Relative depth of the word at the index
      """
      # if the head for the current index is outside the scope, this index is a relative root
      if (
          self.relative_heads[index] >= len(self.relative_heads)
          or self.relative_heads[index] < 0
      ):
          return 0
      return self._get_depth_recursive(self.relative_heads[index]) + 1
  
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 2 for calling the DynamicDepth obj's underlying member method code with example usage: obj._get_depth_recursive(index) and returns: unknown, int