Processing method and system based on Telechat large model

The Telechat large model system addresses the limitations of existing technologies by enhancing data preprocessing, integrating retrievers, and constructing prompt words to provide accurate and professional answers in specialized fields.

CN119226489AInactive Publication Date: 2024-12-31CHINA TELECOM UNMANNED TECHNOLOGY (JIANGSU) CO LTD

Patent Information

Application Number
CN202411757503.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Large language models face challenges in providing accurate and professional answers in specialized fields like medicine and law due to lack of in-depth learning, requiring significant computing resources and complex preprocessing, and existing fine-tuning and RAG technologies have limitations in resource-constrained environments.

Method used

A processing method and system using the Telechat large model that includes data preprocessing, building a knowledge base, integrating retrievers, and constructing prompt words to enhance accuracy and reliability in professional fields.

Benefits of technology

The method and system improve the accuracy and reliability of large language models in various fields by utilizing a Telechat model with a customized knowledge base and integrated retrievers, enabling efficient and accurate question answering under resource constraints.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226489A_ABST
    Figure CN119226489A_ABST
Patent Text Reader

Abstract

The invention discloses a processing method and system based on a Telechat large model, and belongs to the technical field of language models. Comprising the following steps: collecting and preprocessing text knowledge; constructing a knowledge base according to the preprocessed text knowledge, decomposing the text knowledge of the knowledge base, converting the text knowledge into numeric vectors by using a text vectorization tool, and storing the numeric vectors; constructing an integrated retriever, retrieving a knowledge base, and fusing and sequencing retrieval results; and on the basis of the retrieval result after fusion sorting, a cue word is constructed, and the Telecat large model is driven to output the result. Compared with the prior art, the method has the advantages that on the basis of the basic RAG technology, three different levels of retrieval strategies are used for fusion retrieval, a more accurate and credible retrieval result is obtained, specialized questions and answers of the general large model in all fields are achieved, the auxiliary effect of the RAG technology on the general large model is enhanced, and the retrieval efficiency is improved. And landing use of large models in various fields is accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of language model technology, and more specifically, to a processing method and system based on a Telechat large model. Background Art

[0002] In recent years, the field of natural language processing (NLP) has made significant progress, especially driven by large language models (LLMs). Advanced large language models such as GPT-4 and QWen have demonstrated excellent performance in text analysis, generation, and many other natural language processing tasks, and have gradually become a powerful assistant in the lives and work of many users. These large language models are trained with massive amounts of normalized text data and have the ability to handle a wide range of natural language tasks, including text generation, language translation, question-answering systems, etc., showing strong generalization capabilities.

[0003] However, despite the remarkable achievements of large language models in general fields, their performance is often unsatisfactory when faced with highly specialized fields such as medicine and law. These fields require the model to accurately understand complex terms, rules, and logic, and since large language models lack in-depth learning for these fields, it is difficult for them to provide accurate and professional answers. Due to the lack of in-depth learning for these fields, their performance is often not as good as that of customized small models, and it is difficult to provide accurate and professional answers. In addition, the training and application of large language models face a series of challenges. First, they usually require a large amount of diverse text data to cover as many contextual conditions as possible, which requires not only huge data sets but also complex preprocessing and cleaning processes. Secondly, large language models with billions or hundreds of billions of training parameters require massive computing resources and long training cycles, which further limits their application in resource-constrained environments.

[0004] In the customized development scenario of large language models, in order to enhance the ability of customized models, fine-tuning and RAG (Retrieval-Augmented Generation) are currently the two main technologies used. Although these two technologies have their own advantages, they also face a series of challenges and limitations. Fine-tuning technology adjusts the parameters of the large language model pre-trained model to adapt to the knowledge of various fields. According to different practical applications and methods, fine-tuning can be divided into various types such as full parameter fine-tuning, low-rank fine-tuning, and incremental fine-tuning. The advantage of fine-tuning technology is that it can fine-tune the pre-trained model according to the dataset of the task or field, thereby improving the performance of the model on the task. However, fine-tuning technology also has significant limitations. First, the fine-tuning process usually requires a lot of computing resources and time costs, which is a considerable challenge for resource-constrained environments. Second, the production of high-quality datasets is costly, and the model's ability to master new knowledge during the fine-tuning process may be enhanced, resulting in a potential decline in general domain capabilities, which limits the rapid adaptation and application of fine-tuning technology in various fields. Unlike fine-tuning technology, RAG technology assists large language models in generating answers by retrieving and inputting question-related information from external databases. The advantage of RAG technology is that it can use information in external knowledge bases to improve the accuracy and relevance of text answers. The knowledge base can be updated separately without changing the parameter file of the model itself, thereby reducing the learning iteration cost of new knowledge. However, RAG technology also faces some challenges. First, the effectiveness of RAG technology is highly dependent on the quality and scale of knowledge in the knowledge base. If the knowledge base is not perfect or contains errors, it will directly affect the accuracy and reliability of the text answers generated by the large language model. Secondly, RAG technology requires the construction of an efficient and accurate retrieval system to support the rapid retrieval of relevant information from the knowledge base, which increases the complexity of the system and the difficulty of implementation.

