Skip to content

Commit d0b846a

Browse files
committed
feat: add type hints for span partitioning functions in app_helper.py
1 parent 7b5a6e1 commit d0b846a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/app_helper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from functools import reduce
22
from collections import defaultdict
3+
from ne_span import NESpan
34

45

56
BATCH_SIZE = 150
@@ -35,7 +36,7 @@ def _get_linker_entities(text, ner_model, ref_part_model):
3536
return cit_spans, ref_parts, other_spans
3637

3738

38-
def _partition_spans(spans):
39+
def _partition_spans(spans: list[NESpan]):
3940
cit_spans, other_spans = [], []
4041
for span in spans:
4142
if LABEL2TYPE.get(span.label) == 'citation':
@@ -45,7 +46,7 @@ def _partition_spans(spans):
4546
return cit_spans, other_spans
4647

4748

48-
def _bulk_partition_spans(spans_list):
49+
def _bulk_partition_spans(spans_list: list[list[NESpan]]):
4950
cit_spans_list, other_spans_list = [], []
5051
for spans in spans_list:
5152
inner_cit_spans, inner_other_spans = _partition_spans(spans)

0 commit comments

Comments
 (0)