| | |
| | | from ner_config import RepaymentNERConfig |
| | | from ner_config import RepaymentNERConfig, FlightNERConfig, TrainNERConfig |
| | | |
| | | |
| | | # 脚本:校验非法格式 |
| | | |
| | |
| | | label_set = set() |
| | | line_num = 0 |
| | | |
| | | with open(RepaymentNERConfig.DATA_PATH, 'r', encoding='utf-8') as f: |
| | | with open(FlightNERConfig.DATA_PATH, 'r', encoding='utf-8') as f: |
| | | for line in f: |
| | | line_num += 1 |
| | | line = line.strip() |
| | | if line: |
| | | try: |
| | | _, label = line.split(maxsplit=1) |
| | | if label not in RepaymentNERConfig.LABELS: |
| | | if label not in FlightNERConfig.LABELS: |
| | | print(f"行 {line_num}: 发现非法标签 '{label}'") |
| | | label_set.add(label) |
| | | except Exception as e: |