Fixes the failing test test_is_split_into_words in test_pipelines_token_classification.py (#39079)
* Fix test pipelines token classification for is_split_into_words * Fix incorrect import format
This commit is contained in:
@@ -328,8 +328,10 @@ class TokenClassificationPipelineTests(unittest.TestCase):
|
||||
self.assertEqual(
|
||||
nested_simplify(output),
|
||||
[
|
||||
{"entity_group": "PER", "score": ANY(float), "word": "Sarah", "start": 6, "end": 11},
|
||||
{"entity_group": "LOC", "score": ANY(float), "word": "New York", "start": 21, "end": 29},
|
||||
[
|
||||
{"entity_group": "PER", "score": ANY(float), "word": "Sarah", "start": 6, "end": 11},
|
||||
{"entity_group": "LOC", "score": ANY(float), "word": "New York", "start": 21, "end": 29},
|
||||
]
|
||||
],
|
||||
)
|
||||
|
||||
@@ -349,8 +351,8 @@ class TokenClassificationPipelineTests(unittest.TestCase):
|
||||
{"entity_group": "LOC", "score": ANY(float), "word": "New York", "start": 21, "end": 29},
|
||||
],
|
||||
[
|
||||
{"entity_group": "PER", "score": ANY(float), "word": "Wolfgang", "start": 12, "end": 20},
|
||||
{"entity_group": "LOC", "score": ANY(float), "word": "Berlin", "start": 36, "end": 42},
|
||||
{"entity_group": "PER", "score": ANY(float), "word": "Wolfgang", "start": 11, "end": 19},
|
||||
{"entity_group": "LOC", "score": ANY(float), "word": "Berlin", "start": 34, "end": 40},
|
||||
],
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user