Skip to content

Conversation

yossiovadia
Copy link
Collaborator

Problem Fixed:
The original test_batch_classification method had a critical flaw - it only validated HTTP status (200) and result count, but never checked if the classifications were actually correct. The
expected_categories variable was created but never used for validation.

What We Added:

  1. Actual Accuracy Validation
    - Extract actual categories from each classification result
    - Compare against expected categories: ["math", "computer science", "business", "history"]
    - Calculate accuracy percentage and assert ≥75% threshold

Previously, the batch classification test only validated HTTP status
and result count, but never checked if the classifications were correct.
The expected_categories variable was created but never used for validation.

Changes:
- Extract actual categories from batch classification results
- Compare against expected categories and calculate accuracy percentage
- Add detailed output showing each classification result
- Assert that accuracy meets 75% threshold
- Maintain backward compatibility with existing HTTP/count checks

This improved test now properly catches classification accuracy issues
and will fail when the classification system returns incorrect results,
exposing problems that were previously hidden.

Related to issue vllm-project#318: Batch Classification API Returns Incorrect Categories

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
Automatic formatting applied by black pre-commit hook.

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
@yossiovadia yossiovadia requested a review from rootfs as a code owner October 2, 2025 16:57
Copy link

netlify bot commented Oct 2, 2025

Deploy Preview for vllm-semantic-router ready!

Name Link
🔨 Latest commit 3c9d3e5
🔍 Latest deploy log https://app.netlify.com/projects/vllm-semantic-router/deploys/68deaf12d8be00000836549d
😎 Deploy Preview https://deploy-preview-319--vllm-semantic-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

github-actions bot commented Oct 2, 2025

👥 vLLM Semantic Team Notification

The following members have been identified for the changed files in this PR and have been automatically assigned:

📁 e2e-tests

Owners: @yossiovadia
Files changed:

  • e2e-tests/03-classification-api-test.py

vLLM

🎉 Thanks for your contributions!

This comment was automatically generated based on the OWNER files in the repository.

@rootfs rootfs merged commit 7ee1054 into vllm-project:main Oct 2, 2025
9 checks passed
Aias00 pushed a commit to Aias00/semantic-router that referenced this pull request Oct 4, 2025
* feat: improve batch classification test to validate accuracy

Previously, the batch classification test only validated HTTP status
and result count, but never checked if the classifications were correct.
The expected_categories variable was created but never used for validation.

Changes:
- Extract actual categories from batch classification results
- Compare against expected categories and calculate accuracy percentage
- Add detailed output showing each classification result
- Assert that accuracy meets 75% threshold
- Maintain backward compatibility with existing HTTP/count checks

This improved test now properly catches classification accuracy issues
and will fail when the classification system returns incorrect results,
exposing problems that were previously hidden.

Related to issue vllm-project#318: Batch Classification API Returns Incorrect Categories

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>

* style: apply black formatting to classification test

Automatic formatting applied by black pre-commit hook.

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>

---------

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
Signed-off-by: liuhy <liuhongyu@apache.org>
Aias00 pushed a commit to Aias00/semantic-router that referenced this pull request Oct 4, 2025
* feat: improve batch classification test to validate accuracy

Previously, the batch classification test only validated HTTP status
and result count, but never checked if the classifications were correct.
The expected_categories variable was created but never used for validation.

Changes:
- Extract actual categories from batch classification results
- Compare against expected categories and calculate accuracy percentage
- Add detailed output showing each classification result
- Assert that accuracy meets 75% threshold
- Maintain backward compatibility with existing HTTP/count checks

This improved test now properly catches classification accuracy issues
and will fail when the classification system returns incorrect results,
exposing problems that were previously hidden.

Related to issue vllm-project#318: Batch Classification API Returns Incorrect Categories

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>

* style: apply black formatting to classification test

Automatic formatting applied by black pre-commit hook.

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>

---------

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
Signed-off-by: liuhy <liuhongyu@apache.org>
Aias00 pushed a commit to Aias00/semantic-router that referenced this pull request Oct 4, 2025
* feat: improve batch classification test to validate accuracy

Previously, the batch classification test only validated HTTP status
and result count, but never checked if the classifications were correct.
The expected_categories variable was created but never used for validation.

Changes:
- Extract actual categories from batch classification results
- Compare against expected categories and calculate accuracy percentage
- Add detailed output showing each classification result
- Assert that accuracy meets 75% threshold
- Maintain backward compatibility with existing HTTP/count checks

This improved test now properly catches classification accuracy issues
and will fail when the classification system returns incorrect results,
exposing problems that were previously hidden.

Related to issue vllm-project#318: Batch Classification API Returns Incorrect Categories

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>

* style: apply black formatting to classification test

Automatic formatting applied by black pre-commit hook.

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>

---------

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
Signed-off-by: liuhy <liuhongyu@apache.org>
Aias00 pushed a commit to Aias00/semantic-router that referenced this pull request Oct 4, 2025
* feat: improve batch classification test to validate accuracy

Previously, the batch classification test only validated HTTP status
and result count, but never checked if the classifications were correct.
The expected_categories variable was created but never used for validation.

Changes:
- Extract actual categories from batch classification results
- Compare against expected categories and calculate accuracy percentage
- Add detailed output showing each classification result
- Assert that accuracy meets 75% threshold
- Maintain backward compatibility with existing HTTP/count checks

This improved test now properly catches classification accuracy issues
and will fail when the classification system returns incorrect results,
exposing problems that were previously hidden.

Related to issue vllm-project#318: Batch Classification API Returns Incorrect Categories

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>

* style: apply black formatting to classification test

Automatic formatting applied by black pre-commit hook.

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>

---------

Signed-off-by: Yossi Ovadia <yovadia@redhat.com>
Signed-off-by: liuhy <liuhongyu@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants