Skip to main content
QUICK REVIEW

[论文解读] BERT for Sentiment Analysis: Pre-trained and Fine-Tuned Alternatives

Frederico Souza, João Filho|arXiv (Cornell University)|Jan 10, 2022
Sentiment Analysis and Opinion Mining被引用 4
一句话总结

本文评估了多种用于聚合 BERT 嵌入表示的方法,特别是 BERTimbau 和 m-BERT,在巴西葡萄牙语情感分析中的表现,表明将 [CLS] token 与所有 token 的均值和标准差相结合,可显著提升性能,优于仅使用 [CLS] token 的方法。微调进一步提升了结果,BERTimbau 在所有数据集上均优于 m-BERT,实现了当前最优的 ROC-AUC 分数。

ABSTRACT

BERT has revolutionized the NLP field by enabling transfer learning with large language models that can capture complex textual patterns, reaching the state-of-the-art for an expressive number of NLP applications. For text classification tasks, BERT has already been extensively explored. However, aspects like how to better cope with the different embeddings provided by the BERT output layer and the usage of language-specific instead of multilingual models are not well studied in the literature, especially for the Brazilian Portuguese language. The purpose of this article is to conduct an extensive experimental study regarding different strategies for aggregating the features produced in the BERT output layer, with a focus on the sentiment analysis task. The experiments include BERT models trained with Brazilian Portuguese corpora and the multilingual version, contemplating multiple aggregation strategies and open-source datasets with predefined training, validation, and test partitions to facilitate the reproducibility of the results. BERT achieved the highest ROC-AUC values for the majority of cases as compared to TF-IDF. Nonetheless, TF-IDF represents a good trade-off between the predictive performance and computational cost.

研究动机与目标

  • 探究 BERT 输出嵌入表示的替代聚合策略,以超越标准的 [CLS] token 方法。
  • 比较针对特定语言的 BERT 模型(BERTimbau)与多语言模型(m-BERT)在巴西葡萄牙语文本分类任务中的性能表现。
  • 评估微调与预训练推理在情感分类准确率上的影响。
  • 评估在某一数据集上训练的 BERT 模型在其他数据集上的跨数据集泛化性能。
  • 为在低资源或计算资源受限环境中部署 BERT 提供实用指导,采用 16 位精度和高效聚合策略。

提出的方法

  • 使用在巴西葡萄牙语语料上微调过的 BERTimbau Base 和 Large 模型,以及多语言 BERT(m-BERT)模型。
  • 提出并评估了多种聚合策略:仅使用 [CLS] token、所有 token 的均值、标准差,以及组合策略如 'first + mean + std'。
  • 在所有实验中,使用逻辑回归作为分类器对聚合后的嵌入表示进行分类。
  • 通过调整不同的学习率和 dropout 率,对预训练和微调后的 BERT 模型进行了实验。
  • 在五个具有预定义训练/验证/测试划分的开源数据集上评估模型,以确保可复现性。
  • 采用 16 位浮点精度(float16)以降低内存和计算成本,且未造成显著性能损失。

实验结果

研究问题

  • RQ1将多个 BERT 输出嵌入表示(如 [CLS]、均值、标准差)组合使用,是否能比仅使用 [CLS] token 获得更好的情感分类性能?
  • RQ2在巴西葡萄牙语情感分析中,针对特定语言的 BERT 模型(BERTimbau)与多语言模型(m-BERT)相比表现如何?
  • RQ3与使用预训练嵌入相比,微调 BERT 在情感分类性能上的提升程度如何?
  • RQ4在跨数据集评估中,于某一数据集上微调的模型在其他数据集上的泛化能力如何?
  • RQ5在 BERT 推理中,使用 16 位精度与 32 位精度相比,计算成本与性能之间的权衡如何?

主要发现

  • 'first + mean + std' 聚合策略在所有数据集上均显著优于标准的 [CLS] token 方法,ROC-AUC 最高提升达 3.4 个百分点。
  • BERTimbau Base 和 Large 模型在所有数据集上均取得最高的 ROC-AUC 分数,优于 m-BERT,其中 BERTimbau Large 在 B2W 数据集上达到 99.2% 的 AUC。
  • 微调带来了显著的性能提升:与预训练模型相比,UTLC-Movies 数据集上 m-BERT 的 ROC-AUC 提升了 10%,BERTimbau Large 提升了 3.4%。
  • 在所有数据集上联合训练的通用模型优于预训练模型,但劣于领域特定微调的模型,表明领域特定微调仍具重要价值。
  • 使用 16 位精度显著降低了内存占用和训练时间,且未造成可测量的性能损失,因此在资源受限的部署中是实用的选择。
  • 跨数据集微调带来了适度的性能增益(例如,在 B2W 上微调后,UTLC-Movies 的 AUC 提升了 1.3 个百分点),但大多数情况下整体增益不足 1%,表明此类迁移的成本效益较低。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。