diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-09-19 21:04:04 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-09-19 21:04:04 +0200 |
commit | 27acef8b998a8e8dff2c4258027cef779cefca77 (patch) | |
tree | 378e4c9d24dd49ccfce733b80b8457e6abe84072 /text_recognizer/data/iam_preprocessor.py | |
parent | 45c584098ce2e01741300cf92c21ece47f54fbe3 (diff) |
Linting of iam paragraphs and preprocessor
Diffstat (limited to 'text_recognizer/data/iam_preprocessor.py')
-rw-r--r-- | text_recognizer/data/iam_preprocessor.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/text_recognizer/data/iam_preprocessor.py b/text_recognizer/data/iam_preprocessor.py index bcd77b4..700944e 100644 --- a/text_recognizer/data/iam_preprocessor.py +++ b/text_recognizer/data/iam_preprocessor.py @@ -7,7 +7,7 @@ import collections import itertools from pathlib import Path import re -from typing import List, Optional, Union, Set +from typing import List, Optional, Set, Union import click from loguru import logger as log @@ -140,7 +140,7 @@ class Preprocessor: if self.special_tokens is not None: pattern = f"({'|'.join(self.special_tokens)})" lines = list(filter(None, re.split(pattern, line))) - return torch.cat([self._to_index(l) for l in lines]) + return torch.cat([self._to_index(line) for line in lines]) return self._to_index(line) def to_text(self, indices: List[int]) -> str: |