Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
helpmefindaname committed Dec 6, 2024
1 parent 20895c4 commit 79287c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions flair/datasets/sequence_labeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 79287c3

Please sign in to comment.