[0005] In summary, fine-tuning and RAG technologies each have obvious limitations in customized development scenarios. How to improve the quality of the dataset and ensure the accuracy and completeness of the knowledge base while ensuring model performance is an urgent problem to be solved.

[0006] In the related art, for example, Chinese patent CN117473063A provides a knowledge matching-enhanced large language model question-answering method based on a knowledge base, including: extracting information from a local knowledge base based on questions to be answered to obtain knowledge related to the local knowledge base; extracting information from a large language model knowledge base based on questions to be answered to obtain knowledge related to the large language model knowledge base; merging the knowledge related to the local knowledge base and the knowledge related to the large language model knowledge base, and inputting them into the large language model to obtain the answer to the question to be answered. The technical solution of this invention uses a similarity matching method to retrieve the local knowledge base and screen the knowledge from the local knowledge base through a large language model, but the technical solution of this invention can only improve the performance of the large language model in the field of simple open domain question-answering. For example, Chinese patent CN118210891A provides a reliable legal question-answering generation method based on knowledge fine-tuning of a large language model, including the following steps: S1: constructing a legal knowledge base; S2: constructing dialogue sample data based on legal knowledge; S3: pre-training and knowledge fine-tuning the selected large language model; S4: feedback optimization of the large language model. The technical solution of this invention is only applicable to the legal field and has obvious limitations.

[0007] From the above, we can see that the relevant technology does not provide any technical inspiration on how to improve the accuracy of knowledge question answering using large language models in professional fields. Summary of the invention

[0008] 1. Technical issues to be solved In response to the problem in the prior art of how to improve the accuracy of knowledge question and answering using large language models in professional fields, the present invention provides a processing method and system based on the Telechat large model, which can achieve in-depth professional development for tasks or fields, and utilize the powerful basic capabilities of the Telechat large model in combination with the professional knowledge of the local knowledge base to provide more accurate and professional knowledge question and answer results.

[0009] 2. Technical solution The purpose of the present invention is achieved through the following technical solutions.

[0010] The content of this application is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this application is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0011] Some embodiments of the present application propose a processing method and system based on the Telechat large model to solve the technical problems mentioned in the above background technology section.

[0012] As a first aspect of the present application, some embodiments of the present application provide a processing method based on the Telechat large model, comprising the following steps: collecting text knowledge and preprocessing; building a knowledge base based on the preprocessed text knowledge, decomposing the text knowledge of the knowledge base, and using a text vectorization tool to convert the text knowledge into a numerical vector and store it; building an integrated searcher, searching the knowledge base and fusing and sorting the search results; the process of fusing and sorting the search results is specifically as follows: after obtaining the search results, using a reciprocal sorting fusion algorithm to fuse and sort the search results; the reciprocal sorting fusion algorithm The expression is: ; represents the result of the reciprocal sorting fusion algorithm, represents the vectorized local knowledge base, Represents a collection of search results. Represents the query text The ranking position in the search results, represents a constant, The value of is 60; Based on the fusion and sorted search results, prompt words are constructed to drive the Telechat large model to output results.

[0013] Furthermore, the preprocessing process is specifically as follows: collecting text knowledge from various fields; using a deduplication strategy that combines the text segment level and the vocabulary level to deduplicate the corpus; using word segmentation tools to perform content correction based on dictionary matching.

[0014] Furthermore, the process of corpus deduplication is as follows: at the text segment level, the cosine similarity and Jaccard similarity are used to calculate the similarity between text paragraphs; at the vocabulary level, the similarity of the words in the text is calculated.

