def get_all_tags(y_true):
    """
    Return a set of all tags excluding non-annotations (i.e. "_", "O", "-")

    :param list y_true: a nested list of labels with the structure "[docs [sents [tokens]]]".
    :return: set of all labels.
    :rtype: set
    """

    # keep only primary annotation when separated by a pipe
    tags = {label.split("|")[0].split("-")[-1] for doc in y_true for seg in doc for label in seg}

    non_tags = [
        "_",
        "-",
        "O",
    ]

    for symbol in non_tags:
        try:
            tags.remove(symbol)
        except KeyError:
            pass

    return tags