Skip to content

Commit a7f80c0

Browse files
committed
Update typing
1 parent 4d3660e commit a7f80c0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pythainlp/benchmarks/word_tokenization.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import re
44
import sys
5+
from typing import List, Tuple
56

67
import numpy as np
78
import pandas as pd
89

9-
1010
SEPARATOR = "|"
1111

1212
# regex for removing to a space surrounded by separators, i.e. | |
@@ -65,7 +65,7 @@ def _flatten_result(my_dict: dict, sep: str = ":") -> dict:
6565
return dict(items)
6666

6767

68-
def benchmark(ref_samples: list, samples: list):
68+
def benchmark(ref_samples: List[str], samples: List[str]) -> pandas.DataFrame:
6969
"""
7070
Performace benchmark of samples.
7171
@@ -264,8 +264,9 @@ def _find_word_boudaries(bin_reps) -> list:
264264

265265

266266
def _find_words_correctly_tokenised(
267-
ref_boundaries: list, predicted_boundaries: list
268-
) -> tuple:
267+
ref_boundaries: List[Tuple[int, int]],
268+
predicted_boundaries: List[Tuple[int, int]],
269+
) -> Tuple[int]:
269270
"""
270271
Find whether each word is correctly tokenized.
271272

0 commit comments

Comments
 (0)