[0015] Furthermore, the content correction process is specifically as follows: construct a dictionary containing incorrect words and their corresponding correct words, and the dictionary content is updated as the knowledge base is updated; use the word segmentation tool to segment the text to be tested, traverse the word segmentation results and search for the words to be corrected in the dictionary, match the word segmentation results with the words to be corrected in the dictionary; replace the successfully matched words with the words in the dictionary.

[0016] Furthermore, precision and recall are used to evaluate the quality of the output results; the higher the match between the generated text and the reference answer text, the higher the precision of the output result; the higher the recall rate, the higher the probability that the output result contains the reference answer text.

[0017] Furthermore, the F1 score is used to evaluate the quality of the output results to obtain the retriever weight. The F1 score is calculated based on the harmonic mean of precision and recall. The expression of the F1 score is as follows: F1-Score=2× ; F1-Score represents the evaluation result of the F1 score, Precision represents the accuracy, and Recall represents the recall rate.

[0018] Furthermore, the integrated retriever includes Bert, BM25 and KNN; in the fusion process, the weight of Bert is 0.5; the weight of BM25 is 0.3; and the weight of KNN is 0.2.

[0019] Furthermore, the text vectorization process is as follows: use the Bert model to vectorize text, use Faiss as a vector database, and convert text data into numerical vectors.

[0020] Furthermore, the process of outputting results is as follows: combining the question with the result of the integrated retriever to form the knowledge background of the question and construct prompt words; inputting the prompt words into the Telechat big model, and the Telechat big model outputs the results based on the knowledge background and prompt words.

[0021] As the second aspect of the present application, some embodiments of the present application provide a system for a processing method based on the Telechat big model, including a data preprocessing module: collecting text knowledge and preprocessing; building a knowledge base module: building a knowledge base based on the preprocessed text knowledge, decomposing the text knowledge of the knowledge base, and using a text vectorization tool to convert the text knowledge into a numerical vector and store it; building a retriever and fusion result module: building an integrated retriever, searching the knowledge base and fusing and sorting the search results; an output module: based on the fusion-sorted search results, building prompt words to drive the Telechat big model to output results.

[0022] 3. Beneficial effects Compared with the prior art, the advantages of the present invention are: a processing method and system based on the Telechat big model of the present invention can solve the customized adaptation and application problems of big models in various fields under conditions of limited resources and short development cycle. On the basis of basic RAG technology, three different levels of retrieval strategies are used for fusion retrieval to obtain more accurate and reliable retrieval results, realize the professional question and answer of general big models in various fields, enhance the auxiliary role of RAG technology on general big models, and accelerate the implementation of big models in various fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a flowchart of a processing method based on the Telechat big model in one embodiment of the present invention; Figure 2 A flowchart of creating a knowledge base in one embodiment of the present invention; Figure 3 A schematic diagram of knowledge base retrieval and result fusion in one embodiment of the present invention; Figure 4 The figure is a flow chart of a local knowledge base question-answering system based on the Telechat big model in one embodiment of the present invention. DETAILED DESCRIPTION

[0024] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0025] Combination Figures 1 to 3 , a processing method based on the Telechat large model of the present invention comprises the following steps: Collect text knowledge and perform preprocessing; Build a knowledge base based on the preprocessed text knowledge, decompose the text knowledge of the knowledge base, and use text vectorization tools to convert the text knowledge into numerical vectors and store them; Build an integrated search engine to search the knowledge base and rank the search results; Based on the fusion-ranked search results, construct Prompt words and drive the Telechat large model to output results.

[0026] S1. Data preprocessing Preprocess the collected text knowledge in various fields, including corpus deduplication and content correction. When building a customized large language model knowledge base, preprocessing the collected text knowledge in various fields can ensure the purity of the content of the local knowledge base and improve the accuracy of the model's answers. By removing redundant information and correcting content errors, the model is provided with a pure and accurate source of knowledge, thereby ensuring the accuracy and reliability of the large language model when answering.

[0027] In a specific embodiment, the data preprocessing process specifically includes: S101. Collect textual knowledge in various fields: Based on the questions to be answered, information is extracted from the local knowledge base to obtain knowledge related to the local knowledge base; based on the questions to be answered, information is extracted from the large language model knowledge base to obtain knowledge related to the large language model knowledge base.

[0028] Textual knowledge in various fields includes but is not limited to textual knowledge such as book reports, academic papers, and news reports.

