Skip to content

Commit

Permalink
Merge pull request #1806 from flairNLP/GH-1768-tokenizer-default
Browse files Browse the repository at this point in the history
GH-1768: turn on tokenizer by default in Sentence object
  • Loading branch information
alanakbik authored Aug 13, 2020
2 parents e5dde9c + c02aef4 commit 040d386
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flair/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ class Sentence(DataPoint):
def __init__(
self,
text: str = None,
use_tokenizer: Union[bool, Tokenizer] = False,
use_tokenizer: Union[bool, Tokenizer] = True,
language_code: str = None,
start_position: int = None
):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_create_sentence_on_empty_string():


def test_create_sentence_without_tokenizer():
sentence: Sentence = Sentence("I love Berlin.")
sentence: Sentence = Sentence("I love Berlin.", use_tokenizer=False)

assert 3 == len(sentence.tokens)
assert 0 == sentence.tokens[0].start_pos
Expand Down

0 comments on commit 040d386

Please sign in to comment.