在如今網路發達的時代,客服中心擔任至關重要的角色,它提供了企業與顧客之間的直接溝通渠道。隨著現代的AI技術不斷創新,使用AI工具輔助的智能客服中心已成為業界的新趨勢。目前在中小企業中主流的做法是將商業大型語言模型(LLM)作為AI客服的核心,並結合檢索增強生成(RAG)架構,透過提供專屬的私有數據來賦予LLM生成更精確的回答。這種方法有效解決了由於商業LLM缺乏專業知識或私有訊息而導致的回答不準確或生成幻覺的問題。然而現有的RAG架構除了透過其他科技公司提供技術支持外,當中小企業想要自行建立時,對於檢索能力優化、資料量利用率、系統運行成本高與時間效率低等問題上仍有許多可以改進的空間。 於是本論文提出一套基於知識圖譜與變體三元相似度SBERT的RAG檢索器訓練架構,主要目的為用更小的成本與時間建立更加細緻的QA訓練資料,並訓練出更加優秀的RAG檢索器模型。在本論文的首階段利用CKIP分詞技術從文本中提取關鍵字,接著利用BM25算法計算文本間的相似度,建立文本相似度知識圖譜,此階段透過精確的相似度分析,豐富了知識圖譜的結構,提升了文本間關聯性的可視化和檢索效率。在第二階段本論文利用知識圖譜來確定問題與各文本之間的相似度軟標籤。這一方法不僅增強了問題與文本之間的關聯性,還細化了問題與多個相關文本的相似度關係。這樣的細緻關聯性為模型提供了更豐富的訓練訊號,有助於提升RAG檢索器的精準度和泛化能力。在最終階段本論文透過創新的三元相似度SBERT架構,將訓練模式從單一文本對應擴展到問題與多個文本間的多維配對,這不僅大幅增加了訓練資料的量,也提升了資料利用率。此架構讓問題與文本之間的配對更為精確,有效地強化了模型在處理複雜查詢時的適應性與精準度。 本論文的主要貢獻在於開發了一套高效率且低能耗的訓練架構,不僅提升了私有資料的利用率及文本檢索的準確性,也顯著提升了模型在處理複雜查詢時的適應性與準確度。實驗結果顯示透過本論文方法抓取的參考文本對於進階模型如LLAMA2、GPT4在生成答案上都展示了更佳的效果。
In today's digitally connected world, customer service centers play a crucial role, providing a direct communication channel between businesses and customers. With the continuous innovation of modern AI technologies, AI-assisted intelligent customer service centers have become an industry trend. For small and medium-sized enterprises (SMEs), the mainstream approach involves using large language models (LLMs) as the core of AI customer service, combined with a Retrieval-Augmented Generation (RAG) framework. By integrating proprietary data, this approach allows LLMs to generate more precise answers, effectively addressing issues related to inaccurate responses or hallucinations due to the lack of specialized knowledge or proprietary information in commercial LLMs. However, existing RAG frameworks, aside from being supported by other tech companies, still face several challenges when SMEs attempt to build them independently. These include optimization of retrieval capabilities, efficient data utilization, high system operation costs, and low time efficiency. To address these issues, this paper proposes a RAG retriever training framework based on knowledge graphs and variant triple similarity SBERT. The primary goal is to establish more refined QA training data at a lower cost and in less time, thereby training a more effective RAG retriever model. In the first phase of this study, CKIP segmentation technology is used to extract keywords from text, followed by the BM25 algorithm to calculate text similarity and construct a text similarity knowledge graph. This phase enriches the structure of the knowledge graph through precise similarity analysis, enhancing the visualization of text correlations and retrieval efficiency. In the second phase, this paper uses the knowledge graph to determine the soft labels of similarity between the query and various texts. This method not only strengthens the relevance between the query and the texts but also refines the similarity relationships among multiple related texts. Such detailed associations provide the model with richer training signals, aiding in improving the precision and generalization capability of the RAG retriever. In the final phase, this paper introduces an innovative triple similarity SBERT architecture, expanding the training model from single-text matching to multi-dimensional matching between the query and multiple texts. This not only significantly increases the amount of training data but also improves data utilization. This architecture makes the pairing between queries and texts more accurate, effectively enhancing the model's adaptability and precision when handling complex queries. The primary contribution of this paper lies in developing an efficient and low-power training framework that not only enhances the utilization of proprietary data and the accuracy of text retrieval but also significantly improves the model's adaptability and precision in handling complex queries. Experimental results show that the reference texts retrieved through this approach demonstrate better performance in generating answers with advanced models like LLAMA2 and GPT-4.