[0029] Specifically, collecting text knowledge in various fields includes collecting local knowledge base information and collecting large language model knowledge base information. Based on the questions to be answered, the information collection task is first performed in the local knowledge base. At the same time, in order to enrich the knowledge base content, relevant information needs to be collected from the knowledge base of the large language model.

[0030] Performing information gathering tasks in a local knowledge base involves extracting key information related to the question from stored text using natural language processing techniques. Gathering relevant information from the knowledge base of a large language model usually involves interacting with the model, leveraging its powerful language understanding and generation capabilities to extract text snippets or concepts that are closely related to the question.

[0031] Among them, natural language processing technology includes named entity recognition and relationship extraction.

[0032] S102, corpus deduplication: A deduplication strategy combining text segment level and vocabulary level is adopted to ensure that duplicate information is not stored in the knowledge base, reduce the waste of storage space, and improve the efficiency of subsequent processing steps.

[0033] Specifically, through the text similarity algorithm, the knowledge in each field is deduplicated at the text segment level and the vocabulary level to minimize the noise brought to the retrieval process by repeated and low-quality information. The text similarity algorithm includes cosine similarity and Jaccard similarity.

[0034] At the text segment level, cosine similarity and Jaccard similarity are used to calculate the similarity between different text paragraphs, and a reasonable threshold is set to identify and remove duplicate paragraphs; at the vocabulary level, the similarity of the words in the text is further calculated to remove redundant words and reduce information noise.

[0035] In addition, similarity algorithms are tuned according to the characteristics of each field. For example, in the field of machine learning, the algorithm may need to be trained to be more sensitive to algorithm names, technical terms, etc., so as to more accurately identify duplicate information.

[0036] In a specific embodiment, the process of deduplication of corpus is as follows: Suppose there are three articles about "machine learning" with the following abstracts: Text A: This paper introduces the support vector machine algorithm in machine learning, including its principles, application scenarios, advantages and disadvantages.

[0037] Text B: Support vector machine is an important algorithm in machine learning. This article elaborates on its principles, application scenarios, and performance in practical applications.

[0038] Text C: This paper explores the application of deep learning to image recognition and compares it with machine learning algorithms.

[0039] Among them, the threshold is set to 0.8; the cosine similarity between text A and text B is 0.85, and the Jaccard similarity is 0.8; the cosine similarity between text A and text C is 0.4, and the Jaccard similarity is 0.3.

[0040] Since the cosine similarity between text A and text B is 0.85, which exceeds the threshold of 0.8, it is determined that text A and text B have a high degree of repetition, and one of them is selected to be retained; Since the cosine similarity of 0.4 and the Jaccard similarity of 0.3 between text A and text C do not exceed the threshold of 0.8, it is determined that the repetition between text A and text C is relatively low, so both texts A and text C are retained.

[0041] As shown in the above example, by calculating the similarity between texts A, B, and C and making deduplication decisions based on the set threshold, the information in the knowledge base is ensured to be concise and accurate.

[0042] S103, content correction: Jieba word segmentation and dictionary-based matching are used for text detection and word correction to prevent errors in the knowledge base from affecting the accuracy of large model answers.

[0043] Specifically, we first build a dictionary containing common incorrect words and their correct counterparts, and continuously update the dictionary content as the knowledge base is updated. The dictionary structure is a key-value pair of (words to be corrected: correct words), which is convenient for fast search and replacement.

[0044] Secondly, use the Jieba word segmentation tool to segment the text to be tested, traverse the word segmentation results and query the dictionary to see if there are words to be corrected, and match the word segmentation results with the words to be corrected in the dictionary. For the words that are successfully matched, replace them with the correct words in the dictionary. Finally, reassemble the corrected words into a new text.

[0045] Through data preprocessing, we can ensure that text knowledge in various fields has been strictly deduplicated and content corrected before being integrated into the knowledge base. This not only helps to improve the accuracy of the model when answering, but also reduces misunderstandings and misleading caused by erroneous or redundant information.

[0046] S2. Build a knowledge base Building a knowledge base is a key step in converting preprocessed knowledge into numerical vectors for efficient retrieval and application. Based on the preprocessed knowledge, a knowledge base is built to decompose text knowledge into smaller units that are easier to manage. Text vectorization tools are used to convert them into numerical vectors and store them in the database.

[0047] In a specific embodiment, the process of building a knowledge base specifically includes: S201, text decomposition: Text decomposition is the process of breaking down larger chunks of text (such as entire articles, chapters, or long paragraphs) into smaller, more manageable units. Text decomposition ensures that the information in the knowledge base is structured for subsequent processing and retrieval.

