Skip to content

Commit a11f692

Browse files
authored
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
1 parent 18143c7 commit a11f692

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/pipelines/test_pipelines_token_classification.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,10 @@ def test_is_split_into_words(self):
328328
self.assertEqual(
329329
nested_simplify(output),
330330
[
331-
{"entity_group": "PER", "score": ANY(float), "word": "Sarah", "start": 6, "end": 11},
332-
{"entity_group": "LOC", "score": ANY(float), "word": "New York", "start": 21, "end": 29},
331+
[
332+
{"entity_group": "PER", "score": ANY(float), "word": "Sarah", "start": 6, "end": 11},
333+
{"entity_group": "LOC", "score": ANY(float), "word": "New York", "start": 21, "end": 29},
334+
]
333335
],
334336
)
335337

@@ -349,8 +351,8 @@ def test_is_split_into_words(self):
349351
{"entity_group": "LOC", "score": ANY(float), "word": "New York", "start": 21, "end": 29},
350352
],
351353
[
352-
{"entity_group": "PER", "score": ANY(float), "word": "Wolfgang", "start": 12, "end": 20},
353-
{"entity_group": "LOC", "score": ANY(float), "word": "Berlin", "start": 36, "end": 42},
354+
{"entity_group": "PER", "score": ANY(float), "word": "Wolfgang", "start": 11, "end": 19},
355+
{"entity_group": "LOC", "score": ANY(float), "word": "Berlin", "start": 34, "end": 40},
354356
],
355357
],
356358
)

0 commit comments

Comments
 (0)