arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.15331cs.CLcs.AI

使用预训练语言模型进行立场检测的教程:微调BERT与提示大型语言模型

Tutorials on Stance Detection using Pre-trained Language Models: Fine-tuning BERT and Prompting Large Language Models

Yun-Shiuan Chuang

AI总结:

本文介绍两个立场检测教程,分别讲解BERT微调与LLMs提示技术,通过实践代码与评估揭示few-shot ChatGPT和FLAN-T5优于微调BERT的优势。

摘要:

本文介绍了两个独立的教程,探讨如何使用BERT微调和提示大型语言模型(LLMs)在Twitter数据中进行立场检测。第一个教程解释了BERT架构和tokenization,指导用户使用HuggingFace transformers训练、调优和评估标准及特定领域的BERT模型。第二个教程侧重于构建提示和few-shot示例,以在无需微调的情况下从ChatGPT和开源FLAN-T5中引出立场。使用混淆矩阵和macro F1分数实现并评估了各种提示策略。教程提供了代码、可视化以及见解,揭示了few-shot ChatGPT和FLAN-T5的优势,它们优于微调后的BERT。通过以易于上手、实践性的方式涵盖模型微调和基于提示的技术,这些教程使学习者能够获得立场检测前沿方法的实践经验。

英文摘要:

This paper presents two self-contained tutorials on stance detection in Twitter data using BERT fine-tuning and prompting large language models (LLMs). The first tutorial explains BERT architecture and tokenization, guiding users through training, tuning, and evaluating standard and domain-specific BERT models with HuggingFace transformers. The second focuses on constructing prompts and few-shot examples to elicit stances from ChatGPT and open-source FLAN-T5 without fine-tuning. Various prompting strategies are implemented and evaluated using confusion matrices and macro F1 scores. The tutorials provide code, visualizations, and insights revealing the strengths of few-shot ChatGPT and FLAN-T5 which outperform fine-tuned BERTs. By covering both model fine-tuning and prompting-based techniques in an accessible, hands-on manner, these tutorials enable learners to gain applied experience with cutting-edge methods for stance detection.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