[0048] Larger text blocks refer to entire articles, chapters or long paragraphs. These larger text blocks may contain multiple sentences, paragraphs or chapters, with a large amount of information, which is difficult to process directly. By breaking them into sentences, phrases or smaller text fragments, it is easier to capture and process the information in the text and ensure the information structure of the knowledge base.

[0049] Specifically, the complexity of the text content needs to be considered during text decomposition. The complexity includes the complexity of the grammatical structure, the diversity of the vocabulary, and the implicit semantic relationships in the text. Highly complex texts contain more complex sentence structures, more professional terms or references, and semantic connections that require in-depth understanding to grasp.

[0050] For texts with low complexity, such as daily conversations or simple statements, a finer decomposition granularity, such as sentence-level decomposition, can be used to capture more detailed and critical information; while for texts with high complexity, such as academic papers or professional reports, a coarser decomposition granularity, such as paragraph-level decomposition, may be required to ensure that the decomposed units can maintain the coherence and integrity of the context, thereby avoiding information loss or misunderstanding. At the same time, the structuring of information also needs to be considered in the process of text decomposition. By decomposing the text into smaller units, it is easier to capture and process the information in the text, such as keywords, phrases, and sentences. These smaller units can serve as the basic building blocks of the knowledge base, facilitating subsequent knowledge storage and retrieval.

[0051] S202, Text Vectorization: Text vectorization is the process of converting text data into numerical vectors, and is a key step in achieving efficient retrieval.

[0052] In this embodiment, the Bert model is used for text vectorization, and Faiss, which supports efficient similarity search, is selected as the vector database.

[0053] The Bert model is a context-sensitive language model that can capture contextual information in text and reflect the semantic content of the text. The high-dimensional dense vector generated by the Bert model can accurately represent the meaning and features of the text, providing effective support for subsequent retrieval calculations.

[0054] Faiss is a library specifically designed to handle large-scale vector similarity searches, supporting efficient vector indexing and retrieval. By storing text vectors in Faiss, fast similarity calculation and retrieval can be achieved, improving the efficiency and accuracy of knowledge base usage.

[0055] In the process of text vectorization, you also need to pay attention to the dimension and sparsity of the vector. Vectors with too high a dimension or sparseness will increase the complexity of calculation and storage and reduce retrieval efficiency. Therefore, when choosing the Bert model and Faiss, you need to perform parameter tuning and performance evaluation according to the actual situation to ensure the effect and efficiency of vectorization.

[0056] In summary, building a knowledge base is the key to converting preprocessed knowledge into numerical vectors for efficient retrieval and application. Through the two steps of text decomposition and text vectorization, the information structure and efficient retrieval of the knowledge base can be achieved. This provides solid data support and guarantee for the construction of customized large language models, which helps to improve the accuracy and reliability of the model.

[0057] S3. Build an integrated retriever and fuse the search results: Build an integrated retriever and use retrievers with different retrieval strategies to search the knowledge base. The retrieval results will be fused and ranked according to the set importance weights.

[0058] Building an integrated retriever can utilize multiple strategies to perform content retrieval on vector databases, and comprehensively rank the retrieval results through result fusion algorithms, thereby providing more accurate and comprehensive retrieval results.

[0059] In a specific embodiment, the process of building an integrated retriever specifically includes: S301, Integrated Retriever: In the process of building an integrated search engine, the advantages of multiple search strategies are fully integrated to retrieve the most accurate and comprehensive information from the vector knowledge base. This process relies on reasonable weight distribution and result fusion mechanism to ensure the accuracy and practicality of the final search results.

[0060] Specifically, three different levels of retrievers are adopted: the keyword-based BM25 algorithm, the semantic-based Bert model, and the vector feature-based KNN model.

[0061] As a classic keyword retrieval algorithm, the BM25 algorithm is known for its ability to quickly query and accurately locate corpus knowledge containing keywords. It can efficiently handle vocabulary matching problems and is suitable for retrieval of large-scale text data.

[0062] The Bert model performs well in complex queries and semantic understanding due to its powerful semantic understanding ability. It can capture semantic relevance that is difficult to find with keyword search, thus providing more accurate semantic similarity search results. The effective use of the Bert model enables the retriever to have a deeper understanding of the semantic features and contextual information of the text.

