Enhancing Legal Sentiment Analysis: A Convolutional Neural Network–Long Short-Term Memory Document-Level Model
Abstract
1. Introduction
2. Research Significance
3. Background and Context: Sentiment Analysis
3.1. Sentiment Analysis
3.1.1. Levels of Sentiment Analysis
3.1.2. Word Embedding
3.2. Deep Learning
- Feature Extraction Word-to-word associations, the sentiments conveyed by individual words, and the overall context are all things deep learning models can deduce automatically.
- Context Understanding is a comprehensive capability to capture the contextual details essential for gaining a sense of emotion in complicated fields such as maritime law.
- Sequential Information Modeling can efficiently generate sequential information, like RNNs and LSTM models, which is essential for tasks requiring text order and sentiment. This is of utmost significance in legal documents, where the structure and flow of information are critical.
- The scalability and complexity of Canadian maritime case law are well within the capabilities of deep learning models. These models can handle vast datasets and be trained for specialized tasks.
3.2.1. CNN
3.2.2. RNN-LSTM
3.2.3. RNN-BiLSTM
3.2.4. Semantic-Oriented Approach (SOA)
4. Related Works
4.1. Short Text Sentiment Analysis
4.2. Document Level Sentiment Analysis
5. Proposed Model: CNN-LSTM and Doc2vec for Document-Level Sentiment Analysis
- (1)
- Initialize weights and biases (e.g., randomly, ~U(−0.1, 0.1)) of the network.
- (2)
- For each BP iteration, DO:
- For each PCG beat in the dataset, DO:
FP: A layer’s neuron outputs may be found by forward propagation from the input layer to the output layer.BP: Compute delta error at the output layer and back-propagate it to first hidden layer to compute the delta errors.PP: Postprocess to compute the weight and bias.Update: Update the weights and biases by the (accumulation of) sensitivities scaled with the learning factor.
5.1. Detailed Model Architecture and Training Procedure
Model Architecture and Hyperparameters
5.2. Document Representation
Training Procedure
6. Experimental Results
6.1. Dataset
6.2. Results
6.3. Comparison
6.3.1. CNN Model
6.3.2. LSTM Models
6.3.3. CNN-LSTM Model
6.3.4. Precision and Recall Metrics
6.4. Discussion
7. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
List of Notations
| Cell state | |
| Hidden state | |
| Forget gate | |
| σ | Sigmoid activation function |
| Input gate | |
| Candidate cell state | |
| Output gate | |
| Input at time step t | |
| Hidden state at time step t − 1 | |
| Weight matrices | |
| Bias vectors | |
| Hyperbolic tangent activation function | |
| Input data | |
| Bias of the kth neuron at layer l | |
| Output of the ith neuron at layer l-1 | |
| Kernel from the ith neuron at layer l-1 to the kth neuron at layer l | |
| p | Input vector |
| t p | Target |
| , yNL L | Output vector |
References
- Liu, B. Sentiment Analysis And Opinion Mining; Springer Nature: Berlin/Heidelberg, Germany, 2022. [Google Scholar]
- Nasukawa, T.; Yi, J. Sentiment analysis: Capturing favorability using natural language processing. In Proceedings of the 2nd International Conference on Knowledge Capture, Sanibel Island, FL, USA, 23–25 October 2003; pp. 70–77. [Google Scholar]
- Bai, X. Predicting consumer sentiments from online text. Decis. Support. Syst. 2011, 50, 732–742. [Google Scholar] [CrossRef] [Scilit]
- Naseem, U.; Razzak, I.; Musial, K.; Imran, M. Transformer based Deep Intelligent Contextual Embedding for Twitter sentiment analysis. Future Gener. Comput. Syst. 2020, 113, 58–69. [Google Scholar] [CrossRef] [Scilit]
- Yusof, N.N.; Mohamed, A.; Abdul-Rahman, S. Context Enrichment Model Based Framework for Sentiment Analysis. In Proceedings of the Soft Computing in Data Science: 5th International Conference, SCDS 2019, Iizuka, Japan, 28–29 August 2019; Proceedings 5. Springer: Berlin/Heidelberg, Germany, 2019; pp. 325–335. [Google Scholar]
- Vijayaragavan, P.; Ponnusamy, R.; Aramudhan, M. An optimal support vector machine based classification model for sentimental analysis of online product reviews. Future Gener. Comput. Syst. 2020, 111, 234–240. [Google Scholar] [CrossRef] [Scilit]
- Mikolov, T.; Karafiát, M.; Burget, L.; Cernocký, J.; Khudanpur, S. Recurrent neural network based language model. Interspeech 2010, 2, 1045–1048. [Google Scholar]
- Rhanoui, M.; Mikram, M.; Yousfi, S.; Barzali, S. A CNN-BiLSTM model for document-level sentiment analysis. Mach. Learn. Knowl. Extr. 2019, 1, 832–847. [Google Scholar] [CrossRef] [Scilit]
- Tripathy, A.; Anand, A.; Rath, S.K. Document-level sentiment classification using hybrid machine learning approach. Knowl. Inf. Syst. 2017, 53, 805–831. [Google Scholar] [CrossRef] [Scilit]
- Newmyer, K.; Zaccagnino, M. Connecticut Law Review Volume 52, February 2021, Number 4, 2021. Available online: https://heinonline.org/ (accessed on 8 February 2024).
- Christodoulou, A.; Echebarria Fernández, J. Maritime Governance and International Maritime Organization instruments focused on sustainability in the light of United Nations’ sustainable development goals. In Sustainability in the Maritime Domain: Towards Ocean Governance and Beyond; Springer: Berlin/Heidelberg, Germany, 2021; pp. 415–461. [Google Scholar]
- Gavrilov, V.; Dremliuga, R.; Nurimbetov, R. Article 234 of the 1982 United Nations Convention on the law of the sea and reduction of ice cover in the Arctic Ocean. Mar. Policy 2019, 106, 103518. [Google Scholar] [CrossRef] [Scilit]
- Undavia, S.; Meyers, A.; Ortega, J.E. A comparative study of classifying legal documents with neural networks. In Proceedings of the 2018 Federated Conference on Computer Science and Information Systems (FedCSIS), Poznan, Poland, 9–12 September 2018; pp. 515–522. [Google Scholar]
- Abimbola, B.; Tan, Q.; Villar, J.R. Introducing Intelligence to the Semantic Analysis of Canadian Maritime Case Law: Case Based Reasoning Approach. In Proceedings of the International Workshop on Soft Computing Models in Industrial and Environmental Applications, Salamanca, Spain, 5–7 September 2022; Springer: Berlin/Heidelberg, Germany, 2022; pp. 587–595. [Google Scholar]
- Abimbola, B.; Marin, E.D.L.C.; Tan, Q. Enhancing Legal Sentiment Analysis: A CNN-LSTM Document-Level Model. Preprints 2024. [Google Scholar] [CrossRef] [Scilit]
- Ghorbani, M.; Bahaghighat, M.; Xin, Q.; Özen, F. ConvLSTMConv network: A deep learning approach for sentiment analysis in cloud computing. J. Cloud Comput. 2020, 9, 1–12. [Google Scholar] [CrossRef] [Scilit]
- Jin, Z.; Yang, Y.; Liu, Y. Stock closing price prediction based on sentiment analysis and LSTM. Neural Comput. Appl. 2020, 32, 9713–9729. [Google Scholar] [CrossRef] [Scilit]
- Schuster, M.; Paliwal, K.K. Bidirectional recurrent neural networks. IEEE Trans. Signal Process. 1997, 45, 2673–2681. [Google Scholar] [CrossRef] [Scilit]
- Tai, K.S.; Socher, R.; Manning, C.D. Improved semantic representations from tree-structured long short-term memory networks. arXiv 2015, arXiv:1503.00075. [Google Scholar]
- Sadia, A.; Khan, F.; Bashir, F. An overview of lexicon-based approach for sentiment analysis. In Proceedings of the 2018 3rd International Electrical Engineering Conference (IEEC 2018), Karachi, Pakistan, 9–10 February 2018; pp. 1–6. [Google Scholar]
- Godbole, N.; Srinivasaiah, M.; Skiena, S. Large-Scale Sentiment Analysis for News and Blogs. Icwsm 2007, 7, 219–222. [Google Scholar]
- Baccianella, S.; Esuli, A.; Sebastiani, F. Sentiwordnet 3.0: An enhanced lexical resource for sentiment analysis and opinion mining. In Proceedings of the Lrec, Valletta, Malta, 17–23 May 2010; pp. 2200–2204. [Google Scholar]
- Denecke, K. Are SentiWordNet scores suited for multi-domain sentiment classification? In Proceedings of the 2009 Fourth International Conference on Digital Information Management, Ann Arbor, MI, USA, 1–4 November 2009; pp. 1–6. [Google Scholar]
- Yeskuatov, E.; Chua, S.-L.; Foo, L.K. Leveraging reddit for suicidal ideation detection: A review of machine learning and natural language processing techniques. Int. J. Environ. Res. Public Health 2022, 19, 10347. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Tahseen, T.; Kabir, M.M.J. A comparative study of deep learning neural networks in sentiment classification from texts. In Machine Learning and Autonomous Systems: Proceedings of ICMLAS 2021; Springer: Berlin/Heidelberg, Germany, 2022; pp. 289–305. [Google Scholar]
- Sahoo, C.; Wankhade, M.; Singh, B.K. Sentiment analysis using deep learning techniques: A comprehensive review. Int. J. Multimed. Inf. Retr. 2023, 12, 41. [Google Scholar] [CrossRef] [Scilit]
- Alghazzawi, D.; Bamasag, O.; Albeshri, A.; Sana, I.; Ullah, H.; Asghar, M.Z. Efficient prediction of court judgments using an LSTM+ CNN neural network model with an optimal feature set. Mathematics 2022, 10, 683. [Google Scholar] [CrossRef] [Scilit]
- Bramantoro, A.; Virdyna, I. Classification of divorce causes during the COVID-19 pandemic using convolutional neural networks. PeerJ Comput. Sci. 2022, 8, e998. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Watson, J.; Aglionby, G.; March, S. Using machine learning to create a repository of judgments concerning a new practice area: A case study in animal protection law. Artif. Intell. Law 2023, 31, 293–324. [Google Scholar] [CrossRef] [Scilit]
- Da Silva, N.C.; Braz, F.; De Campos, T.; Gusmao, D.; Chaves, F.; Mendes, D.; Bezerra, D.; Ziegler, G.; Horinouchi, L.; Ferreira, M. Document type classification for Brazil’s supreme court using a convolutional neural network. In Proceedings of the 10th International Conference on Forensic Computer Science and Cyber Law (ICoFCS), Sao Paulo, Brazil, 29–30 October 2018; pp. 29–30. [Google Scholar]
- Gamage, C.; Dinalankara, R.; Samarabandu, J.; Subasinghe, A. A comprehensive survey on the applications of machine learning techniques on maritime surveillance to detect abnormal maritime vessel behaviors. WMU J. Marit. Aff. 2023, 22, 447–477. [Google Scholar] [CrossRef] [Scilit]
- Syed, M.A.B.; Ahmed, I. A CNN-LSTM architecture for marine vessel track association using automatic identification system (AIS) data. Sensors 2023, 23, 6400. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Pillai, V.G.; Chandran, L.R. Verdict prediction for indian courts using bag of words and convolutional neural network. In Proceedings of the 2020 Third International Conference on Smart Systems and Inventive Technology (ICSSIT), Tirunelveli, India, 20–22 August 2020; pp. 676–683. [Google Scholar]
- Chen, D.L.; Eagel, J. Can machine learning help predict the outcome of asylum adjudications? In Proceedings of the 16th Edition of the International Conference on Articial Intelligence and Law, London, UK, 12–16 June 2017; pp. 237–240. [Google Scholar]
- Lum, K. Limitations of mitigating judicial bias with machine learning. Nat. Hum. Behav. 2017, 1, 0141. [Google Scholar] [CrossRef] [Scilit]
- Feizollah, A.; Ainin, S.; Anuar, N.B.; Abdullah, N.A.B.; Hazim, M. Halal products on Twitter: Data extraction and sentiment analysis using stack of deep learning algorithms. IEEE Access 2019, 7, 83354–83362. [Google Scholar] [CrossRef] [Scilit]
- Tasdelen, A.; Sen, B. A hybrid CNN-LSTM model for pre-miRNA classification. Sci. Rep. 2021, 11, 14125. [Google Scholar] [CrossRef] [Scilit]
- Muhlenbach, F.; Phuoc, L.N.; Sayn, I. Predicting Court Decisions for Alimony: Avoiding Extra-legal Factors in Decision made by Judges and Not Understandable AI Models. arXiv 2020, arXiv:2007.04824. [Google Scholar]
- Alsayat, A. Improving sentiment analysis for social media applications using an ensemble deep learning language model. Arab. J. Sci. Eng. 2022, 47, 2499–2511. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Lam, J.T.; Liang, D.; Dahan, S.; Zulkernine, F.H. The Gap between Deep Learning and Law: Predicting Employment Notice. In Proceedings of the NLLP@ KDD, San Diego, CA, USA, 24 August 2020; pp. 52–56. [Google Scholar]
- Abimbola, B. Sentiment Analysis of Canadian Maritime Case Law: A Sentiment Case Law and Deep Learning Approach, Version 1; Mendeley Data: Amsterdam, The Netherlands, 2023. [CrossRef]
- Alzahrani, M.E.; Aldhyani, T.H.; Alsubari, S.N.; Althobaiti, M.M.; Fahad, A. Developing an intelligent system with deep learning algorithms for sentiment analysis of E-commerce product reviews. Comput. Intell. Neurosci. 2022, 2022, 3840071. [Google Scholar] [CrossRef] [Scilit] [PubMed]










