arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.09638cs.CY
收藏

使用大型语言模型进行社会科学和人文学科可重复文本注释的方法论指南:基于Python和R

A Methodological Guide on Using Large Language Models for Reproducible Text Annotation in the Social Sciences and Humanities with Python and R

Utrecht University(乌得勒支大学)

Qixiang Fang, Javier Garcia Bernardo, Erik-Jan van Kesteren

AI总结:

本文提供了一步一步的方法论指南,指导社会科学和人文学科研究者使用大型语言模型进行文本注释,包括设置项目、编程交互、提示设计、统计整合和可重复性管理,并附有Python和R代码示例。

摘要:

大型语言模型(LLMs)越来越多地被社会科学和人文学科(SSH)的研究人员用于文本分析,特别是自动化文本注释。然而,许多研究人员在采用LLMs、解决其局限性以及生成可重复的工作流程和结果方面仍面临挑战。例如,即使表面准确性很高,注释错误也可能使下游统计分析产生偏差。本文提供了一步一步的方法论指南,指导如何在SSH研究中使用LLMs进行文本注释,并附有实用的Python和R示例。我们解释了LLMs的工作原理、如何设置研究项目、如何以编程方式与(开源)LLMs交互、如何设计和评估提示而不过度拟合、如何在考虑注释错误的情况下将LLM注释整合到统计分析中,以及如何管理大规模的成本、效率和可重复性。在整个过程中,我们强调直观的方法论推理、具体示例和最佳实践,以帮助研究人员将基于LLM的注释纳入可重复的科学工作流程。

英文摘要:

Large language models (LLMs) are increasingly used by researchers in the social sciences and humanities (SSH) for text analysis, particularly to automate text annotation. However, many researchers still face challenges in adopting LLMs, addressing their limitations, and producing reproducible workflows and results. For example, annotation errors can bias downstream statistical analyses even when apparent accuracy is high. This paper provides a step-by-step methodological guide to using LLMs for text annotation in SSH research, with practical Python and R examples. We explain how LLMs work, how to set up research projects, how to interact with (open-source) LLMs programmatically, how to design and evaluate prompts without overfitting, how to integrate LLM annotations into statistical analyses while accounting for annotation error, and how to manage cost, efficiency, and reproducibility at scale. Throughout, we emphasize intuitive methodological reasoning, concrete examples, and best practices to help researchers incorporate LLM-based annotation into reproducible scientific workflows.

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

↑