[0063] The KNN model uses the similarity of vector features for retrieval. It can calculate the similarity between the retrieval vector features and the corpus vector features in the knowledge base, thereby retrieving the most similar corpus knowledge. The introduction of the KNN model adds the ability of vector space search to the retriever, further improving the accuracy and comprehensiveness of the retrieval.

[0064] S302, search result integration: After obtaining the search results of the three search engines BM25, Bert and KNN, a fusion strategy is used to sort and fuse these results. Specifically, the reciprocal rank fusion algorithm RRF (Reciprocal Rank Fusion) is used to fuse the three result sets into one result set.

[0065] Specifically, the inverse sorting fusion algorithm The expression is as follows: ; in, represents the result of the reciprocal sorting fusion algorithm, represents the vectorized local knowledge base, Represents a collection of search results. Represents the query text The ranking position in the search results, represents a constant, As a smoothing factor to prevent a search engine from dominating the ranking results, The default value is usually 60.

[0066] In the fusion process, according to the characteristics of Bert, BM25 and KNN retrievers, weights of 0.5, 0.3 and 0.2 are given to them respectively. The weight allocation is based on the following considerations: The top K search results are obtained for the BM25 searcher, Bert searcher and KNN searcher respectively. The top K search results refer to the top K results after being sorted according to the sorting criteria. Here, K represents the number of top (i.e., most relevant or optimal) results selected from all results. The three result sets of the BM25 searcher, Bert searcher and KNN searcher are fused into a single result set by using the reciprocal rank fusion algorithm RRF (Reciprocal Rank Fusion) through the set weights for fusion sorting. The Bert searcher performs well in complex queries and semantic understanding, can effectively capture the semantic features and contextual information of the text, and can provide semantically more accurate and relevant search results. In this method, it is given a high weight of 0.5. The BM25 searcher has been widely used in the field of traditional information retrieval, can handle vocabulary matching problems well, and has high efficiency and stability when retrieving large-scale text data. However, it performs poorly in semantic query understanding, and is given a medium weight of 0.3 in this method. The KNN retriever is sensitive to data distribution and feature selection and has weak stability, so it is given a low weight of 0.2 in this method.

[0067] In this embodiment, precision, recall and F1-Score are used to evaluate the quality of the generated text. The higher the precision, the higher the match between the generated text and the reference answer text; the higher the recall, the higher the probability that the generated text contains the reference answer text; the F1-Score is used to balance precision and recall.

[0068] F1-Score is a commonly used evaluation indicator in information retrieval and machine learning. It takes into account both precision and recall. The F1 score is used to evaluate the quality of the output results to obtain the retriever weight. The F1 score is calculated based on the harmonic mean of precision and recall. The expression of the F1 score is as follows: F1-Score=2× ; F1-Score represents the evaluation result of the F1 score, Precision represents the accuracy, and Recall represents the recall rate.

[0069] More specifically, precision represents the proportion of the generated text that correctly answers the question, which is the portion of the generated text that matches the reference answer text divided by the total length (or total number) of the generated text; recall represents the proportion of the generated text that contains the reference answer text, which is the portion of the generated text that matches the reference answer text divided by the total length (or total number) of the reference answer text.

[0070] F1-Score balances these two metrics by taking the harmonic mean of precision and recall. When both precision and recall are high, F1-Score will also be high, indicating that the quality of the generated text is high, both accurate and comprehensive.

[0071] As shown in Table 1, the impact of the distribution weight on the results, W bm25 represents the weight of the BM25 retriever in the ensemble retriever, W bert represents the weight of the BERT retriever in the ensemble retriever, W knn It represents the weight of the KNN retriever in the integrated retriever. Under the weight set in this method, it has the highest recall rate and F1 score, which means that the retrieval results have more accurate background knowledge and can be effectively provided to the large language model as a reference.

[0072] Table 1 The impact of assigned weights on the results

[0073] According to the characteristics of Bert, BM25 and KNN retrievers, and the results of experimental data, weights of 0.5, 0.3 and 0.2 are given to Bert retriever, BM25 retriever and KNN retriever respectively, and the reciprocal sorting fusion algorithm RRF is used to fusion the three result sets into a single result set.

[0074] Specifically, after sorting and merging the Top K results returned by the BM25, Bert, and KNN retrievers, duplicate information is removed.

[0075] S4. Output the answer: Construct prompt words based on the integrated retriever results to drive the Telechat large model to output high-quality answers.

