Add sudachi_projection option to BertJapaneseTokenizer (#28503)
* add sudachi_projection option * Upgrade sudachipy>=0.6.8 * add a test case for sudachi_projection * Compatible with older versions of SudachiPy * make fixup * make style * error message for unidic download * revert jumanpp test cases * format options for sudachi_projection Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * format options for sudachi_split_mode and sudachi_dict_type * comment * add tests for full_tokenizer kwargs * pass projection arg directly * require_sudachi_projection * make style * revert upgrade sudachipy * check is_sudachi_projection_available() * revert dependency_version_table and bugfix * style format * simply raise ImportError Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com> * simply raise ImportError --------- Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
This commit is contained in:
@@ -95,6 +95,7 @@ from .utils import (
|
||||
is_soundfile_availble,
|
||||
is_spacy_available,
|
||||
is_sudachi_available,
|
||||
is_sudachi_projection_available,
|
||||
is_tensorflow_probability_available,
|
||||
is_tensorflow_text_available,
|
||||
is_tf2onnx_available,
|
||||
@@ -1043,6 +1044,15 @@ def require_sudachi(test_case):
|
||||
return unittest.skipUnless(is_sudachi_available(), "test requires sudachi")(test_case)
|
||||
|
||||
|
||||
def require_sudachi_projection(test_case):
|
||||
"""
|
||||
Decorator marking a test that requires sudachi_projection
|
||||
"""
|
||||
return unittest.skipUnless(is_sudachi_projection_available(), "test requires sudachi which supports projection")(
|
||||
test_case
|
||||
)
|
||||
|
||||
|
||||
def require_jumanpp(test_case):
|
||||
"""
|
||||
Decorator marking a test that requires jumanpp
|
||||
|
||||
Reference in New Issue
Block a user