↓Skip to main content
  1. Paper/

A Chinese Dimensional Valence-Arousal-Irony Detection on Sentence-level and Context-level Using Deep Learning Model

·7 mins· ·
Paper Paper Nlp Irony Valence-Arousal Bert Span-Prediction
Wei Yi Chung
Author
Wei Yi Chung
Working at the contributing of open source, distributed systems, and data engineering.
Table of Contents

Paper Info
#

ItemDetails
VenueInternational Journal of Computational Linguistics & Chinese Language Processing (IJCLCLP) Vol. 27, No. 2, pp. 73–88, December 2022
AuthorsJheng-Long Wu, Sheng-Wei Huang, Wei-Yi Chung, Yu-Hsuan Wu, Chen-Chia Yu
LinksACL Anthology · PDF
CodeNo public repo
Conference versionA Dimensional Valence-Arousal-Irony Dataset for Chinese Sentence and Context (ROCLING 2022)
FundingMOST 110-2221-E-031-004, MOST 111-2221-E-031-004-MY3

What Changed from the Conference Version
#

The dataset is the same CDVAI (1,004 ironic sentences, 843 ironic contexts); the annotation guidelines, annotator agreement, and score distribution match the ROCLING version and are not repeated here. What is new is the modeling:

ROCLING 2022IJCLCLP 2022
Where M1/M2/M3 applyContext-level VA onlyBoth sentence-level VAI and context-level VA
Pre-trained models4 Chinese + 2 multilingual6 Chinese (MacBERT, RoBERTa, and three Erlangshen models)
Context positionHuman-annotated spanAlso trains a model to predict the span automatically and reruns with it
Main findingM3 helps context arousalM2/M3 help a lot at the context level; the span must be accurate to help

The paper also frames irony detection explicitly as sentiment detection: irony has a humorous effect in conversation and brings specific emotional patterns, so beyond “is it ironic?”, the valence and arousal behind it matter.

Model Architecture
#

The two parts of the journal experiments

The experiments come in two parts.

Part 1: human-annotated context span
#

A pre-trained BERT encodes the input and a linear layer predicts the scores. Three ways to combine sentence and context features:

SetupHow
M1Sentence and context are encoded separately. The sentence features predict sentence VAI, the context features predict context VA, independently
M2The context span is marked in the sentence. After encoding the whole sentence, the hidden states at the span are summed and used to predict both sentence VAI and context VA
M3Sentence and context are encoded separately, their hidden vectors are concatenated, and the result predicts both sentence VAI and context VA

M1 is the baseline; M2 asks whether the span alone is enough; M3 asks whether seeing both lets the model pick up the sentiment contrast between them.

Part 2: predicting the context span
#

In practice nobody marks the context for you, so Part 2 trains a context-span predictor: BERT encodes the sentence and a linear layer on each token decides whether it belongs to the context.

The predicted span then replaces the human-annotated one, and Part 1’s M2 and M3 are rerun to see how much an imperfect span hurts VA prediction.

Experimental Setup
#

The splits follow the ROCLING version: stratified 7:3 train/test, with one tenth of train held out for validation (sentence level 632 / 71 / 301, context level 531 / 59 / 253).

ParameterValue
OptimizerAdam
Learning rate (sentence level)4e-4, 4e-5, 4e-6
Learning rate (context level)4e-5, 4e-6, 4e-7
Learning rate (span prediction)listed as 43e-6, 45e-6 in the paper’s table
Epochs50

The context carries less information than the sentence, and span prediction is harder still, so both try smaller learning rates.

Pre-trained models (all Chinese):

IDModelNotes
PM1hfl/chinese-macbert-baseSimplified and traditional Chinese Wikipedia
PM2shibing624/macbert4csc-base-chineseTrained on the SIGHAN spelling-correction corpus
PM3uer/chinese_roberta_L-4_H-256UER toolkit + CLUECorpus2020, a small 4-layer model
PM4IDEA-CCNL/Erlangshen-Ubert-110M-ChineseUBERT trained on data from many tasks
PM5IDEA-CCNL/Erlangshen-Ubert-330M-ChineseLarger version of the above
PM6IDEA-CCNL/Erlangshen-UniMC-RoBERTa-110M-ChineseTrained on 13 supervised datasets
PM7IDEA-CCNL/Erlangshen-DeBERTa-v2-97M-ChineseUsed only for span prediction in Part 2

Part 1 Results
#

Sentence-level VAI (MAE, lower is better)
#

Bold marks the lowest value for each indicator.

ModelV-M1V-M2V-M3A-M1A-M2A-M3I-M1I-M2I-M3
PM10.3460.4210.3900.5210.6490.6390.5210.5770.603
PM20.3800.4210.3900.6190.6490.6390.6010.5770.603
PM30.3710.4100.3710.6430.6030.5960.5380.5700.566
PM40.3800.4120.3900.6190.6140.6390.6010.5720.603
PM50.3760.3810.4200.6150.6160.6100.5750.5910.559
PM60.3800.4120.3900.6190.6140.6390.6010.5770.603
  • Valence: about 0.4 everywhere, and M1 is best. The paper argues valence is easy to judge, so richer features only hurt.
  • Arousal: about 0.6, harder than valence. M1 is not always best; PM3–PM6 improve with M2 or M3.
  • Irony: about 0.5–0.6, a little better than arousal, which suggests scoring irony by the keyword–context gap works. PM2, PM4, PM5, and PM6 improve with M2 or M3.
  • Overall the sentence level does well, but M2 and M3 do not clearly help it.

Context-level VA (MAE)
#

Bold marks each model’s best setup for that indicator.

