Skip to content

Commit

Permalink
Make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
alanakbik committed Dec 17, 2023
1 parent d0441d7 commit f180771
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions flair/datasets/document_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,11 +965,10 @@ def __init__(
label, title, description = row
# Original labels are [1, 2, 3, 4] -> ['World', 'Sports', 'Business', 'Sci/Tech']
# Re-map to [0, 1, 2, 3].
label = int(label) - 1
text = " ".join((title, description))

new_label = "__label__"
new_label += label_dict[label]
new_label += label_dict[int(label) - 1]

write_fp.write(f"{new_label} {text}\n")

Expand Down

0 comments on commit f180771

Please sign in to comment.