- 
                Notifications
    You must be signed in to change notification settings 
- Fork 270
Fix/improve batch classification test #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            rootfs
  merged 2 commits into
  vllm-project:main
from
yossiovadia:fix/improve-batch-classification-test
  
      
      
   
  Oct 2, 2025 
      
    
                
     Merged
            
            Fix/improve batch classification test #319
                    rootfs
  merged 2 commits into
  vllm-project:main
from
yossiovadia:fix/improve-batch-classification-test
  
      
      
   
  Oct 2, 2025 
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    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 <[email protected]>
Automatic formatting applied by black pre-commit hook. Signed-off-by: Yossi Ovadia <[email protected]>
| ✅ Deploy Preview for vllm-semantic-router ready!
 To edit notification comments on pull requests, go to your Netlify project configuration. | 
| 👥 vLLM Semantic Team NotificationThe following members have been identified for the changed files in this PR and have been automatically assigned: 📁  | 
              
                    rootfs
  
              
              approved these changes
              
                  
                    Oct 2, 2025 
                  
              
              
            
            
    
  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 <[email protected]> * style: apply black formatting to classification test Automatic formatting applied by black pre-commit hook. Signed-off-by: Yossi Ovadia <[email protected]> --------- Signed-off-by: Yossi Ovadia <[email protected]> Signed-off-by: liuhy <[email protected]>
    
  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 <[email protected]> * style: apply black formatting to classification test Automatic formatting applied by black pre-commit hook. Signed-off-by: Yossi Ovadia <[email protected]> --------- Signed-off-by: Yossi Ovadia <[email protected]> Signed-off-by: liuhy <[email protected]>
    
  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 <[email protected]> * style: apply black formatting to classification test Automatic formatting applied by black pre-commit hook. Signed-off-by: Yossi Ovadia <[email protected]> --------- Signed-off-by: Yossi Ovadia <[email protected]> Signed-off-by: liuhy <[email protected]>
    
  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 <[email protected]> * style: apply black formatting to classification test Automatic formatting applied by black pre-commit hook. Signed-off-by: Yossi Ovadia <[email protected]> --------- Signed-off-by: Yossi Ovadia <[email protected]> Signed-off-by: liuhy <[email protected]>
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
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:
- Extract actual categories from each classification result
- Compare against expected categories: ["math", "computer science", "business", "history"]
- Calculate accuracy percentage and assert ≥75% threshold