Web-API-Based Chatbot Generation with Analysis and Expansion for Training Sentences
1005Authors
nan
Abstract
AbstractWith Web API technology becoming increasingly mature, how to integrate Web API and Chatbot technology has become an issue of great interest. This study plans to build a semi-automatic method and tool, BOTEN. This method allows application developers to build Chatbot interfaces with specified Web APIs quickly. To ensure that the Chatbot has sufficient natural language understanding (NLU) capability, this research evaluates the training sentences written by the developer through TF-IDF, WordNet, and SpaCy techniques, and suggests the developer modify the training sentences with poor quality. This technique can also be used to automatically increase the number of training sentences to improve the capability of Intent recognition.
Keywords
Full Content
摘要 對話機器人 (Chatbot) 是近年來受到廣 泛歡迎的新穎技術,在 Web API 技術日 趨成熟的趨勢下,如何結合 Web API 與 Chatbot 技術也開始成為備受關注的議 題。本研究規劃建立一個可基於 Web API 生 成 Chatbot 之 半 自 動 化 方 法 BOTEN 及其實作平台,透過此方法, 可協助應用程式開發者快速建置出指 定 Web API 的 Chatbot 介面。為了確保 Chatbot 具 備 足 夠 的 自 然 語 言 理 解 (Natural Language Understanding, NLU) 能力,本研究透過 TF-IDF、WordNet 與 SpaCy 技術評估開發者撰寫的訓練 語句,對品質不佳的訓練語句提出警 訊,以提供訓練語句修改之建議;此 外,本研究亦提出一個自動擴增訓練 語 句 數 量 之 方 法 , 以 進 一 步 提 升 Chatbot 的意圖辨識能力。 Abstract With Web API technology becoming increasingly mature, how to integrate Web API and Chatbot technology has become an issue of great interest. This study plans to build a semi-automatic method and tool, BOTEN. This method allows application developers to build Chatbot interfaces with specified Web APIs quickly. To ensure that the Chatbot has sufficient natural language understanding (NLU) capability, this research evaluates the training sentences written by the developer through TF-IDF, WordNet, and SpaCy techniques, and suggests the developer modify the training sentences with poor quality. This technique can also be used to automatically increase the number of training sentences to improve the capability of Intent recognition. 關 鍵 字 : 對 話 機 器 人 、Web API、Rasa、 WordNet、SpaCy Keywords: Chatbot, Web API, Rasa, WordNet, SpaCy 1 緒論 對話機器人 (Chatbot) 利用電腦程式模擬真人 來與使用者互動,並透過通訊平台等介面讓 使用者可以用文字或語音與其進行交談,也 會搭配自然語言處理來幫助對話機器人判斷 使用者意圖、實體,其應用包括電子商務、 客戶服務、內容宣傳、推播通知、個人助理 等 (Brandtzaeg & Følstad, 2017)。目前許多企業 都開始使用對話機器人於實際的營運上,典 型案例包含協助處理飯店客戶問題的機器人 (Michaud, 2018)、可協助團隊管理的機器人 (Toxtli, Monroy-Hernández, & Cranshaw, 2018)、 以 及 作 為 特 定 領 域 之 推 薦 專 家 的 機 器 人 (Cerezo, Kubelka, Robbes, & Bergel, 2019) 等, 在應用上相當多元。 另一方面,在 Web API 技術日趨成熟的趨勢 下,越來越多的公司將自身服務包裝為 Web API,以提供給第三方開發者進行應用開發及 服務整合,而延續此技術趨勢,如何結合 Web API 與 Chatbot 技術也開始成為備受關注 的 議 題 。 根 據 Stackoverflow 的 研 究 調 查 (Abdellatif, Costa, Badran, Abdalkareem, & Shihab, 2020),開發者對於 Integration 類型的 問題最為重視,特別是 Chatbot 與 Web API 之 整合。在先前相關的研究上,Vaziri 等學者開 發 了 SwaggerBot (Vaziri, Mandel, Shinnar, Siméon, & Hirzel, 2017),欲試圖解決上述之議 題,SwaggerBot 是一個利用 OpenAPI 規範加 入擴充規範後,透過編譯器生成的 Chatbot , Web API 之開發者只要能提供具備完整規範的 支援訓練語句分析與擴增之 Web API 對話機器人生成機制 Web-API-Based Chatbot Generation with Analysis and Expansion for Training Sentences 王聖凱 (Sheng-Kai Wang) 國立臺灣海洋大學 / 202 基隆市中正區北寧路 2 號 nssh94879487@gmail.com 游婉琳 (Wan-Lin You) 國立臺灣海洋大學 / 202 基隆市中正區北寧路 2 號 gn01868184@gmail.com 馬尚彬 (Shang-Pin Ma) 國立臺灣海洋大學 / 202 基隆市中正區北寧路 2 號 albert@ntou.edu.tw The 34th Conference on Computational Linguistics and Speech Processing (ROCLING 2022) Taipei, Taiwan, November 21-22, 2022. The Association for Computational Linguistics and Chinese Language Processing 246 Swagger (亦稱為 OAS: OpenAPI Specification ("OpenAPI Specification," 2021) ) 文件,便能編 譯出一個能存取 REST API 的 Chatbot。然而, SwaggerBot 以每個 API 端點的名稱作為唯一 的訓練語句,故產生的 Chatbot 自然語言理解 能力較不理想,需透過 Power User 為既有功能 的存取創造捷徑以及捷徑的同義詞,補強其 NLU 能力。其次,各端點之間的呼叫缺乏一 個完整的故事流程規劃,所以無法提供終端 使用者一個友善的使用者體驗。 我們再進一步分析 Web API 與 Chatbot 之整 合工作,從開發者角度有三個較困難的環節: (1) 開發者需具備 Chatbot 開發框架的詳盡知識, 需要熟悉對話流程所需的文件設定與操作步 驟;(2) 需能撰寫 Chatbot 與 Web API 之轉接元 件(Adapter),除了要能透過程式將 Chatbot 之 組成元素 (如 Intent、Entity、Slot 等) 與 Web API 之服務功能銜接起來,還要能妥善處理服 務回應結果 (Service Response) 之呈現;(3) 需 要撰寫足夠品質與數量的訓練語句,以訓練 出具備足夠 NLU 能力的 Chatbot,正確判斷終 端使用者的意圖(Intent),並做出適當的回覆。 因此,為能降低 Chatbot 開發之複雜度,我們 採 取 的 策 略 是 基 於 模 型 驅 動 工 程(Model- Driven Engineering) (Schmidt, 2006) 的概念,希 望能讓開發者聚焦於 Web API 與 Chatbot 之概 念整合方式,而非底層框架細節與轉接元件 之開發。由於 Swagger 是目前最被廣泛運用的 Web API 之描述語言,許多 Web API 之開發者 均已提供 Swagger 描述文件,以供客戶端與其 他開發者運用,本研究首先遵循 Swagger 之標 …
Content truncated to 500 words
Labeled Text
AbstractWith Web API technology becoming increasingly mature, how to integrate Web API and Chatbot technology has become an issue of great interest. This study plans to build a semi-automatic method and tool, BOTEN. This method allows application developers to build Chatbot interfaces with specified Web APIs quickly. To ensure that the Chatbot has sufficient natural language understanding (NLU) capability, this research evaluates the training sentences written by the developer through TF-IDF, WordNet, and SpaCy techniques, and suggests the developer modify the training sentences with poor quality. This technique can also be used to automatically increase the number of training sentences to improve the capability of Intent recognition.
Publication Details
- Paper ID:
- 1005
- Year:
- 2022
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan