Leveraging AI for Legal Text Analysis: Case Study-Based Section Prediction
DOI:
https://doi.org/10.32628/CSEIT25111696Keywords:
TF-IDF, Extra Trees, Legal Section Prediction, Machine Learning, Judicial Case AnalysisAbstract
This research introduces an artificial intelligence-driven approach for predicting relevant legal sections directly from judicial case texts. Legal documents often contain complex language and unstructured narratives, making manual identification of applicable law sections time-consuming and prone to errors. To address this challenge, the proposed framework employs Term Frequency–Inverse Document Frequency (TF-IDF) feature extraction to transform textual information into numerical vectors, capturing the importance of terms across case documents. Several machine learning classifiers, including K-Nearest Neighbors (KNN), Support Vector Machine (SVM), Decision Tree (DT), Random Forest (RF), and Extra Trees (ET), were implemented and rigorously evaluated to determine their effectiveness in section prediction. Comparative analysis reveals that the ET model consistently achieves superior performance in terms of accuracy, precision, recall, and F1-score, demonstrating its robustness and reliability for legal text classification. By leveraging TF-IDF features and ensemble learning techniques, the proposed approach significantly reduces the manual effort required for legal section identification and offers an automated, scalable solution for legal professionals and judicial platforms. This framework not only facilitates faster retrieval of relevant legal provisions but also contributes to the advancement of AI applications in the legal domain, supporting more efficient and informed decision-making processes.
📊 Article Downloads
References
M. Sesodia et al., “AnnoCaseLaw: A Richly-Annotated Dataset For Benchmarking Explainable Legal Judgment Prediction,” arXiv, 2025, [Online]. Available: http://arxiv.org/abs/2503.00128
S. K. Nigam, B. D. Patnaik, S. Mishra, N. Shallum, K. Ghosh, and A. Bhattacharya, “NYAYAANUMANA and INLEGALLLAMA: The Largest Indian Legal Judgment Prediction Dataset and Specialized Language Model for Enhanced Decision Analysis,” Proceedings - International Conference on Computational Linguistics, COLING, vol. Part F206484-1, pp. 11135–11160, 2025.
R. Mahajan et al., “FastText - XGB (FGB) machine learning model for Indian Penal Code (IPC) prediction,” Computational Methods in Science and Technology - Proceedings of the 4th International Conference on Computational Methods in Science and Technology, ICCMST 2024, vol. 2, no. November, pp. 190–196, 2025, doi: 10.1201/9781003561651-27. DOI: https://doi.org/10.1201/9781003561651-27
X. Wang, X. Zhang, V. Hoo, Z. Shao, and X. Zhang, “LegalReasoner: A Multi-Stage Framework for Legal Judgment Prediction via Large Language Models and Knowledge Integration,” IEEE Access, vol. 12, no. October, pp. 166843–166854, 2024, doi: 10.1109/ACCESS.2024.3496666. DOI: https://doi.org/10.1109/ACCESS.2024.3496666
J. J. Nay et al., “Large language models as tax attorneys: a case study in legal capabilities emergence,” Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, vol. 382, no. 2270, 2024, doi: 10.1098/rsta.2023.0159. DOI: https://doi.org/10.1098/rsta.2023.0159
M. Bhatnagar and S. Huchhanavar, “Predicting Delays in Indian Lower Courts Using AutoML and Decision Forests,” Studies in Computational Intelligence, vol. 1145 SCI, pp. 166–180, 2024, doi: 10.1007/978-3-031-53717-2_16. DOI: https://doi.org/10.1007/978-3-031-53717-2_16
S. K. Nigam and A. Deroy, “Fact-based Court Judgment Prediction,” ACM International Conference Proceeding Series, pp. 78–82, 2023, doi: 10.1145/3632754.3632765. DOI: https://doi.org/10.1145/3632754.3632765
S. Vats et al., “LLMs - the Good, the Bad or the Indispensable?: A Use Case on Legal Statute Prediction and Legal Judgment Prediction on Indian Court Cases,” Findings of the Association for Computational Linguistics: EMNLP 2023, vol. 2019, pp. 12451–12474, 2023, doi: 10.18653/v1/2023.findings-emnlp.831. DOI: https://doi.org/10.18653/v1/2023.findings-emnlp.831
M. T. Alqershy and R. Kishore, “Construction claims prediction using ANN models: a case study of the Indian construction industry,” International Journal of Construction Management, vol. 23, no. 6, pp. 1097–1108, 2023, doi: 10.1080/15623599.2021.1955322. DOI: https://doi.org/10.1080/15623599.2021.1955322
P. Madambakam, S. Rajmohan, H. Sharma, and T. A. C. P. Gupta, “SLJP: Semantic Extraction based Legal Judgment Prediction,” indiacode, Dec. 2023, [Online]. Available: http://arxiv.org/abs/2312.07979
R. Sil, “Sentiment Analysis-Based Legal Case Prediction System,” SSRN Electronic Journal, pp. 1–8, 2022, doi: 10.2139/ssrn.4145582. DOI: https://doi.org/10.2139/ssrn.4145582
V. Malik et al., “ILDC for CJPE: Indian legal documents corpus for court judgment prediction and explanation,” ACL-IJCNLP 2021 - 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, Proceedings of the Conference, pp. 4046–4062, 2021, doi: 10.18653/v1/2021.acl-long.313. DOI: https://doi.org/10.18653/v1/2021.acl-long.313
V. Parikh, V. Mathur, P. Mehta, N. Mittal, and P. Majumder, “LawSum: A weakly supervised approach for Indian Legal Document Summarization,” arXiv, pp. 1–22, 2021, [Online]. Available: http://arxiv.org/abs/2110.01188
G. Sukanya and J. Priyadarshini, “A Meta Analysis of Attention Models on Legal Judgment Prediction System,” International Journal of Advanced Computer Science and Applications, vol. 12, no. 2, pp. 531–538, 2021, doi: 10.14569/IJACSA.2021.0120266. DOI: https://doi.org/10.14569/IJACSA.2021.0120266
K. Shirsat, A. Keni, P. Chavan, and M. Gosavi, “Legal Judgement Prediction System,” International Research Journal of Engineering and Technology, no. May, 2021, [Online]. Available: www.irjet.net
G. Pillai and L. R. Chandran, “Verdict prediction for indian courts using bag of words and convolutional neural network,” Proceedings of the 3rd International Conference on Smart Systems and Inventive Technology, ICSSIT 2020, no. August, pp. 676–683, 2020, doi: 10.1109/ICSSIT48917.2020.9214278. DOI: https://doi.org/10.1109/ICSSIT48917.2020.9214278
Downloads
Published
Issue
Section
License
Copyright (c) 2025 International Journal of Scientific Research in Computer Science, Engineering and Information Technology

This work is licensed under a Creative Commons Attribution 4.0 International License.