| Word Embedding | Level | Model | Accuracy |
|---|---|---|---|
| WORD2VEC [24] | Word level Document level Sentence level | CNN-LSTM BERT KNN SSR | 84.9% 84.7% 89.0% 85.01% |
| GLOVE [25] | Document level Word level Sentence level | CNN-BiLSTM KNN CNN | 88.9% 82.7% 81.0% 91.01% |
| BOMW [26] | Sentence level Word level Document level | BOMW BERT CNN SR-LSTM | 92.9% 78.7% 86.0% 80.01% |
| Case Year | The Year the Case Was Registered |
|---|---|
| majority opinion | Opinion of the majority of judges engaged in the case. |
| minority opinion | Opinion of the minority of judges engaged in the case. |
| number of judges | The total number of judges hearing the case. |
| court judgment | Final court judgment on the case (whether the decision is affirmed or reversed). |
| number of cited documents (court decision legislation data) | The number of laws and judicial jurisprudence cited by the judges to support their decision. |
| Model | Test Accuracy |
|---|---|
| CNN + LSTM model 1 | 98.01% |
| CNN + LSTM model 2 | 97.94% |
| CNN + LSTM model 3 | 98.05% |
| Sentiment Category | Precision | Recall |
|---|---|---|
| Positive | 0.97 | 0.95 |
| Neutral | 0.93 | 0.90 |
| Negative | 0.95 | 0.96 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Abimbola, B.; de La Cal Marin, E.; Tan, Q. Enhancing Legal Sentiment Analysis: A Convolutional Neural Network–Long Short-Term Memory Document-Level Model. Mach. Learn. Knowl. Extr. 2024, 6, 877-897. https://doi.org/10.3390/make6020041
Abimbola B, de La Cal Marin E, Tan Q. Enhancing Legal Sentiment Analysis: A Convolutional Neural Network–Long Short-Term Memory Document-Level Model. Machine Learning and Knowledge Extraction. 2024; 6(2):877-897. https://doi.org/10.3390/make6020041
Chicago/Turabian StyleAbimbola, Bolanle, Enrique de La Cal Marin, and Qing Tan. 2024. "Enhancing Legal Sentiment Analysis: A Convolutional Neural Network–Long Short-Term Memory Document-Level Model" Machine Learning and Knowledge Extraction 6, no. 2: 877-897. https://doi.org/10.3390/make6020041
APA StyleAbimbola, B., de La Cal Marin, E., & Tan, Q. (2024). Enhancing Legal Sentiment Analysis: A Convolutional Neural Network–Long Short-Term Memory Document-Level Model. Machine Learning and Knowledge Extraction, 6(2), 877-897. https://doi.org/10.3390/make6020041

