def get_type(attributes):
    """ Compute mention type.

    Args:
        attributes (dict(str, object)): Attributes of the mention, must contain
            values for "pos", "ner" and "head_index".

    Returns:
        str: The mention type, one of NAM (proper name), NOM (common noun),
        PRO (pronoun), DEM (demonstrative pronoun) and VRB (verb).
    """
    pos = attributes["pos"][attributes["head_index"]]
    head_ner = attributes["ner"][attributes["head_index"]]

    if pos.startswith("NNP"):
        return "NAM"
    elif head_ner != "NONE":
        return "NAM"
    elif pos.startswith("PRP"):
        return "PRO"
    elif pos.startswith("DT"):
        return "DEM"
    elif pos.startswith("VB"):
        return "VRB"
    elif pos.startswith("NN"):
        return "NOM"
    else:
        return "NOM"