Question and answer method, system, apparatus, and media
By constructing a tree-like logical connection structure to integrate multiple versions of the knowledge base and combining it with a large language model, the problem of low accuracy and resolution rate of question-answering models is solved, achieving higher accuracy and user satisfaction in intelligent question answering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNITED NETWORK COMM GRP CO LTD
- Filing Date
- 2024-03-20
- Publication Date
- 2026-06-19
AI Technical Summary
Existing question-answering models have low accuracy and resolution rates in intelligent question answering, especially when dealing with complex questions, resulting in poor user satisfaction.
By acquiring the tree-like logical relationship structure of multiple versions of a knowledge base in a certain domain, and utilizing the parent-child relationships in the tree structure to obtain reference question-and-answer content, and combining it with a large language model, multiple versions of the knowledge base are integrated to improve the accuracy and resolution rate of answers.
It improved the accuracy and resolution rate of intelligent question answering, and enhanced the coherence, consistency, adaptability, and user satisfaction of the question and answer content.
Smart Images

Figure CN118093828B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates at least to the field of artificial intelligence technology, and in particular to a question-answering method, question-answering system, computer device, and computer-readable storage medium. Background Technology
[0002] While current question-answering models have been studied for intelligent question-answering based on question-answer pairs, in practical applications, there are still problems with low accuracy and resolution rates of intelligent question answering. This may lead to reduced user satisfaction with the system, especially when dealing with complex problems.
[0003] Combining large language models with professional knowledge bases can help improve the accuracy and resolution rate of intelligent question answering. However, how to combine the two to achieve satisfactory results for users remains a problem that needs to be solved in this field. Summary of the Invention
[0004] The technical problem to be solved by this disclosure is to address the above-mentioned shortcomings by providing a question-answering method, question-answering system, computer device, and computer-readable storage medium, in order to solve the problem of how to combine a knowledge base to improve the accuracy of intelligent question answering based on a large language model.
[0005] Firstly, this disclosure provides a question-and-answer method, the method comprising:
[0006] Obtain the tree-like logical relationship structure of multiple versions of a knowledge base in a certain domain. The nodes of the tree-like logical relationship structure represent knowledge points in multiple versions of the knowledge base. The logical relationship between knowledge points in different versions of the knowledge base is represented by the parent-child relationship between nodes.
[0007] Based on the user's question to be answered and the tree-like logical relationship structure, obtain reference question and answer content. The reference question and answer content includes multiple knowledge points represented by nodes with parent-child relationships in the tree-like logical relationship structure.
[0008] Based on the reference question and answer content and the large language model, obtain the answers to the user's questions to be answered.
[0009] Secondly, this disclosure provides a question-and-answer system, the system comprising:
[0010] The association module is used to obtain the tree-like logical association structure of multiple versions of the knowledge base in a certain domain. The nodes of the tree-like logical association structure represent knowledge points in multiple versions of the knowledge base. The logical association between knowledge points in different versions of the knowledge base is represented by the parent-child relationship between nodes.
[0011] The reference module, connected to the association module, is used to obtain reference question and answer content based on the user question to be answered and the tree-like logical association structure. The reference question and answer content includes multiple knowledge points represented by nodes with parent-child relationships in the tree-like logical association structure.
[0012] The large model module, connected to the reference module, is used to obtain answers to user questions based on reference question-and-answer content and the large language model.
[0013] Thirdly, this disclosure provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the question-and-answer method as described above.
[0014] Fourthly, this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the question-and-answer method described above.
[0015] This disclosure provides a question-answering method, question-answering system, computer device, and computer-readable storage medium. It obtains a tree-like logical relationship structure of multiple versions of a knowledge base in a specific domain, utilizes the parent-child relationships within the tree structure to obtain reference question-answer content for a user's question to be answered, and associates logically related knowledge points from multiple versions of the knowledge base. Based on the reference question-answer content and a large language model, the answer to the user's question is obtained. This integrates the logical relationships of multiple versions of the knowledge base in a specific domain, and by combining the logically related multiple knowledge bases with the large language model, improves the accuracy and resolution rate of answers to user questions. Attached Figure Description
[0016] Figure 1 This is a flowchart of a question-and-answer method according to an embodiment of this disclosure;
[0017] Figure 2 This is a flowchart of another question-and-answer method according to an embodiment of this disclosure;
[0018] Figure 3 This is a flowchart of a vectorized representation of a knowledge base for another question-answering method according to an embodiment of this disclosure;
[0019] Figure 4 This is a schematic diagram of the structure of a question-and-answer system according to an embodiment of the present disclosure;
[0020] Figure 5 This is a schematic diagram of the structure of a computer device according to an embodiment of the present disclosure. Detailed Implementation
[0021] To enable those skilled in the art to better understand the technical solutions of this disclosure, the embodiments of this disclosure will be further described in detail below with reference to the accompanying drawings.
[0022] It is understood that the specific embodiments and accompanying drawings described herein are for illustrative purposes only and are not intended to limit the scope of this disclosure.
[0023] It is understood that, without conflict, the various embodiments and features in the embodiments of this disclosure can be combined with each other.
[0024] It is understood that, for ease of description, only the parts relevant to this disclosure are shown in the accompanying drawings, while parts unrelated to this disclosure are not shown in the drawings.
[0025] It is understood that each unit or module involved in the embodiments of this disclosure may correspond to only one entity structure, or may be composed of multiple entity structures, or multiple units or modules may be integrated into one entity structure.
[0026] It is understood that, without conflict, the functions and steps marked in the flowcharts and block diagrams of this disclosure may occur in a different order than that marked in the accompanying drawings.
[0027] It is understood that the flowcharts and block diagrams of this disclosure illustrate the architecture, functions, and operations of possible implementations of systems, apparatuses, devices, and methods according to various embodiments of this disclosure. Each block in a flowchart or block diagram may represent a unit, module, program segment, or code, containing executable instructions for implementing the specified function. Furthermore, each block or combination of blocks in the block diagrams and flowcharts may be implemented using a hardware-based system to implement the specified function, or using a combination of hardware and computer instructions.
[0028] It is understood that the units and modules involved in the embodiments of this disclosure can be implemented by software or by hardware, for example, the units and modules can be located in a processor.
[0029] To facilitate understanding of this disclosure, the main inventive ideas of this disclosure will first be introduced in conjunction with a specific scenario.
[0030] This disclosure addresses the issues of low accuracy and resolution rate, and poor user satisfaction in question-answering based on question-answer pairs. It studies the construction of a knowledge graph ontology model, integrates a question-answering knowledge graph with multi-level data, and constructs a knowledge graph-based intelligent question answering system to solve the problems faced by question-answering based intelligent question answering.
[0031] Existing knowledge graph construction methods propose a comprehensive approach utilizing both textual and tabular data. This involves designing an unsupervised named entity relation extraction method based on dependency parsing for textual data and a data flow composition model for extracting knowledge from tables. Furthermore, the knowledge graph is visualized using the Neo4j graph database, providing insights and references for constructing knowledge graphs across various disciplines. However, both the unsupervised named entity relation extraction method based on dependency parsing and the data flow composition model still face challenges in integrating different data sources, leading to incompleteness and inaccuracies in the knowledge graph.
[0032] This disclosure proposes a large-scale question-answering method that integrates a knowledge base in the communications field. The proposed method utilizes sampling and vector representation techniques to effectively improve the intelligence level of the knowledge base's question-answering content, thereby improving the accuracy and resolution rate of intelligent question answering. Furthermore, through vector representation and logical association analysis of multi-level data, it effectively integrates communications field knowledge from different sources, overcoming the challenge of integrating heterogeneous data sources. Simultaneously, it deeply analyzes the logical associations, incremental update relationships, and evolutionary patterns of knowledge base versions, providing a more effective method for knowledge base update analysis and supporting the continuous evolution of the knowledge base.
[0033] Example 1:
[0034] like Figure 1 As shown, this disclosure provides a question-and-answer method, the method comprising:
[0035] S1. Obtain the tree-like logical relationship structure of multiple versions of the knowledge base in a certain domain. The nodes of the tree-like logical relationship structure represent knowledge points in multiple versions of the knowledge base. The logical relationship between knowledge points in different versions of the knowledge base is represented by the parent-child relationship between nodes.
[0036] S2. Based on the user's question to be answered and the tree-like logical relationship structure, obtain the reference question and answer content. The reference question and answer content includes multiple knowledge points represented by nodes with parent-child relationships in the tree-like logical relationship structure.
[0037] S3. Based on the reference question and answer content and the large language model, obtain the answers to the user's questions to be answered.
[0038] In this embodiment, by obtaining the tree-like logical relationship structure of multiple versions of a knowledge base in a certain domain, and using the parent-child relationship in the tree structure to obtain reference question-and-answer content for the user's question to be answered, the reference question-and-answer content is associated with logically related knowledge points in multiple versions of the knowledge base. Based on the reference question-and-answer content and the large language model, the answer to the user's question to be answered is obtained, thereby integrating the logical relationships of multiple versions of the knowledge base in a certain domain. By combining the logically related multiple knowledge bases with the large language model, the accuracy and resolution rate of the answers to the user's question are improved.
[0039] More specifically, taking intelligent question-answering technology in the field of communications as an example, firstly, multiple versions of knowledge bases in the communications field are collected. These knowledge bases may have different sources. One representative version can be selected as the main body of the tree-like logical association structure. Knowledge points in other versions that differ from the representative version are used as child nodes of the tree-like logical association structure. A parent-child relationship is established between the child nodes and the root node of the main body. When a user question to be answered is received, some nodes of the tree-like logical association structure are obtained based on pre-set rules as the answer content associated with the user question. The parent / child nodes of these nodes are also used as the associated answer content. The reference question-answer content obtained in this way can prompt the large language model to pay attention to the updating and evolution relationship of knowledge in this field, thereby improving the accuracy and resolution rate of intelligent question answering by the large language model.
[0040] In one implementation, S1, obtain the tree-like logical relationship structure of multiple versions of a knowledge base in a certain domain. The nodes of the tree-like logical relationship structure represent knowledge points in multiple versions of the knowledge base. The logical relationship between knowledge points in different versions of the knowledge base is represented by the parent-child relationship between nodes, specifically including:
[0041] To acquire multiple versions of a knowledge base corresponding to different development stages of a certain field;
[0042] The content in the knowledge base for each version is processed to obtain the set of knowledge points for each version;
[0043] The earliest version of the set of knowledge points is taken as the root node, and the knowledge points in the other versions that do not belong to the root node are child nodes.
[0044] Establish connections between root nodes based on textual relationships, and establish connections between root nodes and child nodes based on parent-child relationships, so that the connections between nodes represent the logical relationships between various knowledge points.
[0045] In this embodiment, knowledge bases at different points in time are obtained based on the development history of the communication field. Each knowledge base is preprocessed, including extracting words such as concepts, entities, and attributes from each knowledge base as a set of knowledge points. A tree structure is constructed according to the logical association of the knowledge content of each version. The root node is the set of knowledge concepts (knowledge points) of the early version, and the other nodes are the knowledge points added and updated in the later versions. The sets of knowledge concepts of two adjacent communication field knowledge base versions are compared to establish the parent-child relationship between knowledge points.
[0046] In one embodiment, before establishing the connection between the root node and child nodes based on the parent-child relationship, the method further includes:
[0047] Each version's set of knowledge points is represented as a set vector;
[0048] The answers to historical user questions that meet the requirements are represented as the first answer vector;
[0049] Based on the first answer vector, a set vector is matched to obtain the knowledge points in each version whose first similarity to the first answer vector of the same historical user's question reaches a first preset value;
[0050] Establish parent-child relationships between knowledge points that belong to different versions but whose first similarity reaches the first preset value.
[0051] In this embodiment, for example, regarding a problem with communication networks, some users are using 4G networks and some are using 5G networks. Regarding the answers to this problem, some users are satisfied with the answers based on 4G networks and some users are satisfied with the answers based on 5G networks. The answers that users are satisfied with are expressed as the first answer vector, and matched with the knowledge points of each version, so as to obtain the knowledge points with parent-child relationships in different versions of the knowledge base. These knowledge points are the key information for answering the problem.
[0052] In one embodiment, S2, based on the user question to be answered and the tree-like logical relationship structure, obtain reference question-and-answer content. The reference question-and-answer content includes multiple knowledge points representing logical relationships between nodes with parent-child relationships in the tree-like logical relationship structure, specifically including:
[0053] Retrieve historical question-and-answer pairs, which include historical user questions and answers to historical user questions that meet the requirements;
[0054] The historical user questions of the historical question-and-answer pairs are expressed as the first question vector, and the user questions to be answered are expressed as the second question vector;
[0055] Obtain a first question vector whose similarity to the second question vector reaches a second preset value, and express the historical question answers of the historical question-answer pair corresponding to the first question vector as the first answer vector;
[0056] Match the corresponding first answer vector to each node of the tree-like logical association structure to obtain the first node with a similarity of the third preset value, and obtain the second node that has a parent-child relationship with the first node;
[0057] Obtain the corresponding historical user questions, the knowledge points of the first node, and the knowledge points of the second node as reference Q&A content.
[0058] In this embodiment, for a new question raised by a user, the answer can be provided based on historical question-and-answer pairs collected from the knowledge base. These historical question-and-answer pairs consist of questions previously raised by the user and answers to which the user provided satisfactory feedback. To find similar questions among historical questions for the new question, the m3e-base of the ChatGLM large language model can be used as the encoder for the question and the decoder for the answer. The question is encoded as a vector, and the similarity between the new question vector and the historical question vector is calculated. Similarity can be measured using methods such as cosine similarity. Similar historical questions, answers to similar historical questions, and knowledge points with parent-child relationships in the tree-like logical association structure related to the answer are obtained. These serve as reference question-and-answer content for the ChatGLM large model to answer the new question. Therefore, when the ChatGLM large model answers the new question, it optimizes the coherence and consistency of the question-and-answer content based on the logical association information of the knowledge base version, improving the accuracy and resolution rate of intelligent question answering.
[0059] In one implementation, S3, based on the reference question-and-answer content and the large language model, obtains the answer to the user's question to be answered, specifically including:
[0060] Extract nouns and phrases from the reference Q&A content to form keywords;
[0061] Keywords are used as prompts in a large language model to obtain answers to user questions.
[0062] In this embodiment, component grammar analysis can be performed on the question to extract noun phrases and form a keyword list. These keywords are used as prompts for the ChatGLM big model. With the prompts, the big model answers the user's question, thereby obtaining answers that better meet the user's needs. For example, for communication network questions, answers for 4G and 5G networks can be provided separately for the user to choose from.
[0063] In one embodiment, after obtaining the answer to the user's question based on the reference question-and-answer content and the large language model, the method further includes:
[0064] In response to user feedback that the answer to the user's question meets the requirements, a new question-and-answer pair is formed by combining the user's question and the corresponding answer.
[0065] The large language model is trained and tuned using the new question-answering pairs until the performance of the tuned large language model meets the preset conditions.
[0066] In this embodiment, based on the needs of the communication field, during the process of intelligent question answering with users, the question answering content of the communication field knowledge base and ChatGLM can be continuously adjusted. Based on user feedback, satisfactory answers and corresponding questions can be combined into question answer pairs and stored in the knowledge base. The large language model can be trained and optimized based on the continuously enriched question answer pairs in the knowledge base, thereby continuously improving the accuracy and adaptability of the large language model in answering user questions.
[0067] In one implementation, the large language model is trained and optimized using new question-answer pairs until the performance of the optimized large language model meets preset conditions, specifically including:
[0068] The new question-answer pairs and existing historical question-answer pairs are vectorized and divided into training datasets and test datasets;
[0069] The training dataset is input into the underlying model of the large language model for iterative training, and the test dataset is used for evaluation in each iteration.
[0070] Once the evaluation results reach the preset evaluation metrics, the output includes a large language model that includes the underlying model obtained from the final iteration training.
[0071] In this embodiment, question data related to the communication domain is acquired with the user's authorization and consent. Preprocessing is performed based on the question data and different versions of the communication domain knowledge base. The preprocessed data is divided into training and testing datasets. A convolutional neural network algorithm (the underlying model of a large language model) is used to iteratively train the neural network model based on the training dataset. The neural network model is then evaluated using the testing dataset. Model tuning is performed based on the evaluation results. The output of the trained neural network model is input into ChatGLM to obtain ChatGLM based on the communication domain question data and knowledge base versions.
[0072] A more specific example is as follows Figure 2 As shown, this is a large-scale question-answering method that combines a knowledge base in the communications field, including the following steps:
[0073] Step 1: Based on version information of the communication domain knowledge base from several periods, sample the versions to obtain representative versions; specifically:
[0074] Based on the development history of the communications field, knowledge base version information at different points in time is extracted from the database, covering technical standards, communication protocols, data transmission rates, etc. The extracted knowledge base information is analyzed, and the release time span and similarity between adjacent versions are calculated. Multiple knowledge base versions with large release time spans and low similarity are retained. Based on technological development trends and market demands, sampling strategies are formulated for different versions of the knowledge base, sampling changes in various key attributes, including the evolution of technical standards and optimization of communication protocols. The sampled data is used to identify the development trends of key attributes such as data transmission rate and latency in relation to technical standards, which can guide future sampling strategies, making them more focused on the key performance indicators of emerging technologies.
[0075] Step two involves processing the sampled version data of several communication domain knowledge bases to obtain vector representations of the corresponding version content; specifically:
[0076] like Figure 3 As shown, several versions of knowledge base data in the communication domain are read from the sampled data, the data is preprocessed, and the preprocessed data is input into the m3e-base model (Chinese text embedding model) for training. The vector representations of concepts, entities and attribute words in the communication domain knowledge base are obtained from the m3e-base model, and the vector representations are stored as vec files. Several versions of vec files are read, and the average aggregation method is used to aggregate the vectors by version to obtain the overall vector representation of the text of the corresponding version. The vector representations of each version are normalized.
[0077] For example, a knowledge base in the communications domain has two versions of data, version 1 and version 2. These versions of data are preprocessed, and then the preprocessed data is input into the m3e-base model for training using the gradient descent algorithm. Version 1 contains 100 concepts, 200 entities, and 50 attribute words, while version 2 contains 120 concepts, 180 entities, and 60 attribute words. After training with the TransE model, vector representations for each concept, entity, and attribute word can be obtained. Then, the vector representations for each version are stored as vec files, versionvec1 and versionvec2, respectively. Next, these vectors need to be aggregated to obtain... The overall vector representation of the corresponding text versions is calculated using the average aggregation method. For version 1, the concept vectors are 100-dimensional, the entity vectors are 200-dimensional, and the attribute word vectors are 50-dimensional. By summing the vectors of various dimensions, the overall vector representation of version 1 is calculated to be a 350-dimensional vector. Similarly, for version 2, the overall vector representation is calculated to be a 360-dimensional vector. Next, the vector representations of each version are normalized to ensure they have the same scale. For the overall vector representation of version 1, its L2 norm is ||v||2 = v1. 2 +v2 2 +...+v350 2 The L2 norm can be used to normalize the overall vector of version 1. The normalization formula is as follows:
[0078] Step 3: Vectorize the user's query and retrieve and match vector data from the communication domain knowledge base; specifically:
[0079] The system acquires user queries and preprocesses them, including text cleaning, removal of irrelevant characters, and word segmentation. It then uses m3e-base to convert the user queries into vector form, transforming natural language queries into machine-understandable mathematical expressions. Vectorized data from a knowledge base in the communications domain is acquired, including vector representations of concepts, entities, and attribute words. Cosine similarity is used to compare the user query vector with vectors in the knowledge base, selecting the knowledge base item most similar to the query vector as the match. Based on knowledge base vectors with a matching degree higher than a preset similarity, relevant knowledge content is retrieved and presented to the customer in a question-and-answer format. A user feedback mechanism is provided to evaluate the relevance and accuracy of the search results, and the query processing and matching algorithms are optimized based on user feedback and usage data.
[0080] For example, the system retrieves the user's query, "How do I make a long-distance call?", and preprocesses it, including text cleaning, removing irrelevant characters, and word segmentation. The preprocessed query, "Make a long-distance call," is then converted into a vector form using m3e-base, transforming the natural language query into a machine-understandable mathematical expression. The vector representation is [2,5,8]. Vectorized data from a communications domain knowledge base is then retrieved, including vector representations of concepts, entities, and attribute words. One concept in the knowledge base has a vector representation of [4,3,6]. Cosine similarity is then used to compare the user's query vectors. The system compares the query vector with the data in the knowledge base, selecting the knowledge base item most similar to the query vector as the matching item; it calculates a cosine similarity of 7, and retrieves corresponding knowledge content based on knowledge base vectors with a matching degree higher than a preset similarity (e.g., 6), presenting the content to the customer in a question-and-answer format; the returned answer is: "The way you can make a long-distance call is to first dial the area code, and then dial the phone number." A user feedback mechanism is provided to evaluate the relevance and accuracy of the search results. Based on user feedback and usage data, the query processing and matching algorithm are optimized. If the user feedback result is "the answer is accurate and highly relevant," the algorithm is further optimized based on the feedback.
[0081] Step four: Based on the technical motivation and extent of version knowledge updates in the communications domain knowledge base, analyze the logical connections, incremental update relationships, and evolutionary patterns of the version knowledge content; specifically:
[0082] Based on the technical motivation and extent of knowledge updates in the communication domain knowledge base, this study compares the content of two versions of the knowledge base to determine the differences between them, identifies new concepts added in the new version, compares and analyzes these new concepts with those in the old version, and identifies the relationships between the concepts. Based on the results of the relationship analysis, new logical connections are extracted, and reasoning is applied to these new logical connections to analyze their impact on the knowledge system. The study compares the knowledge concept sets of two adjacent communication domain knowledge base versions to establish parent-child relationships between knowledge points. A tree structure is constructed according to the new logical connections of the version's knowledge content, with the root node representing the knowledge concept set of the earlier version and other nodes representing new and updated knowledge points in subsequent versions. Through the knowledge point identifiers on the parent and child nodes, the incremental update relationship between version content is analyzed. Based on the tree structure, the evolutionary pattern of version knowledge is analyzed, and the evolution of knowledge is inferred.
[0083] For example, consider two versions of a knowledge base in the communications field, V1 and V2. First, compare the content of these two versions to identify their differences. The comparison reveals that version V2 introduces a new concept called "5G network," which was not present in version V1. Further analysis can be conducted to determine the relationship between this new concept and other concepts in version V1. This analysis shows a close connection between "5G network" and concepts such as "mobile communication" and "wireless network" in version V1, indicating that "5G network" is a new concept developed based on mobile communication and wireless networks. Next, based on the results of the concept correlation analysis, the newly added logical connection can be extracted. This leads to the conclusion that 5G network is a next-generation mobile communication technology with higher transmission speeds and lower latency compared to 4G network. For this newly added logical connection, reasoning can be performed to analyze these logical relationships. The impact of logical associations on the knowledge system: The emergence of 5G networks will promote the development of mobile communication technology, providing faster and more stable network connections and supporting more application scenarios and services. Next, the knowledge concept sets of two adjacent communication domain knowledge base versions are compared, and parent-child relationships between knowledge points are established. A tree structure is constructed based on the newly added logical associations, where the root node is the knowledge concept set of version V1, and the other nodes are the knowledge points added and updated in version V2. Through the knowledge point identifiers on the parent and child nodes, the incremental update relationship between version content can be analyzed. The "5G network" node evolved from the "mobile communication" node and is an incremental update of version V1 from version V2. Based on the tree structure, the evolution law of version knowledge can be further analyzed, and the evolution of knowledge can be inferred. It can be found that the knowledge in the communication field is constantly developing, new concepts are constantly emerging, and there are close relationships between them and existing concepts.
[0084] Step 5: Based on the question data and knowledge base version content related to the field of communications, input the data into ChatGLM for training; specifically:
[0085] Acquire communication-related question data with user authorization and consent. Preprocess the data based on different versions of the communication domain knowledge base, dividing it into training and testing datasets. Utilize a convolutional neural network algorithm for iterative training on the training dataset to build a neural network model. Evaluate the model using the testing dataset and fine-tune it based on the evaluation results. Input the output of the trained neural network model into ChatGLM for further training, resulting in a ChatGLM based on communication domain question data and knowledge base versions. Finally, test and validate the ChatGLM.
[0086] For example, with user authorization and consent, 1000 questions related to the field of communication were collected. Based on different versions of the communication domain knowledge base, these questions were preprocessed, including removing stop words, punctuation marks, and numbers, and performing word segmentation. Then, the preprocessed data was divided into 800 questions as the training dataset and 200 questions as the test dataset. Next, a convolutional neural network (CNN) algorithm was used to build a neural network model. The model has two convolutional layers and one fully connected layer. Each convolutional layer contains 64 convolutional kernels, and the fully connected layer has 128 neurons. ReLU was used as the activation function, and the Adam optimizer was used for iterative training. The training dataset was input into the neural network model for training, with 10 iterations. After each iteration, the results were analyzed using... The neural network model was evaluated on the test dataset. After 10 iterations, the model achieved an accuracy of 85% on the test dataset. The evaluation revealed that the model performed poorly on certain problems, such as longer problems or those with complex grammatical structures. To improve the model, its complexity could be increased, such as by adding more convolutional kernels or hidden layers. After tuning, the model's accuracy on the test dataset improved to 90% after 15 iterations. Finally, the output of the trained neural network model was input into ChatGLM to obtain ChatGLM based on communication domain problem data and knowledge base version content. The performance and accuracy of ChatGLM were evaluated through multiple sets of tests and validations, and adjustments and optimizations were made based on feedback.
[0087] Step six: Based on the logical connections, incremental update relationships, and evolutionary patterns of the knowledge base versions in different communication fields, obtain the question-and-answer content of the knowledge base; specifically:
[0088] Feature extraction is performed based on the logical relationships, incremental update relationships, and evolutionary patterns of knowledge base versions across different communication domains to obtain feature representations of questions and knowledge base versions. The feature representations of questions are then matched with those of knowledge base versions to obtain the knowledge base question-and-answer content. Based on the logical relationships between the knowledge base versions, the coherence and consistency of the knowledge base question-and-answer content are optimized. According to the incremental update relationships between the knowledge base versions, the knowledge base question-and-answer content is compared and matched with previous versions to determine the updated parts of the knowledge base. Finally, based on the evolutionary patterns of the knowledge base versions, the answers to the knowledge base question-and-answer content are updated to obtain the processed communication domain knowledge base question-and-answer content.
[0089] For example, there's a knowledge base version in the field of communications that includes the following questions and their corresponding answers: Question 1, How to establish a wireless network connection? Answer 1, First, ensure your device supports wireless networks; then, turn on your device's wireless function and search for available networks; select the network you want to connect to and enter the password; after a successful connection, you can start using the wireless network. Question 2, How to solve the problem of slow wireless network connection speed? Answer 2, First, ensure your device is not too far from the wireless router and try to avoid obstacles blocking the signal; second, you can try placing the wireless router in a higher position to improve signal strength; additionally, ensure that there are no other tasks on your device that are consuming network bandwidth, such as downloading large files or watching high-definition videos. Now, we can extract features from these questions and answers for matching and updating. The features for question 1 could be ["Establish", "Wireless network connection"]; the features for answer 1 could be ["Device", "Wireless function", "Search for networks", "Select network", "Enter password", "Connection successful"]; the features for question 2 could be ["Resolved", "Slow wireless network connection speed"]; the features for answer 2 could be ["Device distance from router", "Avoid obstacles", "Place router in a high position", "Avoid network bandwidth consumption"]; now, a new question arises: how to resolve the problem of wireless network connection interruption? The feature representation of this question can be set as ["Solved", "Wireless network connection interrupted"]. Then, the feature representation of this question can be matched with questions in the knowledge base. If there are questions with high similarity, the corresponding answer can be selected. Based on the logical association information of the knowledge base versions, the coherence and consistency of the knowledge base Q&A content can also be optimized. If Question 1 and Question 2 are related, a method to solve the slow network speed can be mentioned when answering Question 1. Based on the incremental update relationship of the knowledge base versions, the knowledge base Q&A content can be compared and matched with the content of previous versions to determine the updated part of the knowledge base. If there is a new question 3, "How to set up wireless network password protection?", a question that was not in the previous version of the knowledge base can be found and its feature representation added to the knowledge base. Based on the evolution law of the knowledge base versions, the answers to the knowledge base Q&A content can be updated. If new technologies emerge, the relevant information in the answers can be updated.
[0090] Step 7: Based on the questions raised by users, integrate the Q&A content from the communications knowledge base with ChatGLM; specifically:
[0091] ChatGLM is used to model and learn representations of question-and-answer content in a knowledge base in the communications domain. Through fine-tuning, questions and answers are mapped to vector representations in the semantic space. ChatGLM is combined with the question-and-answer content of the knowledge base in the communications domain, and m3e-base is used as the encoder for questions and the decoder for answers. The encoder encodes the questions posed by users to obtain the vector representation of the questions. The ChatGLM model is used to perform constituent grammar analysis on the questions, extract noun phrases to form a keyword list, and then vectorize them to build an index for text segments. The question-and-answer content of the knowledge base is matched with the question vector to obtain the answer vector. The decoder decodes the answer vector into text form and returns the answer to the user.
[0092] For example, consider a knowledge base in the field of communications containing the following question and answer pairs: Question 1: How to configure a wireless router? Answer 1: To configure a wireless router, first connect the router to a power source, then connect your computer to the router's LAN port. Next, enter the router's IP address in your browser to log in to the router's management interface. In the management interface, you can perform various configurations, including setting the wireless network name, setting the password, and configuring other network options. Question 2: How to solve the problem of a mobile phone not being able to connect to Wi-Fi? Answer 2: If a mobile phone cannot connect to Wi-Fi, there are several possible solutions. First, ensure that the phone's Wi-Fi function is enabled and connected to the correct Wi-Fi network. If it still cannot connect, try restarting the phone and the Wi-Fi router. Also, ensure that the Wi-Fi password is entered correctly and that the router's signal strength is strong enough. If the problem persists, try forgetting the network and reconnecting. Now, we use ChatGLM to model and represent these questions and answers, using the m3e-base model as the encoder for the questions and the decoder for the answers, and using the ChatGLM model to perform constituent syntax analysis on the questions, encoding Question 1: How to configure a wireless router? The question vector is encoded into a 512-bit question using the m3e-base model. The question is then parsed using the ChatGLM model to obtain a list of noun phrases: wireless router, configuration. These noun phrases are vectorized, and a text fragment index is created. Next, the knowledge base question-and-answer content is matched with the question vector. The knowledge base contains an answer vector that matches question 1. The decoder decodes the answer vector into text form and returns it to the user. Since the answer vector corresponds to answer 1, the following message is returned: To configure the wireless router, first connect the router to a power source, then connect the computer to the router's LAN port.
[0093] Step 8: Adjust the question-and-answer content of the communication domain knowledge base and ChatGLM according to the needs of the communication domain; specifically:
[0094] This process involves acquiring question-and-answer content from a knowledge base in the communications domain, determining adjustment tasks based on the needs of the communications domain, and adjusting the question-and-answer content of the knowledge base. The adjusted knowledge base question-and-answer content is then used as training data and input into ChatGLM. Through prompting engineering, ChatGLM summarizes text segments and automatically generates question-and-answer pairs, improving its ability to answer questions about detailed knowledge points. Based on evaluation metrics in the communications domain, the performance of the fine-tuned ChatGLM on the test set is evaluated, and optimization is performed based on the evaluation results. Performance is further improved by adjusting the input knowledge base question-and-answer content and increasing the number of input rounds.
[0095] For example, consider a knowledge base of questions and answers in the communications domain, containing questions and corresponding answers. The knowledge base's question-and-answer content is adjusted by modifying the tasks, and the adjusted data is used to train ChatGLM. First, the modification tasks are determined based on the needs of the communications domain. Currently, the requirement is for the system to answer questions about communication protocols and network security. Therefore, irrelevant questions and answers are filtered out, retaining only relevant content. Next, the adjusted knowledge base's question-and-answer content is input into ChatGLM. Through prompting engineering, ChatGLM summarizes based on text segments, automatically generating question-and-answer pairs, improving its ability to answer questions about detailed knowledge points in the communications domain. Finally, the adjusted model is evaluated using a test set. Evaluation metrics can include accuracy, recall, F1 score, etc. The model was run and the following results were obtained: out of 100 questions, the model answered 80 questions correctly, answered 15 questions incorrectly, and failed to answer 5 questions. Therefore, the precision was 80%, the recall was 80%, and the F1 score was 8. Based on the evaluation results, the model was fine-tuned by adjusting the input question-and-answer content data from the communication domain knowledge base and increasing the input rounds. The batch size was increased from 32 to 64. The model was readjusted and evaluated again, resulting in new results: 85 questions were answered correctly, 10 questions were answered incorrectly, and 5 questions failed to answer. The precision improved to 85%, the recall improved to 85%, and the F1 score improved to 85. Performance was improved by adjusting the input question-and-answer content data from the communication domain knowledge base and increasing the input rounds to meet the requirements of the communication domain.
[0096] The above examples demonstrate how acquiring historical version data of a knowledge base in the communications domain and selecting representative versions, including a comprehensive evaluation of time span and similarity, makes the sampled versions more representative. By using the m3e-base model, the content of the knowledge base versions is transformed into vector representations, and trained using gradient descent to obtain vector representations of concepts, entities, and attribute words. The average aggregation method is used for version vector aggregation, which helps to better capture the multi-level features of the knowledge base content. Based on question data and knowledge base version content related to the communications domain, ChatGLM is input for training, fusing questions and knowledge base version content to form an intelligent question-answering system, providing an effective means to achieve intelligent question answering. By identifying newly added concepts, establishing logical connections, and analyzing incremental update relationships, the evolutionary patterns of content between versions of the communications domain knowledge base are revealed. This analytical process is used to protect methods for understanding and inferring knowledge base version updates. By integrating the question-answering content of the communications domain knowledge base with the ChatGLM large model, a flexible approach is provided to meet different needs. Specific adjustments for the communications domain, including model tuning based on tasks and evaluation metrics, provide adjustability for practical applications.
[0097] Example 2:
[0098] like Figure 4 As shown, this disclosure provides a question-and-answer system, the system comprising:
[0099] Module 1 is used to obtain the tree-like logical association structure of multiple versions of the knowledge base in a certain domain. The nodes of the tree-like logical association structure represent knowledge points in multiple versions of the knowledge base. The logical association between knowledge points in different versions of the knowledge base is represented by the parent-child relationship between nodes.
[0100] Reference module 2, connected to association module 1, is used to obtain reference question and answer content based on the user question to be answered and the tree-shaped logical association structure. The reference question and answer content includes multiple knowledge points represented by logical associations of nodes with parent-child relationships in the tree-shaped logical association structure.
[0101] Large model module 3, connected to reference module 2, is used to obtain the answer to the user's question based on the reference question-and-answer content and the large language model.
[0102] In one embodiment, the associated module 1 specifically includes:
[0103] The collection unit is used to acquire multiple versions of the knowledge base corresponding to different development stages of a certain field;
[0104] The preprocessing unit, connected to the collection unit, is used to process the content in the knowledge base for each version to obtain the knowledge point set for each version;
[0105] The node unit, connected to the preprocessing unit, is used to take the earliest version of the set of knowledge points as the root node, and the knowledge points in the other versions that do not belong to the root node as child nodes.
[0106] The node connection unit, connected to the nodeization unit, is used to establish connections between root nodes based on textual representation relationships, and to establish connections between root nodes and child nodes based on parent-child relationships, so that the connections between nodes represent the logical relationships between various knowledge points.
[0107] In one embodiment, the question-answering system further includes:
[0108] Vectorization unit, used to express the knowledge point set of each version as a set vector, and to express the answers to historical questions that meet the requirements as the first answer vector;
[0109] A vector matching unit, connected to a vectorization unit, is used to match a set of vectors based on the first answer vector to obtain knowledge points in each version whose first similarity to the first answer vector of the same historical user question reaches a first preset value.
[0110] The parent-child association unit, connected to the vector matching unit, is used to establish a parent-child relationship between knowledge points that belong to different versions but whose corresponding first similarity reaches a first preset value.
[0111] In one embodiment, reference module 2 specifically includes:
[0112] The history unit is used to retrieve historical question-and-answer pairs, which include historical user questions and answers to historical questions that meet the requirements.
[0113] The vectorization unit, connected to the history unit, is used to express the historical user questions of the historical question-answer pair as the first question vector and the user questions to be answered as the second question vector.
[0114] The vector matching unit, connected to the vectorization unit, is used to obtain the first question vector whose similarity to the second question vector reaches a second preset value;
[0115] The vectorization unit is also used to express the historical question answers of the historical question-answer pair corresponding to the first question vector as the first answer vector;
[0116] The vector matching unit is also used to match the corresponding first answer vector with each node of the tree-like logical association structure in order to obtain the first node whose similarity reaches the third preset value;
[0117] The parent-child relationship query unit, connected to the vector matching unit, is used to obtain the second node that has a parent-child relationship with the first node;
[0118] The content retrieval unit, connected to the parent-child relationship query unit, is used to retrieve the corresponding historical user questions, the knowledge points of the first node, and the knowledge points of the second node as reference question and answer content.
[0119] In one embodiment, the large model module 3 specifically includes:
[0120] The extraction unit is used to extract noun phrases from the reference question and answer content to form keywords;
[0121] The answering unit, connected to the extraction unit, is used to use keywords as prompts in the large language model to obtain answers to user questions.
[0122] In one embodiment, the question-answering system further includes an update module, specifically comprising:
[0123] The question-answer pair update unit is used to form a new question-answer pair by combining the question to be answered and the corresponding answer in response to user feedback that the answer to the user's question meets the requirements.
[0124] The large model update unit, connected to the question-answer pair update unit, is used to train and optimize the large language model using new question-answer pairs until the performance of the optimized large language model meets the preset conditions.
[0125] In one implementation, the large model update unit is specifically used for:
[0126] The new question-answer pairs and existing historical question-answer pairs are vectorized and divided into training datasets and test datasets;
[0127] The training dataset is input into the underlying model of the large language model for iterative training, and the test dataset is used for evaluation in each iteration.
[0128] Once the evaluation results reach the preset evaluation metrics, the output includes a large language model that includes the underlying model obtained from the final iteration training.
[0129] Example 3:
[0130] like Figure 5 As shown, Embodiment 3 of this disclosure provides a computer device, which includes a memory 10 and a processor 20. The memory 10 stores a computer program. When the processor 20 runs the computer program stored in the memory 10, the processor 20 executes the question-and-answer method as described in Embodiment 1. Specifically, the computer device may be the question-and-answer system as described in Embodiment 2.
[0131] The memory 10 is connected to the processor 20. The memory 10 can be a flash memory, a read-only memory, or another type of memory. The processor 20 can be a central processing unit or a microcontroller.
[0132] Example 4:
[0133] Embodiment 4 of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the question-and-answer method as described in Embodiment 1, or the question-and-answer system as described in Embodiment 2.
[0134] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules, or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other memory technologies, CD-ROM (Compact Disc Read-Only Memory), DVD or other optical disc storage, cartridges, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer.
[0135] Embodiments 1-4 of this disclosure provide a question-answering method, a question-answering system, a computer device, and a computer-readable storage medium. By obtaining a tree-like logical association structure of multiple versions of a knowledge base in a certain field, and utilizing the parent-child relationships in the tree structure to obtain reference question-answer content for the user's question to be answered, the reference question-answer content is associated with logically related knowledge points in multiple versions of the knowledge base. Based on the reference question-answer content and a large language model, the answer to the user's question to be answered is obtained. This realizes the integration of the logical associations of multiple versions of the knowledge base in a certain field, and by combining the logically related multiple knowledge bases with the large language model, the accuracy and resolution rate of the answers to user questions are improved.
[0136] It is understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of this disclosure, and this disclosure is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and substance of this disclosure, and these modifications and improvements are also considered to be within the scope of protection of this disclosure.
Claims
1. A question-and-answer method, characterized in that, The method includes: This involves obtaining the tree-like logical relationship structure of multiple versions of a knowledge base in a specific domain. Each node in the tree structure represents a knowledge point from one version of the knowledge base. The logical relationships between knowledge points in different versions are represented by parent-child relationships between nodes. Specifically, this includes: To acquire multiple versions of a knowledge base corresponding to different development stages in a specific field. The content in the knowledge base for each version is processed to obtain the set of knowledge points for each version. The earliest version of the set of knowledge points is taken as the root node, and the knowledge points in the other versions that are not part of the root node are taken as child nodes. Establish connections between root nodes based on textual relationships, and establish connections between root nodes and child nodes based on parent-child relationships, so that the connections between nodes represent the logical relationships between various knowledge points; Based on the user's question to be answered and the tree-like logical relationship structure, obtain reference question and answer content. The reference question and answer content includes multiple knowledge points represented by nodes with parent-child relationships in the tree-like logical relationship structure. Based on the reference question and answer content and the large language model, obtain the answers to the user's questions to be answered.
2. The method according to claim 1, characterized in that, Before establishing the connection between the root node and child nodes based on the parent-child relationship, the method further includes: Each version's set of knowledge points is represented as a set vector; The answers to historical user questions that meet the requirements are represented as the first answer vector; Based on the first answer vector, a set vector is matched to obtain the knowledge points in each version whose first similarity to the first answer vector of the same historical user's question reaches a first preset value; Establish parent-child relationships between knowledge points that belong to different versions but whose first similarity reaches the first preset value.
3. The method of claim 1, wherein, Based on the user question to be answered and the tree-like logical relationship structure, obtain reference question and answer content. This content includes multiple knowledge points related to the logical relationships represented by nodes with parent-child relationships within the tree-like logical relationship structure, specifically including: Retrieve historical question-and-answer pairs, which include historical user questions and answers to historical user questions that meet the requirements; The historical user questions of the historical question-and-answer pairs are expressed as the first question vector, and the user questions to be answered are expressed as the second question vector; Obtain a first question vector whose similarity to the second question vector reaches a second preset value, and express the historical question answers of the historical question-answer pair corresponding to the first question vector as the first answer vector; Match the corresponding first answer vector to each node of the tree-like logical association structure to obtain the first node with a similarity of the third preset value, and obtain the second node that has a parent-child relationship with the first node; Obtain the corresponding historical user questions, the knowledge points of the first node, and the knowledge points of the second node as reference Q&A content.
4. The method according to any one of claims 1 to 3, characterized in that, Based on the reference question-and-answer content and the large language model, the answers to the user's questions to be answered are obtained, specifically including: Extract nouns and phrases from the reference Q&A content to form keywords; Keywords are used as prompts in a large language model to obtain answers to user questions.
5. The method of claim 4, wherein, After obtaining the answer to the user's question based on the reference question-and-answer content and the large language model, the method further includes: In response to user feedback that the answer to the user's question meets the requirements, a new question-and-answer pair is formed by combining the user's question and the corresponding answer. The large language model is trained and tuned using the new question-answering pairs until the performance of the tuned large language model meets the preset conditions.
6. The method of claim 5, wherein, The large language model is trained and optimized using the new question-answering pairs until its performance meets preset conditions, including: The new question-answer pairs and existing historical question-answer pairs are vectorized and divided into training datasets and test datasets; The training dataset is input into the underlying model of the large language model for iterative training, and the test dataset is used for evaluation in each iteration. Once the evaluation results reach the preset evaluation metrics, the output includes a large language model that includes the underlying model obtained from the final iteration training.
7. A question answering system, characterized by The system includes: The association module is used to obtain the tree-like logical association structure of multiple versions of a knowledge base in a certain domain. The nodes in the tree-like logical association structure represent knowledge points in multiple versions of the knowledge base. The logical associations between knowledge points in different versions of the knowledge base are represented by parent-child relationships between nodes, specifically including: To acquire multiple versions of a knowledge base corresponding to different development stages in a specific field. The content in the knowledge base for each version is processed to obtain the set of knowledge points for each version. The earliest version of the set of knowledge points is taken as the root node, and the knowledge points in the other versions that are not part of the root node are taken as child nodes. Establish connections between root nodes based on textual relationships, and establish connections between root nodes and child nodes based on parent-child relationships, so that the connections between nodes represent the logical relationships between various knowledge points; The reference module, connected to the association module, is used to obtain reference question and answer content based on the user question to be answered and the tree-like logical association structure. The reference question and answer content includes multiple knowledge points represented by nodes with parent-child relationships in the tree-like logical association structure. The large model module, connected to the reference module, is used to obtain answers to user questions based on reference question-and-answer content and the large language model.
8. A computer apparatus, comprising: The computer device includes a memory and a processor, the memory storing a computer program, and when the processor runs the computer program stored in the memory, the processor performs the question-and-answer method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the question-and-answer method as described in any one of claims 1-6.