[0076] Specifically, the results of the integrated retriever and the original question are combined into a new prompt word, which serves as the real input for the Telechat large model to process. The Telechat large model generates relevant answers in various fields based on the input prompt.

[0077] In the process of generating answers, the results of the integrated retriever are combined with the original question to construct an efficient prompt word, which serves as the real input for the Telechat large model to process. This step aims to use the powerful generation ability of the large model to output accurate and detailed answers to questions in various fields.

[0078] In a specific embodiment, the process of generating an answer specifically includes: Prompt word construction: To ensure the best generation effect of the Telechat large model, the original question is combined with the result of the integrated search engine to form the knowledge background of the original question. The core information of the knowledge background of the original question includes keywords and question types. The structured knowledge background is integrated into the prompt word to construct the prompt word. The prompt word not only contains the core information of the question, but also incorporates rich relevant knowledge, providing comprehensive input information for the Telechat large model.

[0079] In the prompt words, clearly state the task instructions that the Telechat model needs to complete, such as "give your reasons and answers", "provide detailed explanations", etc. At the same time, set clear input and output format specifications, such as using the "##" symbol to separate reasons and answers to ensure the clarity and readability of the answers.

[0080] The constructed Prompt words are processed as input to the Telechat big model; the Telechat big model uses its understanding and generation capabilities to generate logical and accurate answers based on the input Prompt words.

[0081] In a specific embodiment, the following is a specific Prompt prompt word sample format, which shows how to construct an efficient Prompt prompt word: Task Description: You are an artificial intelligence expert and are now faced with a problem related to artificial intelligence (original question). Please combine relevant information (search fusion result Background) to give your reasons and answer.

[0082] Note: When answering, please pay attention to whether the material provides key information and whether it can directly or indirectly answer relevant questions. Evaluate the credibility and authority of the material and ensure that your answer is based on reliable sources of information.

[0083] You need to briefly explain your reasons.

[0084] Please use the “##” symbol to separate your reasons and answers, and output your answers strictly according to the following output format.

[0085] Input format: Question: Background: Output format: Reason##Answer Through this prompt word construction process, a clear and specific task is provided for the Telechat model. The Telechat model needs to use its understanding and generation capabilities to give a logical and accurate answer based on the provided knowledge background and prompt words.

[0086] In a specific embodiment, the prompt words can be adjusted and optimized according to the nature and field characteristics of the specific question. For example, for questions involving complex mathematical derivations or professional terminology explanations, more detailed mathematical formulas or term definitions are provided in the Background section; for questions that require a comprehensive answer of multiple knowledge points, the relevant knowledge points are organized and summarized in an orderly manner so that the large model can be better understood and used.

[0087] By constructing Prompt words, an efficient and reliable input environment is provided for the Telechat large model, thus ensuring that it can output high-quality, accurate and specific answers. This process plays a vital role in improving the performance of the entire system and user experience.

[0088] according to Figures 1 to 4 As shown, a system of a processing method based on a Telechat large model of the present invention includes: Data preprocessing module: collect text knowledge and perform preprocessing; Knowledge base construction module: construct a knowledge base based on the preprocessed text knowledge, decompose the text knowledge of the knowledge base, use text vectorization tools to convert the text knowledge into numerical vectors and store them; Constructing the search engine and fusion result module: constructing an integrated search engine, searching the knowledge base and fusing and ranking the search results; Output module: Based on the fusion-sorted search results, construct prompt words and drive the Telechat large model to output results.

[0089] The above schematically describes the invention and its implementation methods, which is not restrictive. Without departing from the spirit or basic features of the invention, the invention can be implemented in other specific forms. What is shown in the accompanying drawings is only one of the implementation methods of the invention. The actual structure is not limited to this, and any figure mark in the claims should not limit the claims involved. Therefore, if a person of ordinary skill in the art is inspired by it, without departing from the purpose of the invention, a structural method and an embodiment similar to the technical solution are designed without creativity, which should all fall within the scope of protection of this patent. In addition, the word "including" does not exclude other elements or steps, and the word "one" before the element does not exclude the inclusion of "multiple" elements. The multiple elements stated in the product claim can also be implemented by one element through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.

Claims

