ntust-nlp-1 at ROCLING-2021 Shared Task: Educational Texts Dimensional Sentiment Analysis using Pretrained Language Models
987Authors
nan
Abstract
AbstractThis technical report aims at the ROCLING 2021 Shared Task: Dimensional Sentiment Analysis for Educational Texts. In order to predict the affective states of Chinese educational texts, we present a practical framework by employing pre-trained language models, such as BERT and MacBERT. Several valuable observations and analyses can be drawn from a series of experiments. From the results, we find that MacBERT-based methods can deliver better results than BERT-based methods on the verification set. Therefore, we average the prediction results of several models obtained using different settings as the final output.
Keywords
Full Content
摘要 本研究為 Rocling 2021 共同任務:教育 文本的維度式情感分析之成果報告。 為了分析中文文本的情緒效價(Valence) 與喚起程度(Arousal),本研究基於當前 流行的預訓練語言模型 BERT 與近期基 於全詞遮蔽(Whole Word Masking)進行 預訓練的 MacBERT,觀察模型在不同 設定下的預測成果,並比較 BERT 與 MacBERT 在中文文本情緒預測效能的 差 異 。 我 們 發 現 , 相 較 於 BERT, MacBERT 可以在驗證集上獲得些許的 效能提升。因此,我們將數個使用不 同訓練方法所得的預測模型進行預測 結果平均,作為最終的輸出。 Abstract This technical report aims at the ROCLING 2021 Shared Task: Dimensional Sentiment Analysis for Educational Texts. In order to predict the affective states of Chinese educational texts, we present a practical framework by employing pre-trained language models, such as BERT and MacBERT. Several valuable observations and analyses can be drawn from a series of experiments. From the results, we find that MacBERT-based methods can deliver better results than BERT-based methods on the verification set. Therefore, we average the prediction results of several models obtained using different settings as the final output. 關鍵字:情感分析、預訓練語言模型、BERT、 MacBERT Keywords: Sentiment Analysis, Pre-trained Language Model, BERT, MacBERT 1 緒論 (Introduction) 情緒分析已經是自然語言處理中備受矚目的 任務之一,屬於文本分類的子任務,目標在 於面對不同的文本時,能夠辨識出文本所欲 表達的各類情緒量值,比如:正面、負面、 情 緒 高 漲 、 情 緒 低 落 等(Wei et al., 2011; Malandrakis et al., 2013; Wang et al., 2016; Du and Zhang, 2016; Wu et la., 2017; Yu et al., 2020, Kim et al., 2010; Paltoglou et al, 2013; Goel et la., 2017; Zhu et al., 2019; Wang et al., 2019; 2020)。情緒 辨識可以廣泛地應用在我們的生活中,比如: 分析網路上的社群評論、售後產品的相關回 饋、客服機器人的應答等。 此次的共同任務:教育文本的維度式情 感分析,其目標在於分析出中文教育文本中 的喚起程度(Arousal)以及效價程度(Valence) (Russell, 1980),其中喚起程度的高低意味著 語者是興奮或是平靜,而效價程度則是代表 ntust-nlp-1 at ROCLING-2021 Shared Task: Educational Texts Dimensional Sentiment Analysis using Pretrained Language Models 王繹崴 Yi-Wei Wang 國立台灣科技大學 Nation Taiwan University of Science and Technology 張維哲 Wei-Zhe Chang 國立台灣科技大學 Nation Taiwan University of Science and Technology 方柏翰 Bo-Han Fang 國立台灣科技大學 Nation Taiwan University of Science and Technology 陳奕 奕嘉 Yi-Chia Chen 國立台灣科技大學 Nation Taiwan University of Science and Technology 黃偉愷 Wei-Kai Huang 國立台灣科技大學 Nation Taiwan University of Science and Technology 陳冠宇 Kuan-Yu Chen 國立台灣科技大學 Nation Taiwan University of Science and Technology The 33rd Conference on Computational Linguistics and Speech Processing (ROCLING 2021) Taoyuan, Taiwan, October 15-16, 2021. The Association for Computational Linguistics and Chinese Language Processing 354 語者自身處於積極或是消極的態度(Patricia E. G. Bestelmeyer, 2017)。預訓練語言模型,能夠 為文本萃取出含有豐富語意資訊的特徵向量, 而這個特徵向量可被應用於其它下游任務中, 完成各式不同的自然語言處理任務。因此在 本次任務中,我們將會使用 BERT (Jac ob Devlin, 2018)與 MacBERT (Yiming Cui, 2020)作 為文件的編碼器,透過編碼器產生具有語意 資訊的特徵向量,接著將其輸入至下游任務 的模型內,讓模型在預測喚起程度以及效價 程度時,可以獲得更佳精確的結果。 2 研 研究背景 (Research Background) 在本章節中,我們將會介紹在自然語言處理 任務中,處理文本資料時常會使用到的重要 技術-詞嵌入。此外,由於本次任務為分數預 測,屬於回歸任務的一種,因此在本章節中 也會對回歸任務進行介紹。最後,在本章節 的末段,我們將會介紹近年來在各項自然語 言處理任務中大放異彩的預訓練語言模型- BERT 及其衍生模型 MacBERT。 2.1 詞嵌入 (Word Embedding) 詞嵌入的核心概念為「將一個單詞透過一個 向量進行表示」。近年來較為熟悉的相關研究 有 word2vec (Tomas Mikolov, 2013)、fast-text (Armand Joulin, 2016)和 Glove (Jeffrey Pennington, 2014) 。上述的這些研究都使用各 自的方法將文字表達成向量,也成功地在很 多自然語言處理任務上達到優秀的成果。不 過這些詞嵌入的方法在「相同單詞但是不同 語意」的時候,其表示向量卻是一樣的,為 了解決此一問題,後續研究提出各式「動態」 的詞嵌入表示法,比如:Cove (Bryan McCann, 2017)、ELMo (Matthew E. Peters, 2018)和BERT (Jacob Devl�n, 2018)。這種類型的詞嵌入方法 會透過一個語言模型,將輸入文本根據其內 容的語意,給予每一個詞一個基於上下文的 詞嵌入表示向量(Enkhbold Bataa, 2019)。 2.2 回歸任務 (Regression) 回歸任務是讓機器根據訓練集的資料,學習 如何為輸入的資料抽取特徵,並利用這些特 徵資訊,轉換成正確的標記數值。本次的任 務是分析輸入文本的喚起程度(Arousal)以及效 價程度(Valence),因此我們將這個任務視為一 個回歸任務。 2.3 BERT BERT 為 B�d�rect�onal Encoder Representat�on from Transformer 的簡稱,為相當經典的預訓 練語言模型,其架構為多層的 B�d�rect�onal Transformer 層,而 BERT 在訓練上分為預訓練 (Pre-tra�n�ng)與微調(f�ne-tun�ng)兩個步驟。在 預訓練步驟裡,會使用大量的無標記文本來 訓練 BERT 模型,而訓練方式則包括遮罩語言 模型(Masked Language Model)以及下一句預測 任務(Next Sentence Pred�ct�on)。在遮罩語言模 型的任務中,會有一部分的字符(token)隨機的 被遮罩或是替換成類似的字符,而模型必須 去預測遮罩處的正確字符為何。下一句預測 則是讓模型去判斷兩個連續的句子,後一句 是否確實是接在前一句之後。在微調階段, 模型將被訓練於解決目標任務。相較於預訓 練,模型微調使用少量的標記資料,來對模 型參數進行調整,使其得以符合下游任務的 需求。 2.4 MacBERT MacBERT(MLM as correlation BERT)是一個特 別針對中文語言處理所設計的中文預訓練模 型,跟 BERT 不同的地方在於: � MacBERT 在 填 空 部 分 使 用 全 詞 遮 蔽 (Whole Word Masking),也就是在進行遮 罩的時候,是以詞為遮罩單位而非單一 個字符(token)為單位,避免一些連貫性 很強的字符序列,就算被遮罩一部分, 模型仍可輕易地預測出被遮罩的部分。 � 在遮罩方式上,追加使用 N 元遮罩(N- gram Masking)以 及 Mac 遮 罩(Mac- Masking)。N 元遮罩即將連續的 N 個字符 一起遮罩;Mac 遮罩則是將所有被遮罩 的字符都以向量上相近的字符作為替代, 而非單純的< ���� >符號,這是考慮到 < ���� >是不會出現在下游任務的。 � MacBERT 並非選擇使用預測下一句作為 預訓練的任務,而是以語句順序判斷 (Sentence Order Prediction)作為訓練目標。 在語句順序判斷的任務中,模型必須辨 …
Content truncated to 500 words
Labeled Text
AbstractThis technical report aims at the ROCLING 2021 Shared Task: Dimensional Sentiment Analysis for Educational Texts. In order to predict the affective states of Chinese educational texts, we present a practical framework by employing pre-trained language models, such as BERT and MacBERT. Several valuable observations and analyses can be drawn from a series of experiments. From the results, we find that MacBERT-based methods can deliver better results than BERT-based methods on the verification set. Therefore, we average the prediction results of several models obtained using different settings as the final output.
Publication Details
- Paper ID:
- 987
- Year:
- 2021
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan