@@ -201,11 +201,18 @@ def test_batch_classification(self):
201201
202202 actual_categories .append (actual_category )
203203
204- if i < len (expected_categories ) and actual_category == expected_categories [i ]:
204+ if (
205+ i < len (expected_categories )
206+ and actual_category == expected_categories [i ]
207+ ):
205208 correct_classifications += 1
206209
207210 # Calculate accuracy
208- accuracy = (correct_classifications / len (expected_categories )) * 100 if expected_categories else 0
211+ accuracy = (
212+ (correct_classifications / len (expected_categories )) * 100
213+ if expected_categories
214+ else 0
215+ )
209216
210217 self .print_response_info (
211218 response ,
@@ -219,7 +226,9 @@ def test_batch_classification(self):
219226
220227 # Print detailed classification results
221228 print ("\n 📊 Detailed Classification Results:" )
222- for i , (text , expected , actual ) in enumerate (zip (texts , expected_categories , actual_categories )):
229+ for i , (text , expected , actual ) in enumerate (
230+ zip (texts , expected_categories , actual_categories )
231+ ):
223232 status = "✅" if expected == actual else "❌"
224233 print (f" { i + 1 } . { status } Expected: { expected :<15} | Actual: { actual :<15} " )
225234 print (f" Text: { text [:60 ]} ..." )
@@ -251,7 +260,7 @@ def test_batch_classification(self):
251260 accuracy ,
252261 accuracy_threshold ,
253262 f"Classification accuracy too low: { accuracy :.1f} % < { accuracy_threshold } %. "
254- f"Expected: { expected_categories } , Actual: { actual_categories } "
263+ f"Expected: { expected_categories } , Actual: { actual_categories } " ,
255264 )
256265
257266
0 commit comments