Skip to content

Commit

Permalink
Merge pull request #1678 from tirkarthi/fix-warnings
Browse files Browse the repository at this point in the history
Fix deprecation warnings due to invalid escape sequences.
  • Loading branch information
alanakbik authored Jun 8, 2020
2 parents 1a34abd + 8996e4f commit a5d2ffc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion flair/data_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ def read_column_data(
sentence: Sentence = Sentence()

else:
fields: List[str] = re.split("\s+", line)
fields: List[str] = re.split(r"\s+", line)
token = Token(fields[text_column])
for column in column_name_map:
if len(fields) > column:
Expand Down
4 changes: 2 additions & 2 deletions flair/datasets/sequence_labeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(
test_file=None,
dev_file=None,
tag_to_bioes=None,
column_delimiter: str = "\s+",
column_delimiter: str = r"\s+",
comment_symbol: str = None,
encoding: str = "utf-8",
document_separator_token: str = None,
Expand Down Expand Up @@ -103,7 +103,7 @@ def __init__(
path_to_column_file: Union[str, Path],
column_name_map: Dict[int, str],
tag_to_bioes: str = None,
column_delimiter: str = "\s+",
column_delimiter: str = r"\s+",
comment_symbol: str = None,
in_memory: bool = True,
document_separator_token: str = None,
Expand Down
4 changes: 2 additions & 2 deletions flair/trainers/language_model_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ def charsplit(
@staticmethod
def random_casechange(line: str) -> str:
no = random.randint(0, 99)
if no is 0:
if no == 0:
line = line.lower()
if no is 1:
if no == 1:
line = line.upper()
return line

Expand Down

0 comments on commit a5d2ffc

Please sign in to comment.