|
5 | 5 | from builtins import range
|
6 | 6 | from collections import defaultdict
|
7 | 7 | from functools import lru_cache
|
8 |
| -from typing import DefaultDict, Iterator, List, Set, Union |
| 8 | +from typing import Any, DefaultDict, Iterator, List, Set, Union |
9 | 9 |
|
10 | 10 | from fonduer.candidates.mentions import Ngrams
|
11 | 11 | from fonduer.candidates.models import Candidate, Mention
|
@@ -421,10 +421,10 @@ def _preprocess_visual_features(doc: Document) -> None:
|
421 | 421 |
|
422 | 422 | for page, sentences in sentence_by_page.items():
|
423 | 423 | # process per page alignments
|
424 |
| - yc_aligned: DefaultDict[int, List[Sentence]] = defaultdict(list) |
425 |
| - x0_aligned: DefaultDict[int, List[Sentence]] = defaultdict(list) |
426 |
| - xc_aligned: DefaultDict[int, List[Sentence]] = defaultdict(list) |
427 |
| - x1_aligned: DefaultDict[int, List[Sentence]] = defaultdict(list) |
| 424 | + yc_aligned: DefaultDict[Any, List[Sentence]] = defaultdict(list) |
| 425 | + x0_aligned: DefaultDict[Any, List[Sentence]] = defaultdict(list) |
| 426 | + xc_aligned: DefaultDict[Any, List[Sentence]] = defaultdict(list) |
| 427 | + x1_aligned: DefaultDict[Any, List[Sentence]] = defaultdict(list) |
428 | 428 | for sentence in sentences:
|
429 | 429 | sentence.bbox = sentence.get_bbox()
|
430 | 430 | sentence.yc = (sentence.bbox.top + sentence.bbox.bottom) / 2
|
|
0 commit comments