arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2406.10690cs.AIcs.DB
收藏

药物警戒证据生成自动化:利用大型语言模型生成上下文感知的SQL

Automating Pharmacovigilance Evidence Generation: Using Large Language Models to Produce Context-Aware SQL

GlaxoSmithKline(葛兰素史克);Tech Mahindra;London School of Hygiene and Tropical Medicine(伦敦卫生与热带医学院)

Jeffery L. Painter, Venkateswara Rao Chalamalasetti, Raymond Kassekert, Andrew Bate

AI总结:

本研究提出在检索增强生成(RAG)框架中结合业务上下文文档使用GPT-4,将药物警戒自然语言查询转换为SQL,显著提升查询准确性,为非技术用户信息检索提供高效框架。

摘要:

目的:通过使用大型语言模型(LLMs)将自然语言查询(NLQs)转换为结构化查询语言(SQL)查询,并利用业务上下文文档,提高从药物警戒(PV)数据库检索信息的效率和准确性。材料与方法:我们在检索增强生成(RAG)框架中使用OpenAI的GPT-4模型,结合业务上下文文档,将NLQs转换为语法精确的SQL查询。每个NLQ被随机且独立地呈现给LLM以防止记忆。研究分三个阶段进行,改变查询复杂度,并评估LLM在有无业务上下文文档时的性能。结果:我们的方法显著提高了NLQ到SQL的准确性,从仅使用数据库模式时的8.3%提升至结合业务上下文文档时的78.3%。这种提升在低、中、高复杂度查询中均一致,表明上下文知识在查询生成中的关键作用。讨论:整合业务上下文文档显著提高了LLM生成准确且上下文相关的SQL查询的能力。排除高复杂度查询时性能最高达到85%,表明其在常规部署中的潜力。结论:本研究提出了一种利用LLMs进行安全数据检索和分析的新方法,展示了查询生成准确性的显著进步。该方法提供了一个适用于各种数据密集型领域的框架,提高了非技术用户信息检索的可及性和效率。

英文摘要:

Objective: To enhance the efficiency and accuracy of information retrieval from pharmacovigilance (PV) databases by employing Large Language Models (LLMs) to convert natural language queries (NLQs) into Structured Query Language (SQL) queries, leveraging a business context document. Materials and Methods: We utilized OpenAI's GPT-4 model within a retrieval-augmented generation (RAG) framework, enriched with a business context document, to transform NLQs into syntactically precise SQL queries. Each NLQ was presented to the LLM randomly and independently to prevent memorization. The study was conducted in three phases, varying query complexity, and assessing the LLM's performance both with and without the business context document. Results: Our approach significantly improved NLQ-to-SQL accuracy, increasing from 8.3\% with the database schema alone to 78.3\% with the business context document. This enhancement was consistent across low, medium, and high complexity queries, indicating the critical role of contextual knowledge in query generation. Discussion: The integration of a business context document markedly improved the LLM's ability to generate accurate and contextually relevant SQL queries. Performance achieved a maximum of 85\% when high complexity queries are excluded, suggesting promise for routine deployment. Conclusion: This study presents a novel approach to employing LLMs for safety data retrieval and analysis, demonstrating significant advancements in query generation accuracy. The methodology offers a framework applicable to various data-intensive domains, enhancing the accessibility and efficiency of information retrieval for non-technical users.

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

↑