CharAs-CBert: Character Assist Construction-Bert Sentence Representation Improving Sentiment Classification
1School of Artificial Intelligence, Beijing Normal University, No. 19, Xinjiekouwai St., Haidian District, Beijing 100875, China; bochen@mail.bnu.edu.cn (B.C.); pengweiming@bnu.edu.cn (W.P.)
Abstract
In the process of semantic capture, traditional sentence representation methods tend to lose a lot of global and contextual semantics and ignore the internal structure information of words in sentences. To address these limitations, we propose a sentence representation method for character-assisted construction-Bert (CharAs-CBert) to improve the accuracy of sentiment text classification. First, based on the construction, a more effective construction vector is generated to distinguish the basic morphology of the sentence and reduce the ambiguity of the same word in different sentences. At the same time, it aims to strengthen the representation of salient words and effectively capture contextual semantics. Second, character feature vectors are introduced to explore the internal structure information of sentences and improve the representation ability of local and global semantics. Then, to make the sentence representation have better stability and robustness, character information, word information, and construction vectors are combined and used together for sentence representation. Finally, the evaluation and verification are carried out on various open-source baseline data such as ACL-14 and SemEval 2014 to demonstrate the validity and reliability of sentence representation, namely, the F1 and ACC are 87.54% and 92.88% on ACL14, respectively.
Untitled section
Keywords: sentence representation, sentiment classification, internal structure information, construction vector, character vector
Article notes
Untitled section
Received 2022 Jun 9; Accepted 2022 Jul 1; Collection date 2022 Jul.
1. Introduction
As one of the important operations of natural language processing, sentence embedding representation is widely used in many tasks such as text classification [1], semantic matching [2], machine translation [3], and knowledge question answering [4]. The current popular sentence representation methods are mainly based on neural networks and pre-trained language models. The most widely used neural network models are long and short-term memory networks [5], as well as convolution [6] and attention models [7], etc. When processing a sentence, these neural network methods are in a smooth order, while the basic structure of the sentence is not considered, meanwhile, in the subsequent sentence synthesis process, the basic syntactic information of the sentence is ignored, such as the obvious difference between the synthesis of “adverb-noun” and “adjective-noun”. When using a simple pre-trained language model BERT [8] to achieve sentence representation, it is easy to lose a lot of sentence details, resulting in sentence representation tasks that are still lower than the traditional Glove word embedding representation method. Therefore, the Bert language model is usually combined with neural network methods. Improving sentence representation has become a new trend.
Unlike convolutional neural networks [6], which are limited by the receptive field, the attention mechanism [7] balances the interrelationships between words in a sentence using weight calculation and assignment, meanwhile, highlighting the representation of salient features. Recurrent neural networks cannot establish effective long-term dependencies in more complex sentence representation tasks due to problems such as gradient disappearance and explosion. The Independent recurrent neural network (IndRNN) [9] improves neuron performance because each neuron has independent spatiotemporal features. The interpretability of the input behavior and the cross-layer connection between them prevents the gradient from disappearing and exploding and promotes the long-term learning of the network to improve the modeling ability of dependencies. In the traditional language model, Bert needs a lot of time for clustering and similarity analysis of sentence pairs to realize the embedded representation of sentences. For example, the sentence-BERT [10] algorithm uses the average value of the BERT output vector for supervised learning to achieve efficient sentence embedding. However, when interpreting sentences, the same word may also be ambiguous in different sentences, that is, the role of a word in a sentence depends on the context of the sentence, not entirely on the word itself. In addition, when two sentences have the same construction, the phrases that make up the sentence may also be quite different. Such constructions as “Not only did they have amazing, sandwiches, soup, pizza, etc, but their homemade sorbets are out of this world!” and “I stumbled upon this restaurant on my way home from the subway.” can be expressed as “NN -1 NN -1 NP -1”, but the internal structure of the phrase represented by “NP” in the construction is very different, and the same sentence construction is used to represent different sentences to guide the two. The compositions of phrases or sentences is irrational. Where the words in the sentence “Not only did they have amazing, sandwiches, soup, pizza, etc, but their homemade sorbets are out of this world!” are “soup” (NN), “pizza” (NN), and “world” “(NP) . In the sentence “I stumbled upon this restaurant on my way home from the subway.” “NN” is “restaurant”, ‘way’, “home”; “NP” is “subway”, the rest are “−1” contains punctuation. Therefore, it is necessary to obtain the internal structure information of the words in the sentence to improve the ability of the construction information to distinguish the basic structure of the sentence.
To alleviate the ambiguity of the same word in different sentences and combine the construction to explore the internal structure information of the sentence, a better sentence representation can be obtained. We propose a sentence representation framework of character-assisted construction Bert to improve the representation of global and contextual semantic information in sentiment texts. The approach has three main contributions:
- When understanding a sentence, the weight of the word processed by BERT is not directly used to explain the sentence, but a slice attention enhancement network is designed to explain these behaviors, assigning salient words in the sentence to the sentence. Higher weight coefficients, meanwhile, explore the channel dependencies and spatial correlations of different salient words in the sentence.
- Based on our sentence construction, we design a bidirectional independent recurrent neural network to explore the construction vector of sentences, alleviate the ambiguity of the same word in different sentences, and promote long-term learning of the network to establish effective long-term dependencies, it realizes the interaction between forward and backward semantic information and improves the model’s ability to perceive contextual details.
- A construction-based character graph convolutional network is designed to explore the internal structural information of salient words in sentences, that is, there is a strong correlation between adjacent characters in each salient word. Features strengthen construction information to improve the ability of construction information to distinguish the basic structure of sentences. Furthermore, we design a triple loss function to better tune and optimize the network to learn better sentence representations.
The rest of this paper is organized as follows: Section 2 presents the related research work on sentence representation and sentiment classification; Section 3 details our proposed CharAs-CBert sentence representation framework and introduces the internal components of the framework in Section 3.1 and Section 3.2, respectively; experimental results and analysis are presented in Section 4; conclusions and future research plans are drawn in Section 5.
3. CharAs-CBert Framework
To alleviate the ambiguity of the same word in different sentences and explore the internal structure information of salient words in sentences by combining construction information, we developed a sentence representation framework of character-assisted construction-Bert (CharAs-CBert) to improve the classification performance of downstream tasks such as emotion classification. The overall network structure of CharAs-CBert is shown in Figure 1.
The CharAs-CBert sentence representation framework is mainly composed of three parts, namely the BERT initial embedding module with character and construction information, the characters auxiliary module, and the downstream sentiment classification module. Among them, the BERT embedding module of characters and constructions aims to map words and the characters that make up words into a low-dimensional space according to the sentence construction, making it easier to represent sentences; the character auxiliary module uses characters graph convolution (CharGCM) starting from the smallest unit that constitutes a sentence, that is, characters, it explores the internal structural information of sentences and improves the representation ability of salient words. Based on the sentence construction, we model its long-term dependencies with the help of a bidirectional independent recurrent neural network (BIRM), and realize information interaction from forward and reverse; in addition, we utilize the slice attention module (SAM) from two perspectives, such as channel and space. Model the importance of each word in a sentence and assign a higher weight ratio to keywords. At the same time, considering that the prior knowledge contains rich underlying semantics, we introduce prior word vector knowledge to improve the sentence representation ability. SoftMax classifiers are designed to perform downstream tasks such as sentiment classification.
3.2. Sliced Attention Module (SAM)
Although the word vector feature of the sentence is effectively obtained by using the BERT [8] language model, the importance of different words in the sentence is different. To highlight the representation ability of the keyword and the important role of the keyword, we designed a slice attention module. We model it from both channel and space perspectives to capture the channel dependencies and spatial correlations of words in a sentence, and combine them to achieve more effective word vector features, which is helpful for subsequent sentence representation.
For a given feature vector , we first slice it along the channel to obtain slice groups, i.e., , secondly, we input each slice group into the channel attention and spatial attention [7,25] components, obtain the semantic responses of the features and generate a corresponding significance coefficient for each slice group feature. The specific calculation process is shown as
where indicates the operation of channel attention; indicates the operate of spatial attention; indicates Group Norm operate; indicates weight matrix; b indicates bias matrix; · means dot product; indicates activation function of .
Channel attention uses a simple global average pooling layer to generate channel-level statistics to embed global words; unlike channel attention, spatial attention focuses on where the informative parts are located, which is complementary to channel attention. Therefore, to simultaneously channel and spatially model the input information, f and c are aggregated together for the attention feature of this slice group. Specifically as shown as
where represents simple splicing and fusion.
3.3. Bidirectional Independent Recurrent Module (BIRM)
Considering that in the process of sentence extraction, the recurrent neural network is prone to problems such as gradient disappearance and explosion. At the same time, it is difficult to establish effective long-term dependencies, and it is difficult to explain the input behavior due to the entanglement of neurons. Although Long Short-Term Memory (LSTM) [5] can effectively solve a series of problems existing in recurrent neural networks [9], the use of hyperbolic tangent and sigmoid activation functions leads to hierarchical gradient decay, which cannot effectively capture the detailed features of sentences. Therefore, to address these limitations for more efficient sentence representations, we design a bidirectional independent recurrent neural network module (BIRM), which models the construction information from both forward and backward directions and realize the interaction of different directional features, which helps to obtain global and contextual details. In addition, the neurons in the same layer in this module are independent of each other, which is beneficial to the interpretation of input behavior. At the same time, the information flow is realized between different layers. Cross-layer connections help to model detail semantics and better transfer detail semantics to lower layers. The specific description of BIRM is as follows.
Among them, and represent the weight matrix of the forward and backward layers; ⊙ represents the Hadamard product. and represents the output feature of the z-1 layer in the forward-backward direction; represents the bias matrix; represents the activation function of ; each neuron in the network layer is independent of each other, and the connection between neurons can be achieved by stacking multiple layers. For the neuron, the output features of the front and rear directions are as follows
where and represent the input weight matrix and the circular weight matrix of the layer, respectively.
Each neuron in only accepts information from the input and its hidden state at the previous time step. That is, each neuron in independently processes a spatiotemporal pattern, i.e., independently aggregates spatiotemporal detail features over time by u. In addition, to obtain more efficient feature representations and avoid the catastrophic forgetting problem when the time is long, we use the residual method to connect multiple bidirectional independent recurrent modules. At the same time, to model the input construction information in two directions, such as forward and reverse, to improve the representation of contextual semantics, we fuse them. The fusion is shown as
where represents the splicing operation.
3.4. Characters Graph Convolution Module (CharGCM)
Characters are the smallest units that make up a word, and the adjacent relationship between them reflects the internal structural information of the word. A sentence usually contains multiple constructions, and the constructions of different sentences may also be the same. When the constructions of different sentences are the same, it is not conducive to distinguishing between different sentences. Therefore, obtaining character information of words in a sentence is helpful for sentences. The distinction between representation and basic structure. For example, the subjective attitude of the sentence “We would return to this place again!” is “”, and the subjective attitude of the sentence “Too bad the food wasn’t of the same heritage.” is “”, but they have the same construction “”. At the same time, there are also great differences in the length and composition of the phrases corresponding to “” and “” in the construction, and it may be better to use character information to distinguish these phrases from the inside. Where “” means determiner; “” means Noun, singular or mass, etc. Therefore, we construct a topological graph of a character, and use graph convolution [26] to optimize and adjust this topological graph, namely the character graph convolution module (CharGCM), to ensure the accuracy of the internal structure information of keywords.
Assuming that each word W in the input sentence x consists of M characters and can be expressed as ; The initial vector features of characters are obtained through the pre-trained language model BERT , where j represents the character in the word; it is worth noting that there are 96 characters in total, including 52 uppercase and lowercase English letters, as well as 10 numbers and other special symbols. The overall characters can be “” etc.
Then, we construct a topology graph from these M characters, such as the word “” in the sentence “We would return to this place again!” which consists of five different characters. Each character can be considered as a graph node , the topology graph is formally represented as , where represents a set of character nodes; , represents the set of edges between nodes, that is, the correlation between characters, g represents the number of edges; the adjacency matrix of the topology graph is shown as
where , indicates the feature information transpose of the node; indicates that there is no edge weight between character nodes, that is, there is no correlation between these two adjacent characters. indicates that the node is a self-looping node.
To obtain better character representations, we use two layers of graph convolutions to aggregate and transfer this graph node information. In the process of transfer and aggregation, to prevent the network from falling into local optimality, Laplace renormalization is introduced to operate the adjacency matrix A, and then, to obtain the character node information, the optimization process of the topology map is as follows
where denotes the degree matrix; I denotes the unit adjacency matrix; denotes the weight matrix; denotes the renormalized adjacency matrix; denotes the character feature after the graph convolution operation; represents the activation function of “”.
To improve the representation accuracy of sentences, we fuse character features, word vector features, and constructional information for sentence representation, and in addition, considering that the prior knowledge contains rich low-level semantic details, we embed it into the sentence representation. The specific operations are as follows.
Among them, and represent the character vectors of sentences A and B, respectively; and represent the word vector features of sentences A and B, respectively; and represent the construction vector features of sentences A and B, respectively; and represent the prior knowledge of sentences A and B, respectively; ⊗ represent element-wise product; represent the connection operation; represent the multilayer perceptron operation.
Finally, the sentence vectors generated after fusion are applied to the downstream sentiment classification task to demonstrate the effect of sentence representation. Specifically as shown as
Among them, represents the classifier; represents the similarity or distance.
To promote the proposed CharAs-CBert framework to obtain better sentence representation and alleviate the error caused by data imbalance, we embed class weights in the loss function, and the specific operations are as follows
where indicates class weights; indicates learning factors; indicates focal loss; indicates multiclass cross entropy loss.
4. Experimental Results and Analysis
In this section, we conduct rich experiments to demonstrate the effectiveness of the proposed CharAs-CBert framework in sentence representation and provide a detailed analysis of the experiments.
4.1. Datasets Preparation
SemEval2014: This dataset is mainly used for fine-grained sentiment classification, including two domains, Laptop and Restaurant, where each domain involves three categories: “positive”, “negative” and “neutral”, at the same time, the dataset of each domain is divided into training samples, validation samples, and test samples.
ACL14: The dataset mainly includes negative, neutral, and positive reviews of celebrity ties, products, and companies, with negative, neutral, and positive sentiment sentences accounting for 25%, 50%, 25%, respectively. Meanwhile, the number of training samples is 6248, and the number of test samples is 692. It is worth noting that each sentiment sentence in these datasets contains multiple different constructions, and Table 1 presents the statistical results of these data.
| Datasets | Restaurant | Laptop | ACL14 | |||
|---|---|---|---|---|---|---|
| Training | Testing | Training | Testing | Training | Testing | |
| Positive | 2164 | 728 | 994 | 341 | 3142 | 346 |
| Negative | 807 | 196 | 870 | 128 | 1562 | 173 |
| Neutral | 637 | 196 | 464 | 169 | 1562 | 173 |
| Consnum charnodes | 100,043 12,891 | 1,105,665 67,235 | 241,546 15,213 | 992,438 37,539 | 819,242 31,028 | 286,552 15,652 |
To demonstrate the effectiveness of the CharAs-CBert sentence representation framework and ensure the smooth progress of subsequent experiments, accuracy (ACC) and F1 values were adopted as evaluation indexes, as shown in the equation
where TP (true positive) indicates that the sample originally belongs to the positive class is divided into positive classes. TN (true negative) indicates that the sample originally belonged to the negative category and is divided into the negative category. FP (false positive) indicates that errors that originally belong to the negative class are divided into positive classes. FN (false negative) indicates that the error that originally belonged to the positive class is classified into the negative class.
4.2. Parameters Settings
Model parameters. In the process of training, some important parameters of the details are as follows: (i) the initial vector set to 3 × , and using the cosine annealing vector (“”) to adjust CharAs-CBert sentence representation framework; (ii) the optimizer is “”; (iii) the number of iterations is 500, and the batch processing is set to 32. In addition, to prevent the model from falling into the local optimal state, the bit loss rate in the CharAs-CBert framework is set to . In the Bi-IndRNN module, we set the initial neural unit to 300, which is the same as the embedded word vector dimension. In the char-GCNs module, the initial number of graph nodes is set to 16 and the number of layers of graph convolution is set to 2.
Environment configuration. The paper uses the platform to implement the CharAs-CBert model. All the code is developed based on . Meanwhile, to ensure the fairness and correctness of the experiment, all the experiments are carried out on two cards.
4.3. Comparison with Other Models
To demonstrate the effectiveness of the proposed CharAs-CBert sentence representation framework, we conducted evaluation and verification on open-source baseline data such as SemEval2014 and ACL14. Table 2 shows the experimental results of different sentence representation methods.
| Model-Datasets | Laptop | Restaurant | ACL14 | |||
|---|---|---|---|---|---|---|
| ACC | ACC | ACC | ||||
| LSTM | 75.38 | 72.24 | 73.98 | 70.07 | 77.42 | 73.19 |
| CNN-LSTM | 76.51 | 73.02 | 74.21 | 70.56 | 78.51 | 74.23 |
| Tree-LSTM | 78.08 | 74.88 | 76.64 | 72.89 | 80.5 | 77.06 |
| BERT-LSTM | 80.92 | 76.73 | 80.48 | 74.9 | 81.54 | 77.96 |
| TG-HRecNN | 82.08 | 79.52 | 80.93 | 75.92 | 82.46 | 80.63 |
| TG-HTreeLSTM | 83.03 | 81.41 | 80.96 | 76.42 | 85.83 | 82.17 |
| TE-DCNN | 87.55 | 83.25 | 83.93 | 78.99 | 87.49 | 83.84 |
| Capsule-B | 88.32 | 84.23 | 85.09 | 80.41 | 91.38 | 85.85 |
| Self-Att [16] | 86.51 | 82.42 | 83.79 | 78.64 | 86.92 | 82.74 |
| SBERT-att [24] | 90.59 | 85.93 | 85.31 | 81.93 | 91.53 | 86.37 |
| CharAs-CBert | 92.19 | 87.03 | 86.22 | 82.96 | 92.88 | 87.54 |
According to Table 1, we can draw the following conclusions:
- The overall performance of our proposed CharAs-CBERT sentence representation framework on the three baseline datasets outperforms other representation models, such as in Laptop, Restaurant, and ACL14 than SBERT-att 1.1%, 1.03% and 1.17%, respectively. There are three possible reasons. First, we use the Slice Attention Module (SAM) to establish long-term dependent salient word representations from two directions, such as channel and space. The performance of sentence representation; second, BIRM and CharGCM are introduced to support construction information, explore the internal structure information of sentences, and highlight the differences between different sentences, resulting in the improvement of sentence representation performance; third, the fusion of three different feature vectors make up for the insufficiency of a single representation and understand sentences from different angles and levels. In addition, the introduction of rich low-level semantics further enhances the difference between sentences, improves the performance of sentence representation, and improves the downstream emotion. Accuracy for classification tasks.
- Compared with BERTS-LSTM and Tree-LSTM sentence representation models, TG-HTreeLSTM and TE-DCNN have certain competitive advantages in three types of data. For example, on the Laptop data, the of TG-HTreeLSTM is 6.53% higher than that of Tree-LSTM. The possible reason is that Tree-LSTM can only process binary selection trees that are different from the original selection tree. Conversely, TG-HTreeLSTM can process the original constituency tree of sentences, resulting in a performance improvement. The good performance of TE-DCNN may be because its dynamic synthesis strategy plays an important role, resulting in better semantic information obtained by the network.
- Capsule-B is improved by 0.98%, 1.42%, and 2.01%, respectively, compared with of TE-DCNN. The possible reason for this is that the capsule network can perceive more effectively due to the directionality of capsule neurons. The subtle changes between different sentences improve the distinguishing ability of sentence structure, thereby improving the representation effect of sentences.
- In the ACL14 baseline data, the ACC of CNN-LSTM is 1.09% higher than that of the LSTM method. The possible reason is that CNN obtains the local spatial features of sentences, LSTM encodes the time series and establishes a complementary relationship between the spatial and temporal features. Improved sentence representation. Thus, the sentence representation accuracy is improved. In contrast, Self-Att achieves better competitive advantages in three sets of open-source baseline datasets, mainly since self-attention focuses on key information and effectively models the local and global semantics of sentences.
To intuitively understand the operating efficiency of different sentence representation models, we give the parameters of different models and the visualization effect of FLOPs, as shown in Figure 2.
According to Figure 1, we can find that the Capsule-B sentence representation method has the largest and . The main reason is that the capsule neuron is a vector neuron, which requires a large number of parameters to participate in the operation in the calculation process to ensure its representation performance. The and of CharAs-CBert we mentioned are not optimal, but within the acceptable range, the framework has the best representation performance.
4.4. Ablation Studies
4.4.1. Different Components of CharAs-CBert
To demonstrate whether the components in the proposed CharAs-CBert sentence representation framework play a positive role in the overall performance of the model, we evaluate and verify different components on three types of data. Table 3 shows the representation results of different components.
| Model-Datasets | Laptop | Restaurant | ACL14 | |||
|---|---|---|---|---|---|---|
| ACC | ACC | ACC | ||||
| CharAs-CBert () | 86.35 | 82.4 | 81.34 | 77.65 | 86.01 | 83.48 |
| CharAs-CBert () | 87.12 | 82.33 | 82.05 | 77.79 | 87.54 | 83.65 |
| CharAs-CBert () | 88.04 | 82.82 | 82.59 | 78.73 | 88.02 | 83.72 |
| CharAs-CBert () | 88.62 | 83.5 | 83.07 | 79.53 | 88.08 | 84.13 |
| CharAs-CBert () | 88.84 | 83.62 | 83.29 | 80.06 | 88.4 | 85.5 |
| CharAs-CBert () | 89.85 | 84.17 | 83.43 | 80.65 | 88.64 | 85.54 |
| CharAs-CBert () | 90.02 | 84.75 | 83.97 | 80.67 | 88.72 | 85.92 |
| CharAs-CBert () | 90.03 | 85.48 | 84.24 | 81.04 | 89.62 | 86.32 |
| CharAs-CBert () | 91.3 | 85.65 | 84.67 | 82.03 | 90.62 | 86.42 |
| CharAs-CBert () | 91.47 | 85.69 | 84.92 | 82.19 | 91.14 | 86.71 |
| CharAs-CBert () | 91.96 | 85.75 | 85.44 | 82.56 | 92.27 | 86.92 |
| CharAs-CBert | 92.19 | 87.03 | 86.22 | 82.96 | 92.88 | 87.54 |
According to Table 3, we draw the following conclusions:
- Compared with the single-structure sentence representation, the multi-feature co-representation method shows better performance. Such as CharAs-CBert () vs. CharAs-CBert (), CharAs-CBert () and CharAs-CBert () on ACL14 baseline datasets increased by 1.27%, 1.78% and 2.02%, respectively. The possible reason is that the multi-feature vector fusion understands the sentence from different angles, and the different feature vectors form complementarity, making up for a single feature vector that is easy to ignore a question of detail semantics. In addition, the CharAs-CBert () method is inferior to the CharAs-CBert () method on the three sets of open-source baseline data, which indicates that the proposed BIRM plays a positive role in the overall performance of the model. A possible reason is that stacking multiple layers of bidirectional independent recurrent neural networks obtains a better global representation.
- On the Laptop baseline data, CharAs-CBert () is better than CharAs-CBert () and CharAs-CBert () is improved by 0.1% and 0.27%, respectively, which shows that our proposed components play a positive role in the overall performance of the model. In addition, we also found that the SAM component has the least positive effect on the model. It may be that the model only uses the word vector to represent the sentence in the absence of construction, ignoring the basic structure of the sentence, and cannot fully obtain the context of the sentence.
- Although has achieved a certain competitive advantage, it is still lower than CharAs-Bert. Building deep BILSTMs for learning key semantics in data is difficult. In contrast, BIRM can be stacked into very deep networks using non-saturating activation functions, etc. We obtain better depth semantics and perceive richer detail changes due to stacking in the form of residuals.
4.4.2. Comparing with Loss Functions
To verify whether the loss function we designed has a positive effect on the CharAs-CBert frameworks and the impact of the class weight () on the model performance. The experimental results are shown in Figure 3.
As can be seen in Figure 3, the sentence representation using class weights is better than other loss functions without class weights. For example, and of are 1.11% and 0.09% higher than , respectively. The possible reason is that the class weights better capture the detailed semantics of few-shot classes. is 0.1%, which shows that the class weight is beneficial to the proposed CharAs-CBert framework to learn better sentence representations.
4.4.3. Comparison of Different Layers
To demonstrate the influence of the number of layers in BIRM and CharGCM on the overall performance of the model, we conduct evaluation and verification on the Restaurant baseline datasets. Figure 4 shows the experimental results of different layers.
From Figure 4, we can see that with the increase in the number of layers in the BIRM and CharGCM components, the sentence representation effects () and show a trend of increasing first and then decreasing. When the number of layers of BIRM is five and the number of layers of CharGCM is two, the sentence representation effect is optimal. For example, when the number of layers of CharGCM is two, the accuracy is higher than that of three layers. The possible reason for this is that a small number of layers cannot fully capture the contextual global semantics of a sentence, and when the number of layers is large, it is easy to reuse redundant information, resulting in a decrease in the accuracy of sentence representation.
5. Conclusions
In this paper, we design a new character-assisted structure BERT sentence representation framework, which utilizes words, structures, and characters to explore the context and global semantics of sentences from different perspectives and helps to capture the sentence’s meaning based on structure and character information. The internal structure information improves the ability to distinguish between different sentences. At the same time, due to the complementary and interactive relationship between different feature vectors, the ambiguity of the same word in different sentences is reduced. Finally, the evaluation results on baseline data such as ACL14 and SemEval 2014 show that the proposed CharAs-CBert sentence representation framework has good robustness and effectiveness, that is, the experimental results on different baseline datasets are superior to other sentence display methods.
Although the proposed CharAs-CBert sentence representation framework has achieved good representation performance, we found that this method still has shortcomings during the experiment, such as the complex model structure, and different feature vectors having some redundant information in the fusion stage. At the same time, there is still a lot of room for improvement in time efficiency. Therefore, in the following, we will design an efficient and concise semantic-guided sentence representation framework from the perspective of model structure and exploration of more effective detail semantics to obtain semantic details while ensuring accuracy and improving model efficiency.
Abbreviations
The following abbreviations are used in this manuscript:
| CharAs-CBert | Character Assist Construction-Bert |
| SAM | Slice Attention Module |
| BIRM | Bidirectional Independent Recurrent Module |
| CharGCM | Character Graph Convolution Module |
| Att | Attention |
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Not applicable.
Conflicts of Interest
The authors declare no conflict of interest.
Funding Statement
This work was supported by the National Natural Science Foundation of China (Grants Nos. 61877004 and 62007004) and the Major Program of National Social Science Foundation of China (Grant No. 18ZDA295).
Footnotes
Footnote Group
References
Untitled section
References
- 1.Zhou C., Sun C., Liu Z., Lau F. A C-LSTM neural network for text classification. arXiv. 20151511.08630
- 2.Wan S., Lan Y., Guo J., Xu J., Pang L., Cheng X. A deep architecture for semantic matching with multiple positional sentence representations; Proceedings of the AAAI Conference on Artificial Intelligence; Phoenix, AZ, USA. 12–17 February 2016;
- 3.Schwenk H., Douze M. Learning joint multilingual sentence representations with neural machine translation. arXiv. 20171704.04154
- 4.Hao T., Li X., He Y., Wang F.L., Qu Y. Recent progress in leveraging deep learning methods for question answering. Neural Comput. Appl. 2022;34:2765–2783. doi: 10.1007/s00521-021-06748-3.
- 5.Rao G., Huang W., Feng Z., Cong Q. LSTM with sentence representations for document-level sentiment classification. Neurocomputing. 2018;308:49–57. doi: 10.1016/j.neucom.2018.04.045.
- 6.Fu Q., Wang C., Han X. A CNN-LSTM network with attention approach for learning universal sentence representation in embedded system. Microprocess. Microsyst. 2020;74:103051. doi: 10.1016/j.micpro.2020.103051.
- 7.Zhang Y., Wang J., Zhang X. Learning sentiment sentence representation with multiview attention model. Inf. Sci. 2021;571:459–474. doi: 10.1016/j.ins.2021.05.044.
- 8.Kim T., Yoo K.M., Lee S. Self-guided contrastive learning for BERT sentence representations. arXiv. 20212106.07345
- 9.Li S., Li W., Cook C., Zhu C., Gao Y. Independently recurrent neural network (indrnn): Building a longer and deeper rnn; Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; Salt Lake City, UT, USA. 18–22 June 2018; pp. 5457–5466.
- 10.Reimers N., Gurevych I. Sentence-bert: Sentence embeddings using siamese bert-networks. arXiv. 20191908.10084
- 11.Bayhaqy A., Sfenrianto S., Nainggolan K., Kaburuan E.R. Sentiment analysis about E-commerce from tweets using decision tree, K-nearest neighbor, and naïve bayes; Proceedings of the 2018 International Conference on Orange Technologies (ICOT); Bali, Indonesia. 23–26 October 2018; pp. 1–6.
- 12.Rathi M., Malik A., Varshney D., Sharma R., Mendiratta S. Sentiment analysis of tweets using machine learning approach; Proceedings of the 2018 Eleventh International Conference on Contemporary Computing (IC3); Noida, India. 2–4 August 2018; pp. 1–3.
- 13.Anwar M.K.M.K., Yusoff M., Kassim M. Decision Tree and Naïve Bayes for Sentiment Analysis in Smoking Perception; Proceedings of the 2022 IEEE 12th Symposium on Computer Applications Industrial Electronics (ISCAIE); Penang Island, Malaysia. 21–22 May 2022; pp. 294–299.
- 14.Chang C.C., Lin C.J. LIBSVM: A library for support vector machines. ACM Trans. Intell. Syst. Technol. (TIST) 2011;2:1–27. doi: 10.1145/1961189.1961199.
- 15.Li W., Hao S. Sparse lifting of dense vectors: Unifying word and sentence representations. arXiv. 20191911.01625
- 16.Ma J., Li J., Liu Y., Zhou S., Li X. Integrating Dependency Tree into Self-Attention for Sentence Representation; Proceedings of the ICASSP 2022—2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP); Virtual. 7–13 May 2022; pp. 8137–8141.
- 17.Bai X., Shang J., Sun Y., Balasubramanian N. Learning for Expressive Task-Related Sentence Representations. arXiv. 20222205.12186
- 18.Hu X., Mi H., Li L., de Melo G. Fast-R2D2: A Pretrained Recursive Neural Network based on Pruned CKY for Grammar Induction and Text Representation. arXiv. 20222203.00281
- 19.Zhao D., Wang J., Lin H., Chu Y., Wang Y., Zhang Y., Yang Z. Sentence representation with manifold learning for biomedical texts. Knowl.-Based Syst. 2021;218:106869. doi: 10.1016/j.knosys.2021.106869.
- 20.Wu Z., Wang S., Gu J., Khabsa M., Sun F., Ma H. Clear: Contrastive learning for sentence representation. arXiv. 20202012.15466
- 21.Zhang Y., Zhang R., Mensah S., Liu X., Mao Y. Unsupervised Sentence Representation via Contrastive Learning with Mixing Negatives. [(accessed on 8 June 2022)]. Available online: https://aaai-2022.virtualchair.net/poster_aaai8081.
- 22.Zhang Y., He R., Liu Z., Bing L., Li H. Bootstrapped unsupervised sentence representation learning; Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing; Bangkok, Thailand. 1–6 August 2021; pp. 5168–5180.
- 23.Xu W., Li S., Lu Y. Usr-mtl: An unsupervised sentence representation learning framework with multi-task learning. Appl. Intell. 2021;51:3506–3521. doi: 10.1007/s10489-020-02042-2.
- 24.Seo J., Lee S., Liu L., Choi W. TA-SBERT: Token Attention Sentence-BERT for Improving Sentence Representation. IEEE Access. 2022;10:39119–39128. doi: 10.1109/ACCESS.2022.3164769.
- 25.Zhang Q.L., Yang Y.B. Sa-net: Shuffle attention for deep convolutional neural networks; Proceedings of the ICASSP 2021—2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP); Toronto, ON, Canada. 6–11 June 2021; pp. 2235–2239.
- 26.Tang Z., Wan B., Yang L. Word-character graph convolution network for chinese named entity recognition. IEEE ACM Trans. Audio Speech Lang. Process. 2020;28:1520–1532. doi: 10.1109/TASLP.2020.2994436.
Associated Data
Data Availability Statement
Not applicable.