Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/app_helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from functools import reduce
from collections import defaultdict
from ne_span import NESpan


BATCH_SIZE = 150
Expand Down Expand Up @@ -35,7 +36,7 @@ def _get_linker_entities(text, ner_model, ref_part_model):
return cit_spans, ref_parts, other_spans


def _partition_spans(spans):
def _partition_spans(spans: list[NESpan]):
cit_spans, other_spans = [], []
for span in spans:
if LABEL2TYPE.get(span.label) == 'citation':
Expand All @@ -45,7 +46,7 @@ def _partition_spans(spans):
return cit_spans, other_spans


def _bulk_partition_spans(spans_list):
def _bulk_partition_spans(spans_list: list[list[NESpan]]):
cit_spans_list, other_spans_list = [], []
for spans in spans_list:
inner_cit_spans, inner_other_spans = _partition_spans(spans)
Expand Down