-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding sentence/period change warning
- Loading branch information
1 parent
75952d4
commit ec03550
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# SPDX-FileCopyrightText: 2022-present deepset GmbH <[email protected]> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import warnings | ||
from copy import deepcopy | ||
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple | ||
|
||
|
@@ -116,6 +116,14 @@ def __init__( # pylint: disable=too-many-positional-arguments | |
keep_white_spaces=True, | ||
) | ||
|
||
if split_by == "sentence": | ||
# ToDo: remove this warning in the next major release | ||
msg = ( | ||
"The `split_by='sentence'` no longer splits by '.' and now relies on custom sentence tokenizer " | ||
"based on NLTK. To achieve the previous behaviour `split_by='period'." | ||
) | ||
warnings.warn(msg, DeprecationWarning) | ||
|
||
def _init_checks( | ||
self, | ||
*, | ||
|