def get_word_depth(index, doc):
    """Get word depth in the parse tree given a sentence and token index.

    The ``ROOT`` of the sentence is considered level 1. This method traverses
    the parse tree until reaching the ``ROOT``, and counts all levels
    traversed.

    :param index: Position of the token in the sentence
    :type index: int
    :param doc: Tokenized text
    :type doc: Spacy Doc
    :return: Depth of the of the token
    :rtype: int
    """
    token = doc[index]
    token_parent = doc[index].head
    depth = 1
    while token != token_parent:
        token = token.head
        token_parent = token_parent.head
        depth += 1
    return depth