Skip to content

Commit

Permalink
make training code compatible with Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Jun 21, 2023
1 parent eec6ba9 commit 149447b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ingredient_extraction/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import html
import os
from pathlib import Path
from typing import Dict, List

import evaluate
import numpy as np
Expand Down Expand Up @@ -30,7 +31,7 @@
label_list = list(id2label.values())


def convert_pipeline_output_to_html(text: str, output: list[dict]):
def convert_pipeline_output_to_html(text: str, output: List[dict]):
html_str = ""
previous_idx = 0
for item in output:
Expand Down Expand Up @@ -157,7 +158,7 @@ def tokenize_and_align_labels(examples, tokenizer):


def display_labeled_sequence(
tokens: list[str], labels: list[int], id2label: dict[int, str]
tokens: List[str], labels: List[int], id2label: Dict[int, str]
):
assert len(tokens) == len(labels)
output = []
Expand Down

0 comments on commit 149447b

Please sign in to comment.