(path: str)
| 388 | |
| 389 | |
| 390 | def get_labels(path: str) -> List[str]: |
| 391 | if path: |
| 392 | with open(path, "r") as f: |
| 393 | labels = f.read().splitlines() |
| 394 | if "O" not in labels: |
| 395 | labels = ["O"] + labels |
| 396 | return labels |
| 397 | else: |
| 398 | return ["O", "B-MISC", "I-MISC", "B-PER", "I-PER", "B-ORG", "I-ORG", "B-LOC", "I-LOC"] |