1. A processing method based on the Telechat large model, characterized in that: The following steps are involved: Collect text knowledge and perform preprocessing; Build a knowledge base based on the preprocessed text knowledge, decompose the text knowledge in the knowledge base, and use text vectorization tools to convert the text knowledge into numerical vectors and store them; Build an integrated search engine to search the knowledge base and rank the search results; The specific process of fusing and sorting the search results is as follows: after obtaining the search results, the search results are fused and sorted using a reciprocal sorting fusion algorithm; Reciprocal sorting fusion algorithm The expression is: ; represents the result of the reciprocal sorting fusion algorithm, represents the vectorized local knowledge base, Represents a collection of search results. Represents the query text The ranking position in the search results, represents a constant, The value of is 60; Based on the fusion and sorted search results, prompt words are constructed to drive the Telechat large model to output results.

2. The processing method based on the Telechat large model according to claim 1 is characterized in that: The specific process of preprocessing is: collecting text knowledge in various fields; The corpus is deduplicated using a combination of a text segment level and a vocabulary level deduplication strategy. Use word segmentation tools to perform content correction based on dictionary matching.

3. The processing method based on the Telechat large model according to claim 2 is characterized in that: The specific process of corpus deduplication is as follows: at the text segment level, the cosine similarity and Jaccard similarity are used to calculate the similarity between text paragraphs; The similarity of words in the text is calculated at the word level.

4. The processing method based on the Telechat large model according to claim 2 is characterized in that: The content correction process is as follows: construct a dictionary containing incorrect words and their corresponding correct words, and the dictionary content is updated as the knowledge base is updated; Use the word segmentation tool to segment the text to be tested, traverse the word segmentation results and search the words to be corrected in the dictionary, and match the word segmentation results with the words to be corrected in the dictionary; Replace the matching words with the correct words from the dictionary.

5. The processing method based on the Telechat large model according to claim 1 is characterized in that: The quality of the output results is evaluated by precision and recall. The higher the match between the generated text and the reference answer text, the higher the precision of the output result. The higher the recall, the higher the probability that the output result contains the reference answer text.

6. The processing method based on the Telechat large model according to claim 5 is characterized in that: The F1 score is used to evaluate the quality of the output results to obtain the retriever weight. The F1 score is calculated based on the harmonic mean of precision and recall. The expression of the F1 score is as follows: F1-Score=2× ; F1-Score represents the evaluation result of the F1 score, Precision represents the accuracy, and Recall represents the recall rate.

7. The processing method based on the Telechat large model according to claim 6 is characterized in that: The integrated retriever includes Bert, BM25 and KNN; during the fusion process, the weight of Bert is 0.5; the weight of BM25 is 0.3; and the weight of KNN is 0.

2.

8. The processing method based on the Telechat large model according to claim 1 is characterized in that: The specific process of text vectorization is: use the Bert model to vectorize text, use Faiss as the vector database, and convert text data into numerical vectors.

9. The processing method based on the Telechat large model according to claim 1 is characterized in that: The specific process of outputting results is as follows: combining the question with the result of the integrated retriever to form the knowledge background of the question and construct prompt words; inputting the prompt words into the Telechat big model, and the Telechat big model outputs the results based on the knowledge background and prompt words.

10. A system based on the processing method based on the Telechat large model according to any one of claims 1 to 9, characterized in that: Includes data preprocessing module: collects text knowledge and performs preprocessing; Knowledge base construction module: construct a knowledge base based on preprocessed text knowledge, decompose the text knowledge of the knowledge base, and use text vectorization tools to convert text knowledge into numerical vectors and store them; Constructing the search engine and fusion result module: constructing an integrated search engine to search the knowledge base and fusion-rank the search results; Output module: Based on the fusion-sorted search results, construct prompt words to drive the Telechat large model to output results.

Citation Information

Patent Citations

  • Local data-based multi-strategy domain knowledge accurate question and answer method

    CN117669583A

  • Intelligent interaction method and system for equipment fault knowledge

    CN117933249A

  • RAG knowledge question-answering method and device based on fusion vector and keyword retrieval

    CN117951274A

  • Streaming question and answer illustration method and system

    CN118035416A

  • System and method for providing question and answers with deferred type evaluation

    US20090292687A1

Cited By

  • Large model retrieval enhancement generation method oriented to policies in electricity price field

    CN119940512A

  • Enterprise knowledge retrieval method, system and equipment based on large language model and medium

    CN120162426A

  • Knowledge base construction method and device and knowledge question and answer retrieval method and device

    CN120598066A

  • Intelligent question and answer method, device and equipment for knowledge in power production field and medium

    CN120653727A

  • Content recommendation method and device, equipment and medium

    CN121765140A