from typing import Set


def read_labels(ann_conf: str) -> Set[str]:
    """
    Reads the entity labels from annotation.conf.

    param ann_conf: Path to annotation.conf
    returns: set of entity labels.
    """
    labels = set()
    with open(ann_conf, 'r') as infile:
        copy = False
        for line in infile:
            # Skip blank lines and comments.
            if not line.strip() or line.strip().startswith('#'):
                continue
            if line.strip() == "[entities]":
                copy = True
            elif line.strip() == "[relations]":
                copy = False
            elif copy is True:
                labels.add(line.strip())
    return labels