3.3. Emotional Computation of Bilingual Short Texts with Emojis in Emotional Fluctuation
This section describes how to compute the emotional score of the short text with emoji. According to
Section 3.2.1, the scores of words that can’t be retrieved from the emotional dictionary are calculated by the
EORW method. Then emotional fluctuation is considered.
Step 1. The input sentence
S is fed into the model, and its internal components are segmented into three distinct elements: the Chinese element
C, the English element
E, and the emoji element
e.
S is represented by the following equation, Equation (11).
where
w represents words in
S,
i words belong to
C,
k words belong to E, and
e denotes the emoji.
Step 2. C can be represented by Equation (12), and
E can be represented in the same way by Equation (13).
Step 3. This article supposes that nouns
N, verbs
V, adjectives
Adj, and adverbs
Adv have a significant impact on
S. Therefore, these words are retained and extracted into a keyword’s subset
K.
K has two forms in this paper: one is
Kc and the other is
Ke.
Kc contains Chinese keywords,
Ke contains English keywords, and
Kc and
Ke are respectively denoted as Equations (14) and (15).
where the subscripts
C and
e respectively represent
C and
E.
Step 4. emofMeaning is fed into the embedding layer, considered as English words using EORW to compute its emotional score.
Step 5. In C and E, after generating K, the emotional scores of words in K can be computed by the EORW technique, if these words don’t belong to the emotional dictionary. Then, this paper checks whether emotion is fluctuating. If a fluctuation position exists, CNEF is designed to calculate the emotional score of the sentence. In other words, more attention is paid to the fluctuation position, considered as the most significant position. The tendencies of other elements are considered as other elements M.
Emotional Fluctuation and emotional fusion are introduced in the following sections.
Emotional Fluctuation. There are definitions to describe the emotional fluctuation and illustrate the categories of different emotional fluctuations.
Definition 9. Emotional Fluctuation. A sentence S = {element1, element2, element3} is divided into three elements element1, element2, and element3. Emotional fluctuation appears when the emotional tendencies of element1, element2, and element3 are not consistent, such as (element1, positive) (element2, negative) ← emotional fluctuation appears in S or (element1, positive) (element2, positive) (element3, negative) ← emotional fluctuation appears in S.
Definition 10. Emotional Fluctuation Position and Normal Position. The position of emotional inconsistency is defined as the Emotional Fluctuation Position. Other positions are considered as the Normal Position. For example, S = (element1, positive, Normal Position) (element2, positive, Normal Position) (element3, negative, Emotional Fluctuation Position).
The emotional fluctuations are classified into three categories by
CNEC: (1) the second element is identified as the position of emotional fluctuation when the Chinese, English, and emoji demonstrate positive-negative-negative or negative-positive-positive emotional tendencies; (2) the last element is considered as the position of emotional fluctuation when the emotional tendencies of the Chinese, English, and emoji elements are negative-negative-positive or positive-positive-negative; (3) the emotions expressed in the text are generally reckoned to be consistent with the emotional tendencies of the beginning and end, when the emotional fluctuation occurs either at the beginning or end and the emotional tendencies of the beginning and end are consistent. These situations are shown in
Figure 5.
Moreover, when confronted with fluctuation between two elements, a similar approach is taken as in the case of three elements. The primary adjustment is made to the element whose sentiment tendency has changed. In light of what has been previously presented, the fluctuation position
Fl_P can be denoted as Equation (16). Equation (16) aligns with various situations depicted in
Figure 5. Specifically, Case 1 corresponds to M2, Case 2 corresponds to M3, and Case 3 corresponds to M1 and M3. Furthermore, in situations where only two modules are present, Case 4 of Equation (16) pertains to M2.
where
Mi represents the
i-th element of three elements. Function
sgn(·) stands for the sign of the emotional score.
Emotional Computation of Texts in Emotional Fluctuation. To elucidate the emotional fluctuation more effectively, a Centrifugal Navigation-Based Emotion Computation framework (
CNEC) employs the centrifugal process of circular motion in physics to describe the phenomenon of emotional fluctuation. In the
CNEC framework,
mf represents the emotional fluctuation element, which is analogous to an object
m in circular motion.
M illustrates other elements equal to the center of circular track, which is denoted as
O in physics. In addition,
R denotes the radius of the circle, which is determined by the distance between
M and
mf. As
M and
mf are not point particles in reality, their separation distance is considered to be the sum of their individual lengths.
R can be represented by Equation (17).
where
lengthx represents the length of
mf, and
lengthy means the length of
M.
When
mf undergoes uniform motion along a circular orbit, it illustrates that there is no emotional fluctuation between
M and
mf. When there is emotional fluctuation between
M and
mf,
mf, equivalent to the object
m, moves in a centrifugal motion, departing from the circular orbit. The moment centrifugal motion occurs, the condition where the angle
θ between the velocity direction of
mf and the line connecting
mf to the center
O of the circle is greater than 90 degrees corresponds to Equation (16). In other words, the condition of emotional fluctuation is equal to the condition of centrifugal motion. As shown in
Figure 6, an example of a bilingual text with an emoji that is in a fluctuation position illustrates the corresponding relationship between the workflow of emotional fluctuation and centrifugal motion in the
CNEC framework.
S = “为你挑选了实用的礼物, 而你stupid 😫” (Translation: I select practical gifts for you, but you’re stupid 😫), a sentence with an emoji, is put into the Model. Then, this study carries out splitting the sentence S, and puts the Chinese, English, and emoji into different elements through Equations (12) and (13). The format of the segment = [C][E][Cemoji]. Using word tokenization of BERT, C is split into individual words wi stored in a set CW, i < N, where N represents the length of C. Similarly, k words wk are stored in a set EW, k < M, where M represents the length of E. Then, a library Jieba is utilized to mark the part of speech of wi in CW. As a result, Nc, Vc, Adjc, and Advc are extracted from CW and saved into Kc. Moreover, the library NLTK is used to mark the part of speech of wk in EW, so Ne, Ve, Adje, and Adve are extracted from EW into Ke. These conditions are shown in Equations (14) and (15). Later, Kc is fed into the embedding layer, the word vector set Ec fed into Equation (1) can be obtained, and the word vector set Ee obtained by Equation (1) in the same way.
On the basis of
EORW,
can be calculated, which represents the emotional score of the
i-th word with
t neighbor words. Then the score
SKc of
Kc is fused by
, and the score
SKe of
Ke fused by
, as the following Equation (18).
where
ρc stands for the density of
Kc that is equal to the length of
Kc,
SKc replaces
SKx, and
ρc replaces
ρx. In addition,
ρe stands for the density of
Ke that is equal to the length of
Ke,
SKe replaces
SKx, and
ρe replaces
ρe.
When 😫 enters sequentially Equations (9) and (10), its emofMeaning can be computed. After that, emofMeaning[tired] is fed into embedding layer, obtaining EemofMeaning[tired]. Then, emoji’s score Se can be calculated by EORW.
After collecting SKc, SKe, and Se, the emotional fluctuation can be checked by Equation (16). While a fluctuation position exists, SKc represents the score of Kc corresponding to the score of M1, SKe represents the score of Ke corresponding to the score of M2, and Se represents the score of e corresponding to the score of M3. Finally, the text score FS can be calculated by Emotional Fusion, described in the next section.
As depicted in
Table 2, each parameter of centrifugal motion corresponds to parameters in emotional fluctuation.
Centrifugal Navigation-Based Emotional Fusion. When fluctuation doesn’t exist, it means that the tendencies among C, E, and e are consistent. Therefore, the final score
FS of a short text
S is computed by
Maximum Density Dominance, as shown in Equation (19).
where Function
Max(·) determines the largest score of the three elements (
m1,
m2,
m3), and
ρi represents the density of
i-th element that is equal to the length of
i-th element.
On the contrary, when one of emotional fluctuations emerges among the three elements, emotional fusion is utilized as shown in Equation (20).
where Function sgn(·) extracts emotional tendency.
Workflow of emotional computation about two elements. To facilitate understanding and examination of two elements, an instance of a monolingual corpus containing the emoji is presented below, as demonstrated in
Figure 7.
S, an English sentence with the emoji, is put into the Model. Then, this study carries out splitting the sentence
S, and puts the English and emoji into different groups. The format of the segment = [
E][
Cemoji]. Using word tokenization,
E is split into individual words
wi stored in a set
EW,
i < N, where N represents the length of
E. Then, NLTK is utilized to mark the part of speech of
wi in
EW. As a result,
N,
V,
Adj, and
Adv are extracted from
EW and saved into
Ke. Moreover,
C is empty, so
Kc belongs to the null set Ø. Later,
Ke is fed into embedding layer, word vectors set
Ee fed into Equation (2) can be obtained.
On the basis of
EORW,
can be calculated, which represents the emotional score of the
i-th word with
t neighbor words. Then the score
SKc of
Kc is fused by
as the following Equation (21).
where
ρe stands for the density of
Ke that is equal to the length of
Ke,
SKe replaces
SKx, and
ρe replaces
ρx.
When 😭 enters Equation (10), its emofMeaning can be computed. After that, emofMeaning[crying] is fed into embedding layer, obtaining EemofMeaning[crying]. Then, the emoji’s score Se can be calculated by EORW.
After collecting SKc and Se, the emotional fluctuation can be checked by Equation (16). While a fluctuation position exists, SKc represents the score of Kc corresponding to the score of M1, and Se represents the score of Ke corresponding to the score of M2. Finally, text score FS can be calculated by Equation (20).
Conversely, if the fluctuation doesn’t exist, Equation (19) is adopted to compute the final score FS.