ChapterPDF Available

Abstract and Figures

Legal information retrieval holds a significant importance to lawyers and legal professionals. Its significance has grown as a result of the vast and rapidly increasing amount of legal documents available via electronic means. Legal documents, which can be considered flat file databases, contain information that can be used in a variety of ways, including arguments, counter-arguments, justifications, and evidence. As a result, developing automated mechanisms for extracting important information from legal opinion texts can be regarded as an important step toward introducing artificial intelligence into the legal domain. Identifying advantageous or disadvantageous statements within these texts in relation to legal parties can be considered as a critical and time consuming task. This task is further complicated by the relevance of context in automatic legal information extraction. In this paper, we introduce a solution to predict sentiment value of sentences in legal documents in relation to its legal parties. The Proposed approach employs a fine-grained sentiment analysis (Aspect-Based Sentiment Analysis) technique to achieve this task. Sigmalaw PBSA is a novel deep learning-based model for ABSA which is specifically designed for legal opinion texts. We evaluate the Sigmalaw PBSA model and existing ABSA models on the SigmaLaw-ABSA dataset which consists of 2000 legal opinion texts fetched from a public online data base. Experiments show that our model outperforms the state-of-the-art models. We also conduct an ablation study to identify which methods are most effective for legal texts.
Content may be subject to copyright.
Sigmalaw PBSA - A Deep Learning Model for
Aspect-Based Sentiment Analysis for the Legal Domain
Isanka Rajapaksha, Chanika Ruchini Mudalige, Dilini Karunarathna, Nisansa de Silva,
Amal Shehan Perera, and Gathika Ratnayaka
Department of Computer Science and Engineering, University of Moratuwa
Sri Lanka
{israjapaksha,chanikaruchini,dilinirasanjana}.16@cse.mrt.ac.lk
Abstract. Legal information retrieval holds a significant importance to lawyers
and legal professionals. Its significance has grown as a result of the vast and
rapidly increasing amount of legal documents available via electronic means. Le-
gal documents, which can be considered flat file databases, contain information
that can be used in a variety of ways, including arguments, counter-arguments,
justifications, and evidence. As a result, developing automated mechanisms for
extracting important information from legal opinion texts can be regarded as an
important step toward introducing artificial intelligence into the legal domain.
Identifying advantageous or disadvantageous statements within these texts in re-
lation to legal parties can be considered as a critical and time consuming task.
This task is further complicated by the relevance of context in automatic legal
information extraction. In this paper, we introduce a solution to predict sentiment
value of sentences in legal documents in relation to its legal parties. The Pro-
posed approach employs a fine-grained sentiment analysis (Aspect-Based Senti-
ment Analysis) technique to achieve this task. Sigmalaw PBSA is a novel deep
learning-based model for ABSA which is specifically designed for legal opin-
ion texts. We evaluate the Sigmalaw PBSA model and existing ABSA models on
the SigmaLaw-ABSA dataset which consists of 2000 legal opinion texts fetched
from a public online data base. Experiments show that our model outperforms
the state-of-the-art models. We also conduct an ablation study to identify which
methods are most effective for legal texts.
Keywords: Legal information extraction · Legal domain · Aspect-Based Senti-
ment Analysis · Deep learning · NLP.
1 Introduction
Factual scenario analysis of previous court cases holds a significant importance to
lawyers and legal officers whenever they are handling a new legal court case. Legal
officials are expected to analyse previous court cases and statutes to find supporting ar-
guments before they represent a client at a trial. As the number of legal cases increases,
legal professionals typically endure heavy workloads on a daily basis, and they may be-
come overwhelmed and as a result of that, be unable to obtain quality analysis. In this
analysis process, identifying advantageous and disadvantageous statements relevant to
legal parties [1–4] can be considered a critical and time consuming task. By automating
2 Isanka Rajapaksha et al.
this task, legal officers will be able to reduce their workload significantly. In this paper,
we introduce a solution to predict sentiment value of sentences in legal documents in
relation to its legal parties. The proposed approach employs a fine-grained sentiment
analysis technique to achieve this task.
Sentiment analysis (SA) is identifying opinions and then classifying them into sev-
eral polarity levels (Positive,Neutral, or Negative) using computational linguistics and
information retrieval [5]. Sentiment analysis can be divided into 4 levels; document
level SA, sentence level SA, phrase level SA, and aspect level SA. Sentences in a
legal case usually contain two or more members/entities which belong to main legal
parties (plaintiff,petitioner,defendant, and respondent). Extracting opinions with re-
spect to each legal party cannot be performed only by using document-level, sentence-
level, or phrase-level sentiment analysis. Aspect-based sentiment analysis (ABSA) is
the most appropriate and fine-grained solution to perform Party-Based Sentiment Anal-
ysis (PBSA) in the legal domain [1]. In aspect-based sentiment analysis, we can identify
there processing steps such as ”identification, classification, and aggregation” [6]. Gen-
erally, in ABSA aspects are extracted from a given text and then each aspect is allocated
a sentiment level (positive,negative, or neutral) [7]. The members of legal parties in a
court case are considered as aspects and therefore performing ABSA in the legal opin-
ion texts can also be termed as Party-Based Sentiment Analysis (PBSA) [1].
A number of studies have addressed Aspect-based Sentiment Analysis in different
domains such as restaurants, hotels, movies, products reviews, government services,
mobile phones and telecommunication [8]. When it comes to the legal domain, senti-
ment analysis becomes a challenging area because of the domain-specific meanings and
behaviour of words in the legal opinion texts [9]. Languages being used are sometimes
mixed (i.e., English, Latin, etc.) and in some situations, the meaning of the words and
context varies from that of domain interpretations. The complexity structure and the
length of the sentences also increase the difficulty. As a result of the above factors, it
is difficult to obtain a comparative accuracy to other areas such as customer feedback,
movie or product reviews, and political comments.
Example 1
Sentence 1.1: After obtaining a warrant, the officials searched Lee’s house, where they found
drugs, cash, and a loaded rifle.
Example 1 contains a sentence extracted from Lee v. United States [10] which men-
tions two legal party members: Lee and officials. As the illegal materials were found at
Lee’s house, this sentence clearly shows a negative sentiment towards Lee and Positive
sentiment towards officials.
The rule-based approach proposed by Rajapaksha et al. [1] can be identified as the
first and only attempt to perform ABSA in the legal domain to the best of our knowl-
edge. However, that approach has two weaknesses: (1) it significantly depends on the
phrase-level sentiment annotator, (2) manually created rules may not cover all the sen-
A Deep Learning Model for Aspect-Based Sentiment Analysis for the Legal Domain 3
tence patterns. There are many existing deep-learning models with different architec-
tures trained for different domains to fulfil a wide array of tasks. Despite that, to the best
of our knowledge, there is no existing deep learning-based approach for ABSA in the
legal domain. In this paper we show that, as the sentences in legal documents are often
long and have a complex semantic structure, the existing model architectures, created
for short sentences in general use, do not perform well for the legal domain. The main
objective of this study is to propose a novel deep learning-based model (SigmaLaw-
PBSA) for ABSA, designed specifically for the legal domain.
2 Related Work
2.1 Legal Information Extraction
When referring to the past literature, it shows that within the legal domain, there exist
very few studies related to sentiment analysis. The study by Gamage et al. [11] intro-
duced a sentence-level sentiment annotator using transfer learning for the legal domain.
In this proposed approach, the sentiment of a given sentence is classified into one of the
two classes; negative and non-negative. But it does not take into consideration any party
mentioned in the sentence when detecting the sentiment of the sentence. Moreover, the
study by Ratnayaka et al. [12] have proposed methodologies to identify relationships
among sentences in the legal documents. They have demonstrated that sentiment anal-
ysis can be used to identify sentences that provide different opinions on the same topic
(contradictory opinions) within a legal opinion text. The study of Rajapaksha et al. [1]
developed a rule-based approach which is built around a phrase level sentiment anno-
tator [11] and manually created rules for sentiment detection of legal sentences with
respect to legal parties. This can be identified as the first attempt to use ABSA in the
legal domain.
2.2 Existing Aspect-Based Sentiment Analysis Models
Lexicon-based approaches, machine learning-based approaches, and hybrids of ma-
chine learning and lexicon-based approaches are the main types of methods to per-
form Aspect-Based Sentiment Analysis (ABSA) [13]. Recently, deep neural network
approaches have shown better results on aspect-based sentiment classification tasks
due to its ability to generate the dense vectors of sentences without handcrafted fea-
tures. Tang et al. [14] proposed TD-LSTM which uses two Long Short-term Memory
(LSTM) networks in order to extract important information from the left and right sides
of the target. Although it improves the LSTM architecture, it is often impossible to
distinguish between various sentiment polarities at a fine-grained level. A number of
subsequent studies employed attention mechanisms to learn the key parts of sentences
that should be given special focus in order to enhance the sentence representation. In
that perspective, Wang et al. [15] proposed AT-LSTM and ATAE-LSTM, incorporating
attention mechanisms to model relationships between aspects and context. In order to
better understand target information, Cheng et al. [16] introduced the HiErarchical AT-
tention (HEAT) network with sentiment attention and aspect attention. Chen et al. [17]
4 Isanka Rajapaksha et al.
designed the RAM model by adopting multiple attentions to extract important informa-
tion from memory. IAN, which was proposed by Ma et al. [18], utilizes a bidirectional
attention mechanism and learns the attention for the contexts and the targets separately
via interactive learning.
Although attention-based models have shown promising results over many ABSA
tasks, they are not adequate to catch syntactic dependencies between aspect and the
context words within the sentence. The important feature of Graph Convolutional Net-
work (GCN) is that, it has the ability to draw syntactically related terms to the target
aspect and then manipulate, multi-word associations and syntactical knowledge in long-
range, utilizing GCN layers [19]. Zhao et al. [20] proposed ASGCN, adopting GCN for
ABSA. Zhao et al. concluded that GCN improves overall efficiency by exploiting both
syntactic knowledge and long-range word dependency. Zhao et al. [20] introduced the
SDGCN model with the aim of modeling sentiment dependencies within a sentence
among different target aspects.
3 Methodology
The ultimate goal of our proposed approach is to detect the sentiment polarity of sen-
tences in legal texts with respect to each legal party mentioned in the sentence. Legal
texts usually consist of multiple legal parties having different inter-dependencies among
them. Hence, the sentiment classifier should be developed in order to classify sentiment
polarity values of multiple legal parties. In our approach, positive,negative and neutral
are considered as sentiment polarities. The overall architecture of our proposed model
is illustrated in Fig. 1. To perform the aspect sentiment classification, our model archi-
tecture is designed with the following layers; word embedding layer, Recurrent Neural
Network (RNN) layer, position aware attention mechanism, GCN layer, and sentiment
classification layer.
3.1 Word Embedding Layer
Word embedding layer maps each word to a high dimensional vector space. It is widely
known that a strong word embedding is extremely important for composing a strong
and efficient text representation for use at later stages. We used a pre-trained BERT
(Bidirectional Encoder Representations from Transformers) model1[9] post-trained us-
ing the criminal court case legal opinion texts available in the SigmaLaw dataset to
obtain the word embedding.
An input sentence (S), of Nnumber of words is represented as S={ws1,ws2, ..wsN}.
A given sentence S, would include a set of aspect terms (Sa) of cardinality Kwhere
the ith aspect term is represented by Ai,Sa={A1,A2, ..AK}. Further, the ith aspect
term, Ai, contains Minumber of words such that Mi[1;N)represented by Ai=
{wAi1,wAi2, ..wAiMi}. By the virtue of aspects not overlapping each other, K
i=1MiN
holds.
We use the above BERT model to get word embedding of the input sentence and all
the aspect terms in the sentence. First, we construct the input as “[CLS] + input + [SEP]”
1Legal-BERT model - https://osf.io/s8dj6/
A Deep Learning Model for Aspect-Based Sentiment Analysis for the Legal Domain 5
Sentence-State LSTM
BERT Embedding
Input Sentence Aspects(a1,a2,a3,a4)
Dependency graph
GCN
Classifier
Position-aware Attention
...
...
...
...
...
Fig. 1. Overall architecture
and feed it to the BERT tokenizer. The special token [CLS] is added at the beginning of
our text and the special token [SEP] is added to mark the end of a sentence. The BERT
tokenizer then outputs tokens which correspond to BERT vocabulary. After mapping
the token strings to their vocabulary indices, indexed tokens are next fed into the BERT
model. Each word of the context and aspects are represented by a 768 dimensional
embedding vector. The BERT model is used only for the word embedding purpose.
3.2 RNN Layer
In order to capture the contextual details for every word, on the top of the embedding
layer we use Sentence-State LSTM (S-LSTM) [21]. Most of the existing model archi-
tectures use LSTM, Bi-LSTM, and Bi-GRU as the encoder. LSTM processes sequential
data while maintaining long-term dependencies. However, when encoding long sen-
tences the performance degrades. In our domain (legal documents), the sentences are
comparatively longer than that of other domains. Therefore, aiming to address these
limitations of existing deep-learning approaches, we leverage a sentence state LSTM
(S-LSTM) to capture contextual information due to its proven performance [22]. In-
stead of sequentially processing words, the S-LSTM simultaneously models the hidden
states of all words in each recurrent time stage.
After feeding the word embeddings of a sentence to the S-LSTM model, it returns
the contextual state Htof the sentence which consists of a sub hidden state ht
ifor each
word wiand a sentence-level sub hidden state stas shown in the equation 1.
Ht=<ht
0,ht
1,ht
1,ht
2, ..., ht
n1,st>(1)
6 Isanka Rajapaksha et al.
In our architecture, we use S-LSTM in order to get contextual hidden output of the
sentence and contextual hidden outputs of aspects.
3.3 Position Aware Attention Mechanism
In a sentence, the sentiment polarity is heavily associated with the aspect-words and
opinion terms of the sentence. Hence, the method that we adopt to rely on these aspect-
terms is quite important in the process of sentiment analysis. The main weakness of
RNN models is the inability to understand the most critical parts of the sentence for
sentiment analysis. As a solution to this, we employ an attention mechanism which can
grab the most important parts in a sentence. However, every word in a sentence is not
equally important for determining sentiment polarity. Words which are closer to the tar-
get or having modifier relation to the target word should be given higher weights [23].
To ease this problem, we used an attention mechanism incorporating position informa-
tion of each word in the sentence based on the current aspect term. We use position
information here to incorporate the claim by He et al. [23] that the aspect sentiment
polarity is mainly influenced by the context words that are situated very close to the
target aspect.
Lee was found guilty because the attorney had provided constitutionally ineffective assistance
[0,6] [1,5] [2,4] [3,3] [4,2] [5,1] [6,0] [7,1] [8,2] [9,3] [10,4] [11,5]
Fig. 2. Basic relative distances to the aspects Lee and attorney
found
Lee was guilty
provided
attorney had assistence
the ineffective
constitutionally
[0,3] [2,3][2,3]
[1,2]
[2,1]
[3,0]
[4,1]
[3,2][3,2]
[4,3]
[5,4]
Fig. 3. Distances along the dependency tree to the aspects Lee and attorney
Here we used the bidirectional attention mechanism introduced by Zhao et al. [20]
with two attention modules as context-to-aspect attention module and aspect-to-context
attention module. We followed the same methodology for the calculation of attention
weights. However, for position-aware representation, we used the distances along the
dependency tree instead of the basic relative distances used in their approach. In our
approach, as the distance, the length of the path from the specific word to the aspect in
the dependency tree is used to encode the syntactic structure of the legal text. Fig. 2 il-
lustrates the example sentence with basic relative distances to aspects and Fig. 3 shows
A Deep Learning Model for Aspect-Based Sentiment Analysis for the Legal Domain 7
distances along the dependency tree. When considering the two types of distances, we
can see that the vital opinion words such as guilty and ineffective are closer to the rele-
vant aspects in the Fig. 3 than in Fig. 2. The sentences in the court cases are compara-
tively much longer than other domains. Hence, opinion words are sometimes not close
to the target. Therefore it is not suitable to get the basic relative distance between each
word and the current aspect for position representation. The final output of the attention
mechanism is the Aspect-specific representation between the target aspect (party) and
context words given as X= [x1,x2,.., xK]where Kdenotes the number of aspects.
3.4 Graph Convolution Network
In order to capture the inter-dependencies between multiple aspects/parties in a sen-
tence, we used GCN in our study following the observations reported by Zhao et al.
[20] in their study. GCNs can be identified as a basic and efficient convolution neural
network running on graphs which has the ability to collect interdependent knowledge
from rich relational data. As the first stage of implementing the GCN layer, it is needed
to construct a graph which we name as Sentiment Graph, where a node is a party (as-
pect) mentioned in the sentence and an edge is the inter-dependency relation between
two nodes. If there is a dependency relationship between two parties in the sentence, we
denote that by marking an edge between the corresponding two nodes. As shown in the
Fig. 4, when creating the Sentiment Graph, we initially defined a fully-connected graph
assuming that each aspect has a relationship with every other aspect of the sentence.
Fig. 4. Sentiment Graph
GCN generates a new vector representation for each node by discovering all relevant
information about the neighboring nodes of the selected node. Moreover, when generat-
ing the new vector representation, it is needed to put attention on the information of the
node itself. For that, we assume that each node has a self-loop. The new representation
for a node can be defined as shown in the equation 2 where given vnode, N(v)defines
the all neighbors of v,Wcross Rdm×dn,Wsel f Rdm×dn,bcross Rdm×1,bsel f Rdm×1,
xuis the uth aspect-specific representation taken from the output of attention layer.
x1
v=ReLU(
uN(v)
Wcrossxu+bcross) + ReLU(Wsel f xv+bsel f )(2)
We can expand the neighborhood for each node by stacking multiple GCN layers.
As the input, each GCN layer gets the output form the previous layer and returns the
8 Isanka Rajapaksha et al.
new node representation. From the experiments, we identified that using more than two
GCN layers reduces the accuracy. Therefore in our case, we use two GCN layers (see
Eq. 3).
x2
v=ReLU(
uN(v)
W1
crossx1
u+b1
cross) + ReLU(W1
sel f x1
v+b1
sel f )(3)
3.5 Sentiment Classification
Once the output of the GCN layer(x) is obtained, it is fed to a So f t max layer to obtain
a probability distribution over polarity decision space of Cclasses (where Wand Bare
the learned weights and bias):
z=So f t max(Wx +b)(4)
3.6 Model Training
The model is trained by the gradient descent algorithm with cross entropy loss and L2
regularization.
Loss =
C
c=1
ylog ˆy+λ||θ||2(5)
Cdenotes the number of classes (3 in our case), yis the true label, ˆyis the predicted
label, θdenotes all the parameters that need to regularized, and λis the coefficient of
L2-regularization.
4 Experiments
4.1 Dataset
Experiments and evaluations were carried out on the SigmaLaw-ABSA [2] data set
which consists of 2000 human-annotated legal sentences taken from previous court
cases. The said court cases were originally fetched from the SigmaLaw - Large Le-
gal Text Corpus and Word Embedding data set [9]. To the best of our knowledge
SigmaLaw-ABSA is the only existing dataset for the Aspect-Based Sentiment Anal-
ysis in the legal domain. The dataset has been annotated by legal experts and it contains
entities of different parties, their polarities, aspect category (Petitioner or defendant),
and the category polarities. The data set has been designed to perform various research
tasks in the legal domain including aspect extraction, polarity detection, aspect category
identification, aspect category polarity detection. It is the only existing dataset for the
aspect based sentiment analysis in the legal domain.
Legal sentence, members of legal parties in sentence, their polarities are the fields
used for this study from the SigmaLaw-ABSA dataset. We feed the legal sentence as the
input sentence and the legal party members as aspects into the BERT model. Polarity
of the legal party members are used to evaluate the model.
A Deep Learning Model for Aspect-Based Sentiment Analysis for the Legal Domain 9
4.2 Parameter Setting
For experiments, word embeddings for both context and targets are initialized by using
300-dimensional pretrained Glove word vectors and 760-dimensional Bert embeddings.
Dimension of hidden state vectors of RNN is set to 300 and weights of the model are
randomly initialized with uniform distribution. 600 is set as the output dimension of the
GCN layer. We used Spacy2to calculate the distance through the dependency tree for
attention mechanism and hidden states of the attention layer are set to 300. During the
training, we set the batch size to 16, dropout to 0.1, coefficient of L2 is 105, and used
Adam optimizer with a learning rate of 0.001.
4.3 Word Embedding Models Comparison
In our experiments, we tried two word embedding methods: 300-dimensional GloVe [24]
and BERT [25]. In BERT, two different BERT models were tried for the embedding
layer: the base uncased English model and the pre-trained BERT model specially fine-
tuned for the legal corpus. Table 1 shows the comparison of the results of above models.
The legal-BERT model outperformed the other models. The BERT models use 12 layers
of transformer encoders, and each output per token from each layer of these and initial
input embedding can be used as a word embedding. We tried various vector combina-
tions of hidden layers to get state-of-art results. Table 2 illustrates the result of various
word-embedding strategies using the BERT model for legal domain.
4.4 RNN Models Comparison
LSTM, Bi-LSTM, Bi-GRU and Sentence-State LSTM (S-LSTM) models were tested as
the encoder for our approach as shown in Table 3. As S-LSTM offers richer contextual
information exchange with more parallelism compared to BiLSTMs, it outperformed
the other models. This is because it has strong representation power compared to the
other RNNs [21]. This feature became relevant given that the sentences of Legal docu-
ments are often long and have a complex semantic structure.
4.5 Overall Performance
The experimental results generated on different existing models using the SigmaLaw-
ABSA dataset [2] are shown in Table 4. By analysing the obtained results, we can
conclude that, in the legal domain our proposed model outperforms every other existing
model. We claim that it is mainly due to the complexity and the length of the sentences
in the legal domain as it makes it difficult to those models to understand the sentence to
an adequate degree.
2Spacy Toolkit - https://spacy.io/
10 Isanka Rajapaksha et al.
Table 1. Word embedding models comparison
Model Accuracy F1 score
GloVe [24] 0.6615 0.5798
BERT (base) [25] 0.6997 0.6193
BERT (legal domain) [26] 0.7068 0.6281
Table 2. Different word embedding strategies com-
parison of BERT model
Strategy Accuracy F1 score
Initial embedding 0.6670 0.5705
Last hidden layer 0.6921 0.6193
Concat last 4 layers 0.6987 0.6105
Sum all layers 0.6954 0.6098
Sum last 4 layers 0.7086 0.6281
Table 3. RNN models comparison
Model Accuracy F1 score
LSTM 0.6721 0.5964
Bi-LSTM 0.6987 0.6204
Bi-GRU 0.6854 0.6045
S-LSTM 0.7086 0.6281
Table 4. Performances of Different Models
on SigmaLaw-ABSA
Model Accuracy F1 score
TD-LSTM [14] 0.6512 0.5647
TC-LSTM [14] 0.6182 0.5438
AE-LSTM [15] 0.6228 0.5588
AT-LSTM [15] 0.6272 0.5592
ATAE-LSTM [15] 0.6542 0.5802
IAN [18] 0.6332 0.5650
PBAN [27] 0.6332 0.5650
Cabasc [28] 0.6123 0.5643
RAM [17] 0.6639 0.6022
MemNet [29] 0.5389 0.4361
SDGCN [20] 0.6781 0.6121
ASDGCN [19] 0.6699 0.6001
SigmaLaw-PBSA 0.7086 0.6281
4.6 Ablation Study
In order to study the efficiency of the various modules in our proposed approach, we
conducted an ablation study on the SigmaLaw-ABSA dataset as shown in Table 5. It
is observed that removing both attention mechanisms and GCN drops the F1 score by
0.0617. Introducing the attention mechanism (with dependency tree distance) to the
baseline increases the F1 score by 0.0439. This verifies the significance of the position-
aware attention mechanism. The results gained from using the dependency tree distance
to calculate position weights shows higher performance than the calculating position
weights through basic relative distances. This verifies the impact of the syntactic infor-
mation introduced by the dependency trees.
Further, we can see that the model shows higher results with the introduction of
the GCN layer. Therefore we can conclude that the GCN layer contributes significantly
to increase the results since it helps to capture the inter-dependencies among multiple
aspects and relationships between words at long ranges.
5 Conclusion
We analysed the existing deep-learning based model architectures and pointed out suit-
able model components for tackling the challenges of the legal domain. Accordingly,
A Deep Learning Model for Aspect-Based Sentiment Analysis for the Legal Domain 11
Table 5. Results of ablation study
Setting Accuracy F1 score
Base 0.6287 0.5664
Base + Attention (relative distance) 0.6689 0.5989
Base + Attention (dependency tree distance) 0.6793 0.6103
Base + Attention (dependency tree distance) + 1 layer GCN 0.6938 0.6215
Base + Attention (dependency tree distance) + 2 layer GCN 0.7086 0.6281
we introduced a deep learning-based approach to perform party-based sentiment anal-
ysis in legal opinion texts. First, the model utilizes a pre-trained BERT model (further
fine tuned on a legal corpus) for a strong word embedding. Then, the model employs a
position-aware attention mechanism, to capture the critical parts of the sentence relevant
to aspects, with incorporating position information, using the dependency tree. Because
multiple legal party members are involved in a single sentence, a GCN is employed
over the attention mechanism to model the inter-dependencies between members. Ex-
periments were carried out using the SigmaLaw-ABSA dataset and the experimental
results demonstrate that our proposed approach outperforms all other existing state-of-
art ABSA models.
References
[1] I. Rajapaksha, C. R. Mudalige, D. Karunarathna, N. de Silva, G. Rathnayaka, and A. S.
Perera, “Rule-based approach for party-based sentiment analysis in legal opinion texts,” in
2020 20th International Conference on Advances in ICT for Emerging Regions (ICTer).
[2] C. R. Mudalige, D. Karunarathna, I. Rajapaksha, N. de Silva, G. Ratnayaka, A. S. Per-
era, and R. Pathirana, “Sigmalaw-absa: Dataset for aspect-based sentiment analysis in legal
opinion texts,” in 2020 IEEE 15th International Conference on Industrial and Information
Systems (ICIIS). IEEE.
[3] C. Samarawickrama, M. de Almeida, N. de Silva, G. Ratnayaka, and A. S. Perera, “Party
Identification of Legal Documents using Co-reference Resolution and Named Entity Recog-
nition,” in 2020 IEEE 15th International Conference on Industrial and Information Systems.
[4] M. de Almeida, C. Samarawickrama, N. de Silva, G. Ratnayaka, and A. S. Perera, “Legal
Party Extraction from Legal Opinion Text with Sequence to Sequence Learning,” in 2020
20th International Conference on Advances in ICT for Emerging Regions (ICTer), 2020.
[5] S. Moralwar and S. Deshmukh, “Different approaches of sentiment analysis,International
Journal of Computer Sciences and Engineering, vol. 3, no. 3, pp. 160–165, 2015.
[6] K. Schouten and F. Frasincar, “Survey on aspect-level sentiment analysis,IEEE Transac-
tions on Knowledge and Data Engineering, vol. 28, no. 3, 2015.
[7] A. Bhoi and S. Joshi, “Various approaches to aspect-based sentiment analysis,” ArXiv, vol.
abs/1805.01984, 2018.
[8] M. Pontiki, D. Galanis, H. Papageorgiou et al., “Semeval-2016 task 5: Aspect based senti-
ment analysis,” 01 2016, pp. 19–30.
[9] K. Sugathadasa, B. Ayesha, N. de Silva, A. S. Perera, V. Jayawardana, D. Lakmal, and
M. Perera, “Synergistic Union of Word2Vec and Lexicon for Domain Specific Semantic
Similarity,” IEEE International Conference on Industrial and Information Systems (ICIIS),
pp. 1–6, 2017.
12 Isanka Rajapaksha et al.
[10] “Lee v. United States,” in US, vol. 432, no. No. 76-5187. Supreme Court, 1977, p. 23.
[11] V. Gamage, M. Warushavithana, N. de Silva, A. S. Perera, G. Ratnayaka, and T. Rupas-
inghe, “Fast Approach to Build an Automatic Sentiment Annotator for Legal Domain using
Transfer Learning,” in Proceedings of the 9th Workshop on Computational Approaches to
Subjectivity, Sentiment and Social Media Analysis, 2018.
[12] G. Ratnayaka, T. Rupasinghe, N. de Silva, V. Gamage, M. Warushavithana, and A. S.Perera,
“Shift-of-Perspective Identification Within Legal Cases,” in Proceedings of the 3rd Work-
shop on Automated Detection, Extraction and Analysis of Semantic Information in Legal
Texts, 2019.
[13] R. Piryani, V. Gupta, V. K. Singh, and U. Ghose, “A linguistic rule-based approach for
aspect-level sentiment analysis of movie reviews,” in Advances in Computer and Computa-
tional Sciences. Springer, 2017, pp. 201–209.
[14] D. Tang, B. Qin, X. Feng, and T. Liu, “Effective lstms for target-dependent sentiment clas-
sification,” arXiv preprint arXiv:1512.01100, 2015.
[15] Y. Wang, M. Huang, X. Zhu, and L. Zhao, “Attention-based lstm for aspect-level sentiment
classification,” in Proceedings of the 2016 conference on empirical methods in natural lan-
guage processing, 2016.
[16] J. Cheng, S. Zhao, J. Zhang, I. King, X. Zhang, and H. Wang, “Aspect-level sentiment
classification with heat (hierarchical attention) network,” in Proceedings of the 2017 ACM
on Conference on Information and Knowledge Management, 2017, pp. 97–106.
[17] P. Chen, Z. Sun, L. Bing, and W. Yang, “Recurrent attention network on memory for aspect
sentiment analysis,” in Proceedings of the 2017 conference on EMNLP, 2017.
[18] D. Ma, S. Li, X. Zhang, and H. Wang, “Interactive attention networks for aspect-level sen-
timent classification,” arXiv preprint arXiv:1709.00893, 2017.
[19] C. Zhang, Q. Li, and D. Song, “Aspect-based sentiment classification with aspect-specific
graph convolutional networks,arXiv preprint arXiv:1909.03477, 2019.
[20] P. Zhao, L. Hou, and O. Wu, “Modeling sentiment dependencies with graph convolutional
networks for aspect-level sentiment classification,Knowledge-Based Systems, vol. 193, p.
105443, 2020.
[21] Y. Zhang, Q. Liu, and L. Song, “Sentence-state LSTM for text representation,” in ACL,
2018.
[22] P. Demotte, L. Senevirathne, B. Karunanayake, U. Munasinghe, and S. Ranathunga, “Sen-
timent analysis of sinhala news comments using sentence-state lstm networks,” in 2020
Moratuwa Engineering Research Conference (MERCon), 2020, pp. 283–288.
[23] R. He, W. S. Lee, H. T. Ng, and D. Dahlmeier, “Effective attention modeling for aspect-level
sentiment classification,” in Proceedings of the 27th international conference on computa-
tional linguistics, 2018, pp. 1121–1131.
[24] J. Pennington, R. Socher, and C. Manning, “GloVe: Global vectors for word representation.”
Association for Computational Linguistics, Oct. 2014, pp. 1532–1543.
[25] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of deep bidirec-
tional transformers for language understanding.” ACL, Jun. 2019, pp. 4171–4186.
[26] G. Ratnayaka, N. de Silva, A. S. Perera, and R. Pathirana, “Effective approach to de-
velop a sentiment annotator for legal domain in a low resource setting,arXiv preprint
arXiv:2011.00318, 2020.
[27] S. Gu, L. Zhang, Y. Hou, and Y. Song, “A position-aware bidirectional attention network
for aspect-level sentiment analysis,” in Proceedings of the 27th International Conference
on Computational Linguistics. ACL, Aug. 2018.
[28] Q. Liu, H. Zhang, Y. Zeng, Z. Huang, and Z. Wu, “Content attention model for aspect based
sentiment analysis,” in Proceedings of the 2018 World Wide Web Conference, 2018.
[29] D. Tang, B. Qin, and T. Liu, “Aspect level sentiment classification with deep memory net-
work,” arXiv preprint arXiv:1605.08900, 2016.
... However, conversely, this has added a de facto expectation on businesses to understand the user sentiments expressed in these texts if they intend to make informed decisions and enhance customer satisfaction. Aspect-based sentiment analysis (ABSA) has emerged as a valuable technique in Natural Language Processing (NLP) to analyze opinions at a finer granular level by identifying sentiment towards specific aspects or features within a given domain [1][2][3][4][5][6]. In this paper, we focus on domain-specific ABSA [2][3][4], particularly focusing on its application in analyzing customer reviews, which provides valuable feedback for businesses to improve their products or services. ...
... Aspect-based sentiment analysis (ABSA) has emerged as a valuable technique in Natural Language Processing (NLP) to analyze opinions at a finer granular level by identifying sentiment towards specific aspects or features within a given domain [1][2][3][4][5][6]. In this paper, we focus on domain-specific ABSA [2][3][4], particularly focusing on its application in analyzing customer reviews, which provides valuable feedback for businesses to improve their products or services. ...
Conference Paper
Full-text available
Since the onset of the digital era, customer feedback and online reviews have emerged as indispensable sources of insights for businesses. Consequently, conducting comparative analyses of such data has become the de facto strategy for organizations striving to gain a competitive edge and enhance customer retention. Among the analytical methods employed, sentiment analysis plays a pivotal role in gauging public perception, uncovering market trends, and benchmarking competitors. While traditional sentiment analysis focuses on the overall sentiment of a text, evolving business needs have necessitated more granular insights—particularly those relating to specific products, services, or features mentioned in customer feedback. This demand has given rise to Aspect-Based Sentiment Analysis (ABSA), a subfield of sentiment analysis that aims to identify distinct aspects within textual content and determine the sentiment expressed towards each of them. Empowered by advances in Artificial Intelligence (AI) and deep learning, ABSA has enabled a shift from basic word-level analysis to more context- and tone-aware evaluations, allowing systems to capture nuanced user opinions with high precision. As a result, ABSA provides a more fine-grained understanding of consumer sentiment, supporting businesses in targeted decision-making and personalized service improvements.
... Due to the need to process large numbers of documents and records in the legal research process efficiently, many AI-based NLP techniques are applicable in this field (Nay 2021). The state-of-the-art AI-based techniques of legal text summarization (Bhattacharya et al. 2021) and of sentiment analysis to extract content and retrieve key information from legal documents (Rajapaksha et al. 2021) have become the subject of recent research by AI scientists. Rajapaksha et al. (2021) introduced the Sigmalaw PBSA model to predict the sentiment value of sentences in legal documents in relation to their legal parties. ...
... The state-of-the-art AI-based techniques of legal text summarization (Bhattacharya et al. 2021) and of sentiment analysis to extract content and retrieve key information from legal documents (Rajapaksha et al. 2021) have become the subject of recent research by AI scientists. Rajapaksha et al. (2021) introduced the Sigmalaw PBSA model to predict the sentiment value of sentences in legal documents in relation to their legal parties. Their approach employs a fine-grained, deep-learning-based sentiment analysis (aspect-based sentiment analysis) technique to achieve this, and outperforms the state-of-the-art models on the SigmaLaw-ABSA dataset (Ruchini et al. 2020), which comprises 2,000 legal opinions fetched from a public online database. ...
Article
Full-text available
Many countries employ systemic methods of protecting consumers from unfair business practices. One such practice is the use of abusive clauses in business-to-consumer (B2C) contracts, which unfairly impose additional obligations on the consumer or deprive them of their due rights. This article presents an information system that utilizes artificial intelligence methods to automate contract analysis and to detect abusive clauses. The goal of the system is to support the entire administrative process, from contract acquisition, through text extraction and the recommendation of potentially abusive clauses, to the generation of official administrative documents that can be sent to court or to the owners of firms. This article focuses on the components that use machine learning methods. The first is an intelligent crawler that is responsible for automatically detecting contract templates on websites and retrieving them into the system. The second is a document analysis module that implements a clause recommendation algorithm. The algorithm employs transformer-based language models and information retrieval methods to identify abusive passages in text. Our solution achieved first place in a competition on the automatic analysis of B2C contracts organized by the Polish Office of Competition and Consumer Protection (UOKiK), and has since been implemented as an official tool to support the contract analysis process in Poland.
... Alturaief et al. [6] is the first study that highlighted the use of supervised ABSA to analyze app reviews. ABSA is a subtask of sentiment analysis that extracts sentiment for different available aspects of entities as opposed to finding the overall sentiment for all texts [17][18][19]. The ABSA process can be separated into three sub-tasks, including identifying aspects and extracting them, and separating them into positive or negative categories based on the points of view expressed about each element in the text. ...
Conference Paper
Full-text available
With the popularity of smartphones, mobile application (A.K.A Mobile App) development has become a booming industry all across the world. One of the main hurdles that app developers are facing, is understanding users’ needs and catering their products to satisfy the users. Though Users are one of the main stakeholders of the App development process it is harder to incorporate them into the requirement elicitation process. Numerous studies have shown that incorporating user reviews in the requirement elicitation process paves the way to a better understanding of user needs which, in turn, helps developers develop better apps that satisfy the targeted audience of the app. In this paper, we introduce a CNN-based approach to analyze user reviews using Aspect-based Sentiment Analysis (ABSA). The results show that our approach could achieve 87.88%, 93.75%, and 31.25% improvements in aspect category classification and 16.43%, 23.35%, and 3.72% improvements in aspect sentiment classification over the baseline results for AWERE dataset in productivity, social networking, and game domains respectively. Keywords—Convolutional Neural Networks, Aspect Based Sentiment Analysis, Mobile App Reviews, Requirement Elicitation
... Specific traits in the language used in this field have challenged the researchers and developers working on NLP tools to tackle the existing defects in those tools and has constantly pushed them to significantly improve their work. Ontology population [Jayawardana et al. 2017a,b,c], discourse [Ratnayaka et al. 2019a[Ratnayaka et al. , 2019b, semantic similarity [Sugathadasa et al. , 2018, and sentiment analysis Rajapaksha et al. , 2021] are some areas where extensive work has been carried out concerning the legal domain. ...
Conference Paper
Full-text available
In the field of natural language processing, domain specific information retrieval using given documents has been a prominent and ongoing research area. The automatic extraction of the legal parties involved in a legal case has a significant impact on the proceedings of legal cases. This is a study proposing a novel way to extract the legal parties involved in a given legal document. The motivation behind this study is that there is the absence of a proper automated system to accurately identify the legal parties in a legal document. We combined several existing natural language processing annotators together with a sequence to sequence learning model to achieve the goal of extracting legal parties in a given court case document. Then, our methodology was evaluated with manually labeled court case sentences. The outcomes of the evaluation demonstrate that our system is successful in identifying legal parties.
Conference Paper
Full-text available
In the field of natural language processing, domain-specific information retrieval using given documents has been a prominent and ongoing research area. Automatic extraction of the legal parties (petitioner and defendant sets) involved in a legal case has a significant impact on the proceedings of legal cases. This is a study proposing a novel way to identify the legal parties in a given legal document. The motivation behind this study is that there are no proper existing systems to accurately identify the legal parties in a legal document. We combined several existing natural language processing annotators to achieve the goal of extracting legal parties in a given court case document. Then, our methodology was evaluated with manually labelled court case paragraphs. The outcomes of the evaluation demonstrate that our system is successful in identifying legal parties.
Article
Aspect-level sentiment classification aims to distinguish the sentiment polarities over one or more aspect terms in a sentence. Existing approaches mostly model different aspects in one sentence independently, which ignore the sentiment dependencies between different aspects. However, such dependency information between different aspects can bring additional valuable information for aspect-level sentiment classification. In this paper, we propose a novel aspect-level sentiment classification model based on graph convolutional networks (GCN) which can effectively capture the sentiment dependencies between multi-aspects in one sentence. Our model firstly introduces bidirectional attention mechanism with position encoding to model aspect-specific representations between each aspect and its context words, then employs GCN over the attention mechanism to capture the sentiment dependencies between different aspects in one sentence. The proposed approach is evaluated on the SemEval 2014 datasets. Experiments show that our model outperforms the state-of-the-art methods. We also conduct experiments to evaluate the effectiveness of GCN module, which indicates that the dependencies between different aspects are highly helpful in aspect-level sentiment classification¹ .
Conference Paper
Aspect based sentiment classification is a crucial task for sentiment analysis. Recent advances in neural attention models demonstrate that they can be helpful in aspect based sentiment classification tasks, which can help identify the focus words in human. However, according to our empirical study, prevalent content attention mechanisms proposed for aspect based sentiment classification mostly focus on identifying the sentiment words or shifters, without considering the relevance of such words with respect to the given aspects in the sentence. Therefore, they are usually insufficient for dealing with multi-aspect sentences and the syntactically complex sentence structures. To solve this problem, we propose a novel content attention based aspect based sentiment classification model, with two attention enhancing mechanisms: sentence-level content attention mechanism is capable of capturing the important information about given aspects from a global perspective, whiles the context attention mechanism is responsible for simultaneously taking the order of the words and their correlations into account, by embedding them into a series of customized memories. Experimental results demonstrate that our model outperforms the state-of-the-art, in which the proposed mechanisms play a key role.