Bibliographic catalogues store millions of data. The use of computer techniques such as web-scraping allows the extraction of data in an efficient and accurate manner. The recent emergence of ChatGPT is facilitating the development of suitable prompts that allow the configuration of scraping to identify and extract information from databases. The aim of this article is to define how to efficiently use prompts engineering to elaborate a suitable data entry model, able to generate in a single interaction with ChatGPT-4o, a fully functional web-scraper, programmed in PHP language, adapted to the case of bibliographic catalogues. As a demonstration example, the bibliographic catalogue of the National Library of Spain with a dataset of thousands of records is used. The findings present an effective model for developing web-scraping programs, assisted with AI and with the minimum possible interaction. The results obtained with the model indicate that the use of prompts with large language models (LLM) can improve the quality of scraping by understanding specific contexts and patterns, adapting to different formats and styles of presentation of bibliographic information.
翻译:文献目录数据库存储着数百万条数据。使用网页抓取等计算机技术可以高效且准确地提取数据。近期ChatGPT的兴起,使得开发能够配置抓取流程以从数据库中识别和提取信息的适当提示成为可能。本文旨在定义如何有效利用提示工程来构建一个合适的数据录入模型,该模型能够在与ChatGPT-4o的单次交互中,生成一个完全可运行的、用PHP语言编写的、适用于文献目录数据库的网页抓取程序。作为一个演示示例,本文使用了西班牙国家图书馆的文献目录数据库,该数据集包含数千条记录。研究结果呈现了一个有效的、由人工智能辅助且实现最少交互的网页抓取程序开发模型。该模型获得的结果表明,使用基于大语言模型的提示,能够通过理解特定上下文和模式,适应文献信息的不同呈现格式和风格,从而提高抓取质量。