基於多任務學習的多目標分類問題 - 以自然語言處理問題為例
Multi-label Classification with Multi-task learning - A case study of Natural Language Processing
摘要
⾃然語⾔處理問題⼀直以來都是許多學者研究的議題,例如: 偵測垃圾郵件、⽂本
分類、影評分級和惡意評論偵測等等。近年來隨著⼈⼯智慧的發展,以及電腦設備的
提升,應⽤⼈⼯智慧來處理⾃然語⾔處理問題的⽅法也越來越多。像是深度學習模型
利⽤⼤量的訓練資料去⾃動抽取特徵,並擷取出重要特徵進⾏分類。⽬前已被廣泛應
⽤在語⾳辨識、物件偵測以及圖像辨識等領域,並且獲得⾮常好的效果。多⽬標分類
的問題是指⼀筆資料可能會有多個標籤答案,像是在⾃然語⾔處理問題中惡意評論的
偵測,可能這則評論同時包含了歧視和威脅,另則句⼦則是包含了威脅、猥褻與髒話
字眼。這種問題稱之為多⽬標分類。多任務學習則是將單⼀標籤視為單⼀的任務,透
過多個相關的任務⼀起學習,透過共享的參數讓他們在學習中互相分享他們學習到的
資訊,來讓模型的各個任務準確度提升,並縮短模型訓練時間。本研究將針對多⽬標
分類的問題(Multi-label classification) 使⽤多任務學習(Multi-task learning) 來解決。
本論⽂使⽤了⼀個惡意評論偵測分類的資料集,這個資料集中每筆資料可能有: 惡毒、
極度惡毒、猥褻、威脅、歧視和侮辱等六種標籤,以及另外兩個類似的y然語⾔處理
資料集。並使⽤多任務學習的架構來解決此問題。由於⾃然語⾔處理問題屬於時間序
列的問題,⽽在深度學習模型中Recurrent Neural Networks (RNN) 的架構較能處理時
間序列的問題,所以我們透過bidirectional GRU 來建構我們的模型,並在bidirectional
GRU 後加⼊⼀層CNN 做更細部的特徵萃取。本論⽂將多任務學習的架構應⽤於三個
⾃然語⾔處理的資料集,對⽐其他深度學習模型,我們的模型獲得⾮常好的效果。
分類、影評分級和惡意評論偵測等等。近年來隨著⼈⼯智慧的發展,以及電腦設備的
提升,應⽤⼈⼯智慧來處理⾃然語⾔處理問題的⽅法也越來越多。像是深度學習模型
利⽤⼤量的訓練資料去⾃動抽取特徵,並擷取出重要特徵進⾏分類。⽬前已被廣泛應
⽤在語⾳辨識、物件偵測以及圖像辨識等領域,並且獲得⾮常好的效果。多⽬標分類
的問題是指⼀筆資料可能會有多個標籤答案,像是在⾃然語⾔處理問題中惡意評論的
偵測,可能這則評論同時包含了歧視和威脅,另則句⼦則是包含了威脅、猥褻與髒話
字眼。這種問題稱之為多⽬標分類。多任務學習則是將單⼀標籤視為單⼀的任務,透
過多個相關的任務⼀起學習,透過共享的參數讓他們在學習中互相分享他們學習到的
資訊,來讓模型的各個任務準確度提升,並縮短模型訓練時間。本研究將針對多⽬標
分類的問題(Multi-label classification) 使⽤多任務學習(Multi-task learning) 來解決。
本論⽂使⽤了⼀個惡意評論偵測分類的資料集,這個資料集中每筆資料可能有: 惡毒、
極度惡毒、猥褻、威脅、歧視和侮辱等六種標籤,以及另外兩個類似的y然語⾔處理
資料集。並使⽤多任務學習的架構來解決此問題。由於⾃然語⾔處理問題屬於時間序
列的問題,⽽在深度學習模型中Recurrent Neural Networks (RNN) 的架構較能處理時
間序列的問題,所以我們透過bidirectional GRU 來建構我們的模型,並在bidirectional
GRU 後加⼊⼀層CNN 做更細部的特徵萃取。本論⽂將多任務學習的架構應⽤於三個
⾃然語⾔處理的資料集,對⽐其他深度學習模型,我們的模型獲得⾮常好的效果。
Natural language processing (NLP) is always an important research topic. Many
NLP problems such as spam filtering, text classification, movie rating, and toxic comment
detection, are present in our daily life. In recent years, with the development of
deep learning and the improvement of computing power, many studies have applied deep
learning to deal with NLP problems. Deep learning model uses a large amount of training
data to automatically extract features, giving a base to extract important and discriminative
features from data, and achieve promising results. Therefore, deep learning has
been widely used in speech recognition, object detection and image recognition, and has
achieved good results. Multi-label classification problem refers to the problem that each
data sample may have multiple labels. In the toxic comments classification problem, a
comment may consists of both identity hates and threats, while the other comments may
contain threats, obscene and toxic. This thesis proposes to use multi-task learning to deal
with multi-label classification problems, in which we treat each single label as a single task.
For each task, it is possible to improve the performance by sharing representation between
tasks. This thesis uses three different NLP classification datasets to conduct experiments.
We use our proposed multi-task learning architecture to deal with this problem. Since
the natural language processing problem is a sequence problem, and the Recurrent Neural
Networks (RNN) architecture is more capable of processing sequence problems in the
deep learning model. Therefore, we construct our model through bidirectional GRU, and
then apply CNN for further feature learning. This thesis conducts experiments on three
datasets. The experimental results indicate that our proposed method outperforms the
other alternatives.
NLP problems such as spam filtering, text classification, movie rating, and toxic comment
detection, are present in our daily life. In recent years, with the development of
deep learning and the improvement of computing power, many studies have applied deep
learning to deal with NLP problems. Deep learning model uses a large amount of training
data to automatically extract features, giving a base to extract important and discriminative
features from data, and achieve promising results. Therefore, deep learning has
been widely used in speech recognition, object detection and image recognition, and has
achieved good results. Multi-label classification problem refers to the problem that each
data sample may have multiple labels. In the toxic comments classification problem, a
comment may consists of both identity hates and threats, while the other comments may
contain threats, obscene and toxic. This thesis proposes to use multi-task learning to deal
with multi-label classification problems, in which we treat each single label as a single task.
For each task, it is possible to improve the performance by sharing representation between
tasks. This thesis uses three different NLP classification datasets to conduct experiments.
We use our proposed multi-task learning architecture to deal with this problem. Since
the natural language processing problem is a sequence problem, and the Recurrent Neural
Networks (RNN) architecture is more capable of processing sequence problems in the
deep learning model. Therefore, we construct our model through bidirectional GRU, and
then apply CNN for further feature learning. This thesis conducts experiments on three
datasets. The experimental results indicate that our proposed method outperforms the
other alternatives.