From 79287c3587085efb08e29a5e9f00e65567f2d64f Mon Sep 17 00:00:00 2001 From: Benedikt Fuchs Date: Fri, 6 Dec 2024 20:56:43 +0100 Subject: [PATCH] format code --- flair/datasets/sequence_labeling.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/flair/datasets/sequence_labeling.py b/flair/datasets/sequence_labeling.py index f13dc5c76..fa0962f2f 100644 --- a/flair/datasets/sequence_labeling.py +++ b/flair/datasets/sequence_labeling.py @@ -6,6 +6,8 @@ import gzip import shutil import tarfile +import tempfile +import zipfile from collections import defaultdict from collections.abc import Iterable, Iterator from pathlib import Path @@ -1566,9 +1568,11 @@ def extract_tokens(file_path: Path, output_path: Path): f_out.write("\n") def merge_annotations(tokens_file, annotations_file, output_file): - with open(tokens_file, encoding="utf-8") as tokens_file, open( - annotations_file, encoding="utf-8" - ) as annotations_file, open(output_file, "w", encoding="utf-8") as output_file: + with ( + open(tokens_file, encoding="utf-8") as tokens_file, + open(annotations_file, encoding="utf-8") as annotations_file, + open(output_file, "w", encoding="utf-8") as output_file, + ): tokens = tokens_file.readlines() annotations = annotations_file.readlines()