ModelV-M1V-M2V-M3A-M1A-M2A-M3
PM10.4310.4080.3890.8190.6490.787
PM20.4130.4080.3890.7960.6490.787
PM30.4310.4680.4270.7980.6030.829
PM40.4130.4150.3890.7960.6140.787
PM50.4260.4630.4280.8150.6160.834
PM60.4130.4150.3890.7960.6140.787

The picture is the opposite of the sentence level:

  • Valence: M3 is best for 5 of the 6 models, down to 0.389.
  • Arousal: M2 wins by a wide margin, cutting MAE from about 0.8 with M1 to about 0.6. The paper reads this as: to judge how aroused the context is, the context’s own information matters more than the whole sentence.
  • The conclusion: understanding the true sentiment of an ironic context requires combining it with the sentence, which is exactly why CDVAI annotates the context separately.

Part 2 Results
#

Context-span prediction
#

ModelPrecisionRecallF1
PM10.3730.3020.333
PM20.3490.2740.307
PM30.3290.2180.262
PM40.3730.3090.331
PM50.4360.3520.390
PM60.3730.2980.338
PM70.4380.3770.405

PM1–PM6 were not good enough, so the paper adds PM7 (DeBERTa-v2), which still tops out at an F1 of 0.405. Finding the boundary of an ironic context is a hard task on its own.

Rerunning M2 / M3 with predicted spans
#

The spans predicted by PM7 replace the human annotation and the experiments are rerun.

Sentence level

ModelV-M2V-M3A-M2A-M3I-M2I-M3
PM10.3370.4030.6310.5850.5750.638
PM20.3370.4030.6310.5850.5750.638
PM30.3840.3760.6180.6480.6060.613
PM40.3920.4030.6770.5850.5940.638
PM50.3830.3640.6070.6090.5610.574
PM60.3920.4030.6770.5850.5940.638
  • Sentence valence with M2 actually improves (PM1 from 0.421 to 0.337). The paper suspects the predicted spans, though wrong, happen to include more emotion words.
  • Arousal and irony move both ways; for example arousal with M3 drops from 0.639 to 0.585 for PM1 but rises from 0.596 to 0.648 for PM3.

An interesting takeaway: at the sentence level, what matters may be a few key words in the context rather than the whole context.

Context level

ModelV-M2V-M3A-M2A-M3
PM10.4190.4470.8190.824
PM20.4190.4470.8190.824
PM30.4710.4360.8670.810
PM40.4350.4470.8440.824
PM50.4420.4510.8010.844
PM60.4350.4470.8440.824

The context level is less lucky. Valence is about the same as Part 1, but arousal with M2 falls back from 0.60–0.65 to 0.80–0.87, erasing almost all of M2’s gain. Context sentiment depends on the right span: once the span is wrong, the model can no longer learn the context’s own arousal.

Error Analysis
#

The paper examines one error from PM3, which did well in Part 1:

“Very good… even the speakers are broken X-(”, with the context “even the speakers are broken”

Sentence VSentence ASentence IContext VContext A
Gold23123
Predicted1.713.451.941.631.97
  • The model treats “even” and “broken” as strongly negative and rates valence too low, but a broken speaker is usually not that upsetting; the model lacks that common sense.
  • Irony is over-predicted: the model reacts to the gap between “very good” and the negative context, but the sentence has no other ironic span, so the gold score is low.

Conclusion and Limitations
#

  1. Sentence level: M2 and M3 do not clearly help, though Part 2 hints that key words in the context may matter more than the full context.
  2. Context level: M2 and M3 clearly help, so the sentiment of an ironic context only makes sense together with the sentence.
  3. The span has to be right: automatic span prediction reaches only 0.405 F1, and with predicted spans the context-arousal gain disappears.

The limitations match the ROCLING version: the dataset is small and does not cover every ironic pattern, so it is best used as a starting point for more samples or annotation guidelines. The span predictor also has plenty of room to improve.

Related

A Dimensional Valence-Arousal-Irony Dataset for Chinese Sentence and Context
·8 mins
Paper Paper Nlp Dataset Irony Valence-Arousal Annotation Bert
ROCLING 2022: extending the NTU irony corpus with sentence-level V/A/I and context-level V/A intensities, and benchmarking it with BERT
DVA-BERT: Sentiment-Based Masked Language Modeling for Valence–Arousal Prediction
·9 mins
Paper Paper Nlp Sentiment-Analysis Bert Masked-Language-Model Valence-Arousal
Applied Intelligence 2022: masking sentiment words by their intensity instead of random tokens, as an auxiliary task that improves sentence-level valence–arousal prediction
Factor Detection Task of Cyberbullying Using the Deep Learning Model
·9 mins
Paper Paper Nlp Cyberbullying Bert Big-Data Annotation
IEEE BigData 2022 Workshop: defining six cyberbullying factors, building a Chinese PTT corpus, and using BERT to detect them and analyze bullying patterns around public figures
Master's Thesis: Entity Representation Learning and Density Estimation for Coreference Resolution
·12 mins
Paper Paper Nlp Coreference-Resolution Spanbert Representation-Learning Thesis
Adding entity representation estimation, within-group density, and between-group density to a SpanBERT coreference model for about +0.9 F1
A Dynamic Embedding Method for Passenger Flow Estimation
·9 mins
Paper Paper Traffic-Flow Transfer-Learning Bert Embedding Spatio-Temporal
IIAI-AAI 2021: BERT-pretrained dynamic MRT station embeddings replace GMAN’s static station features; Competitive Paper Award
LeetCode 154: Find Minimum in Rotated Sorted Array II
·1 min
LeetCode Hard Array Binary-Search
LeetCode 154 note: compare with the right end as in LC 153; on equality the break could be on either side, so r -= 1, worst case O(n)