from typing import List


def get_labels(path:str) -> List[str]:
    """
        Get the defined labels in a list. If not defined, a default list of labels for NER is set
    """
    if path:
        with open(path, "r") as file:
            labels = file.read().splitlines()
        if "O" not in labels:
            # This label is indicating words outside entities to recognize and in this case has to be defined
            labels = ["O"] + labels
            
        return labels
    else:
        return ["O", "B-MISC", "I-MISC", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC", "B-GEO", "I-GEO"]