大型語言模型興起,讓人們可以透過文字生成想要的文案、圖檔、程式碼甚至詩歌。然而,以生成資料庫查詢語言(text-to-SQL)來說,由於大語言模型對企業資料模型普遍不熟悉,同時企業基於資訊安全考量,通常也不會無條件地開放資料給生成式AI學習,實驗發現,在這樣的限制下,生成式 AI是無法產生符合企業使用的資料庫查詢語言。因此,為了探討解決這樣的問題,本實驗建構了一個模擬企業應用的人事系統,並開發了一個基於 ChatGPT的大型語言模型的資料庫查詢語言合成器,透過基本的自然語言前處理和符合企業使用情境的資料模型,合成出合乎企業環境的提示(Prompt)詞,成功誘發大型語言模型ChatGPT產生合乎企業使用的資料庫查詢語言成果。
The rise of large language model enables people to generate desired copywriting, graphic files, program codes even poem through text. However, for the task of generating database language (text-to-SQL), large language models such as ChatGPT is not familiar with enterprise data models, and enterprises are unwilling to share their data knowledge to general-purpose generative in context learning so that LLMs cannot produce the contextual results. Therefore, we construct a simulation enterprise system to develop a natural language to SQL synthesizer which can generate suitable prompts through natural understanding and natural language process to generate contextual results. The experiment shows that through a preliminary natural language understanding of the user’s problem and enterprise database knowledge can induce correct database query language.