File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ def test_document_classifier_details(document_classifier):
2929 results = document_classifier .predict (documents = docs )
3030 for doc in results :
3131 assert "details" in doc .meta ["classification" ]
32- assert len (doc .meta ["classification" ]["details" ]) == 2 # top_k = 2
32+ if document_classifier .top_k is not None :
33+ assert len (doc .meta ["classification" ]["details" ]) == document_classifier .top_k
3334
3435
3536@pytest .mark .integration
@@ -82,7 +83,7 @@ def test_zero_shot_document_classifier_details(zero_shot_document_classifier):
8283 results = zero_shot_document_classifier .predict (documents = docs )
8384 for doc in results :
8485 assert "details" in doc .meta ["classification" ]
85- assert len (doc .meta ["classification" ]["details" ]) == 2 # n_labels = 2
86+ assert set (doc .meta ["classification" ]["details" ]. keys ()) == set ( zero_shot_document_classifier . labels )
8687
8788
8889@pytest .mark .integration
You can’t perform that action at this time.
0 commit comments