Skip to content

Conversation

@sai-sushma-maddali
Copy link

Related Issue

  • Info about the related issue

  • CodePeak 2025 Participant

  • Contributor

Closes: #issue number that will be closed through this PR

Describe the add-ons or changes you've made

Give a clear description of what have you added or modifications made

Added an SVM-based classification model that uses Legal-BERT embeddings from case texts to predict legal case outcomes.
The model groups outcomes into four semantic categories — positive, neutral, negative, and approval — for balanced classification.

Implementation details

  • Implemented BERT embedding extraction using nlpaueb/legal-bert-base-uncased
  • Trained an SVM (LinearSVC) classifier with class weighting for imbalance handling
  • Added preprocessing, model training, and evaluation scripts
  • Included a Jupyter notebook for model development (Legal_case_classification_development.ipynb)
  • Added inference script (legal_case_classification.py) and unit test file
  • Updated README.md and requirements.txt

Results
Achieved Macro F1 = 0.42 on test data
Improved generalization compared to baseline TF-IDF + SVM model

Type of change

What sort of change have you made:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Describe how it has been tested
Describe how have you verified the changes made

The model was tested using train, validation, and test splits along with cross-validation during hyperparameter tuning. Unit tests verified model loading, text preprocessing, and prediction outputs. The changes were validated by comparing results against the previous TF-IDF baseline, showing improved macro F1-scores and consistent predictions across sample legal case texts.

Checklist:

  • My code follows the guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly wherever it was hard to understand.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added things that prove my fix is effective or that my feature works.
  • Any dependent changes have been merged and published in downstream modules.

@welcome
Copy link

welcome bot commented Oct 12, 2025

Hello there! 👋 Welcome to the project! 💖
Thank you and congrats 🎉 for opening your first pull request. Please adhere to our Code of Conduct. 🙌🏻 We will get back to you as soon as we can. 😄

Feel free to get in touch with me through social media handles. Hope to see you there!😄

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.

1 participant