Information question and answer method and device, computer equipment and program product

By acquiring domain knowledge from a knowledge base and generating response information using a language model, the problem of balancing flexibility and cost in traditional question-answering systems is solved, achieving efficient and flexible user question answering.

CN121658588APending Publication Date: 2026-03-13UNITED IMAGING RES INST OF INTELLIGENT IMAGING
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies struggle to balance flexibility and cost in user question-and-answer systems. Traditional FAQ libraries are rigid and inflexible, while high-cost question-and-answer models are expensive to train and slow to iterate.

Method used

By receiving query information, acquiring domain knowledge data from a pre-built knowledge base, generating model response information using a trained language model, and combining knowledge base updates with retraining of a large model, flexibility and accuracy are improved.

Benefits of technology

It achieves a balance between flexibility and cost when answering user questions, improves knowledge utilization and generalization ability, and optimizes user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658588A_ABST
    Figure CN121658588A_ABST
Patent Text Reader

Abstract

The invention relates to an information question and answer method and device, computer equipment and a computer program product, relates to the technical field of natural language processing, and can give consideration to flexibility and cost when answering user questions. The method comprises the following steps: receiving question information; obtaining domain knowledge data related to the question information from a pre-constructed knowledge base; inputting the domain knowledge data and the question information into a trained language model, and generating corresponding model reply information by the language model according to the domain knowledge data and the question information; and according to the model reply information, obtaining target reply information used for replying the question information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to an information question answering method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology

[0002] As the number of users and application functions continue to increase, traditional human customer service systems are finding it increasingly difficult to keep up with the growing scale of questions and answers in daily application operation inquiries. In order to improve the efficiency of question and answering, question and answer systems are often used to respond to user questions.

[0003] In related technologies, one common approach is to establish a mapping relationship between user query text and question text in a knowledge-based question-and-answer database. This involves first matching question texts in the database that are similar to the user's query, and then responding to the user's query based on the answers in the question-and-answer pairs. Alternatively, a question-and-answer model tailored to a specific scenario can be pre-trained to answer user questions.

[0004] However, among the methods described above, the former suffers from rigid and inflexible responses, potentially deviating from the user's focus. Furthermore, users may have a wide variety of questions during application operation, and this method struggles to provide effective answers to irrelevant questions outside the knowledge base. While the latter offers improved flexibility, model acquisition is costly, requiring significant time, manpower, and resources, resulting in a slow iteration rate. Clearly, these technologies struggle to balance flexibility and cost when answering user questions related to application operation. Summary of the Invention

[0005] Therefore, it is necessary to provide an information question-and-answer method, apparatus, computer device, computer-readable storage medium, and computer program product that can balance flexibility and cost when answering questions related to application operation, in order to address the above-mentioned technical problems.

[0006] Firstly, this application provides an information question-and-answer method, including:

[0007] Receive questions;

[0008] Obtain domain knowledge information related to the question from a pre-built knowledge base;

[0009] The domain knowledge data and the question information are input into the trained language model, and the language model generates corresponding model response information based on the domain knowledge data and the question information.

[0010] Based on the model's response information, obtain the target answer information for responding to the question.

[0011] In one embodiment, obtaining domain knowledge information related to the question information from a pre-built knowledge base includes:

[0012] Retrieve multiple text blocks from a pre-built knowledge base;

[0013] Based on the first relevance information between the text block and the question information, a target text block corresponding to the question information is obtained from multiple text blocks;

[0014] Based on the target text block, domain knowledge information related to the question information is obtained.

[0015] In one embodiment, the knowledge base is constructed prior to the step of receiving the query information by the following steps:

[0016] Obtain the question-answering test results corresponding to various text segmentation strategies; the question-answering test results are the test results of the language model in responding to questions based on the text block set, and the text block set is obtained by segmenting based on the text segmentation strategy corresponding to the question-answering test results;

[0017] From the various text segmentation strategies, select the target text segmentation strategy whose question-answering test results meet the strategy selection criteria.

[0018] The text data is segmented using the target text segmentation strategy to obtain multiple text blocks, and the knowledge base is constructed based on the multiple text blocks.

[0019] In one embodiment, obtaining the question-answering test results corresponding to each of the various text segmentation strategies includes:

[0020] For each text segmentation strategy, the text data is segmented using the text segmentation strategy to obtain a set of text blocks;

[0021] Obtain test question information for testing the question-answering effect of the language model, and obtain the associated text blocks associated with the test question information from each text block set;

[0022] For each of the associated text blocks, the associated text block and the test question information are input into the trained language model to obtain the test answer text output by the language model;

[0023] Based on the test response text corresponding to each of the text segmentation strategies, determine the question-answering test effect of each of the text segmentation strategies.

[0024] In one embodiment, obtaining the target text block corresponding to the question information from a plurality of text blocks based on the first relevance information between the text block and the question information includes:

[0025] Obtain first correlation information between the text vector of each text block and the text vector of the question information;

[0026] The number of text blocks to be filtered is determined based on the number of text blocks corresponding to the multiple text blocks in the knowledge base; K is a positive integer that is positively correlated with the number of text blocks and is less than the number of text blocks.

[0027] From the plurality of text blocks, K text blocks whose first relevance information satisfies the relevance filtering condition are selected as target text blocks.

[0028] In one embodiment, the step of inputting the domain knowledge data and the question information into a trained language model, and having the language model generate corresponding model response information based on the domain knowledge data and the question information, includes:

[0029] Obtain text generation prompts for controlling the output format of the language model; the text generation prompts include the domain knowledge information and the question information;

[0030] The text-generated prompt is input into the language model, which then outputs the corresponding model response information according to the domain knowledge data and the question information, in accordance with the output format.

[0031] In one embodiment, the model response information includes model response text;

[0032] The step of obtaining target answer information for answering the question information based on the model response information includes:

[0033] Determine the text tags corresponding to each of the multiple media files stored in the knowledge base;

[0034] Based on the second relevance information between each of the text tags and the question information, a target media file associated with the question information is determined from the plurality of media files;

[0035] Based on the model response text and the target media file, target response information is obtained to answer the question.

[0036] Secondly, this application also provides an information question-and-answer device, comprising:

[0037] The question information receiving module is used to receive question information;

[0038] The knowledge base query module is used to retrieve domain knowledge information related to the question information from a pre-built knowledge base;

[0039] The model processing module is used to input the domain knowledge data and the question information into the trained language model, and the language model generates corresponding model response information based on the domain knowledge data and the question information.

[0040] The answer information acquisition module is used to acquire target answer information for answering the question information based on the model answer information.

[0041] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0042] Receive questions;

[0043] Obtain domain knowledge information related to the question from a pre-built knowledge base;

[0044] The domain knowledge data and the question information are input into the trained language model, and the language model generates corresponding model response information based on the domain knowledge data and the question information.

[0045] Based on the model's response information, obtain the target answer information for responding to the question.

[0046] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0047] Receive questions;

[0048] Obtain domain knowledge information related to the question from a pre-built knowledge base;

[0049] The domain knowledge data and the question information are input into the trained language model, and the language model generates corresponding model response information based on the domain knowledge data and the question information.

[0050] Based on the model's response information, obtain the target answer information for responding to the question.

[0051] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0052] Receive questions;

[0053] Obtain domain knowledge information related to the question from a pre-built knowledge base;

[0054] The domain knowledge data and the question information are input into the trained language model, and the language model generates corresponding model response information based on the domain knowledge data and the question information.

[0055] Based on the model's response information, obtain the target answer information for responding to the question.

[0056] The aforementioned question-answering method, apparatus, computer device, computer-readable storage medium, and computer program product, upon receiving a question, can retrieve domain knowledge data related to the question from a pre-built knowledge base. The domain knowledge data and the question information are then input into a trained language model. The language model generates corresponding model response information based on the domain knowledge data and the question information. Finally, based on the model response information, target answer information for answering the question is obtained. In this embodiment, by inputting domain knowledge data related to the question and the question information into the language model, the language model fully understands the domain knowledge data and generates model response information corresponding to the question. On the one hand, it can fully utilize existing data in the knowledge base to answer questions related to application operations. When application-related knowledge is updated, only the knowledge base needs to be updated, without retraining the large model. Data updates are convenient and highly scalable. On the other hand, it can provide predictive responses to questions not in the knowledge base, increasing the flexibility and accuracy of the answer while improving knowledge utilization. It can effectively expand the knowledge base and has strong generalization ability. Thus, it can effectively balance flexibility and cost in the question-answering process. Attached Figure Description

[0057] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0058] Figure 1 This is a diagram illustrating the application environment of the information question-answering method in one embodiment;

[0059] Figure 2 This is a flowchart illustrating an information question-and-answer method in one embodiment;

[0060] Figure 3 This is a flowchart illustrating one step in acquiring domain knowledge data in one embodiment;

[0061] Figure 4 This is a flowchart illustrating another information question-answering method in one embodiment;

[0062] Figure 5 This is a structural block diagram of an information question-and-answer device in one embodiment;

[0063] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0065] To enable those skilled in the art to better understand this application, the relevant technologies are first introduced below.

[0066] In practical applications, software products in various professional fields are characterized by a relatively narrow user base, strong product specificity, and high learning costs. For a long time, resolving user operational problems at specific software technical levels has primarily relied on human intervention, thus requiring software developers to bear additional human resource costs. With the continuous increase in the number of users and application functions, traditional human customer service systems are struggling to keep up with the expanding scale of questions and answers in daily application operation consultations. To provide users with more efficient consultation services and reduce related costs, and thanks to the rapid development of natural language processing and artificial intelligence, the use of question-and-answer systems to answer user inquiries is gradually becoming more widespread.

[0067] In related technologies, a common approach is to establish a FAQ (Frequently Asked Questions) database for question-and-answer sessions. When user questions are highly similar, the FAQ database can address most user questions through a basic organizational structure. For example, one approach involves establishing a mapping relationship between user query text and question texts in the FAQ database. First, similar question texts are matched in the FAQ database, and then the user query text is answered based on the responses in the question-and-answer pairs.

[0068] Alternatively, a question-answering model tailored to a specific scenario can be pre-trained and used to answer user questions.

[0069] However, the matching and mapping in this approach are often rigid, ignoring the diversity of user questions. For example, a user might be interested in only a specific detail in a question-and-answer pair, but the matching algorithm cannot match the user's question with the answer text in the FAQ database, thus failing to find the relevant paragraph. Furthermore, this approach often struggles to provide effective answers to questions outside the database. While the latter approach offers more flexibility, it is costly to acquire models, requiring significant time, manpower, and resources, and has a low iteration rate. Therefore, it is evident that these technologies struggle to balance flexibility and cost when answering user questions related to application operation.

[0070] Based on this, this application provides an information question-and-answer method, apparatus, computer device, computer-readable storage medium, and computer program product that can balance flexibility and cost when answering questions.

[0071] The information question-and-answer method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, the application environment may include a terminal and a server. The terminal can communicate with the server through a network. The server may have a data storage system, which can store the data that the server needs to process. For example, a knowledge base corresponding to the target application can be set up in the data storage system. In some examples, the data storage system may be integrated on the server or placed on the cloud or other network servers.

[0072] In an exemplary embodiment, in response to a user-initiated query, the terminal can generate a query and send it to the server. After receiving the query, the server can retrieve domain knowledge data related to the query from the knowledge base, and then input the domain knowledge data and the query data into a trained language model. The language model generates corresponding model response information based on the domain knowledge data and the query data. Then, based on the model response information, the server obtains the target answer information to answer the query and sends it to the terminal.

[0073] In one embodiment, the terminal may be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices; wherein, portable wearable devices may be smartwatches, smart bracelets, head-mounted devices, etc.; head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server may be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.

[0074] In one exemplary embodiment, such as Figure 2As shown, an information question answering method is provided, which can be applied to... Figure 1 Taking the server in the example, the explanation includes the following steps S201 to S204. Wherein:

[0075] S201, Receive question information.

[0076] The question information can be the content of a question entered by the user in order to obtain an answer. In this step, the user can enter the question information on the terminal and send it to the server through the terminal.

[0077] In some embodiments, the query information can be application operation queries for the target application. In this case, the query information is also called application operation query information. The application can include various professional field applications, characterized by high specialization. In traditional usage, the normal use of the application relies on the user's professional knowledge and experience, such as one or more applications like medical image data processing, image processing, enterprise management, logistics management, and securities trading. It often takes time to become familiar with the application's operation. Of course, in other examples, the application can also include non-professional field applications, such as social applications and search applications. For example, the query information can be used to query the operation steps and / or processes of the target application, or to query the parameter configuration methods corresponding to the parameters involved in the use of the target application.

[0078] Understandably, the question information can be in text form, for example, it can be obtained from the text content entered by the user in the consultation dialog box on the terminal; of course, the question information can also be in voice form, for example, it can be the voice query of the application operation, and the server can process the obtained voice into text to obtain the question information in text form.

[0079] S202: Obtain domain knowledge information related to the question from a pre-built knowledge base.

[0080] In practical implementation, a knowledge base corresponding to the application can be pre-built. This knowledge base can store relevant knowledge information from various fields, and the data stored in the knowledge base can include at least one of the following formats: text, voice, video, images, and tables. In some examples, taking a knowledge base built for application operation Q&A as an example, the content of the knowledge base can include, but is not limited to, operation instructions, frequently asked user questions, explanations of professional terms, and one or more application-related knowledge contents. Professional terms can include those involved in using the target application, such as those used in the interactive interface provided by the target application, or those related to the professional field to which the target application belongs. For example, to help users understand the operating principles behind the target application's operation, professional terms not displayed on other interfaces can be introduced. In addition, the knowledge base can also include media files, which can be explanatory documents used to assist in solving user problems, in addition to text files. These can be organized and presented in the form of graph databases and / or videos. In some optional embodiments, the content in the knowledge base can be pre-processed to ensure text quality; the information in the knowledge base can also be iteratively updated according to a preset update frequency, so that subsequent answers to questions can be based on the latest information in the knowledge base.

[0081] In this step, in response to the received question information, the question information can be analyzed, and then domain knowledge information related to the question information can be obtained from the knowledge base.

[0082] Specifically, different questions may focus on different content. For example, question M1 queries how processing A in the target application is implemented, while question M2 queries how parameter B in the target application is configured. The relevant information involved in the two questions differs. Similarly, question M3 queries application operations, while question M4 queries how to handle medical procedures (such as admission and discharge) in a medical institution. To address this, domain knowledge materials related to the question can be retrieved from a knowledge base. Domain knowledge materials can be understood as information related to the target application's domain and relevant to answering the question. The storage format of domain knowledge materials can include at least one of the following: text, voice, video, images, and tables.

[0083] S203: Input the domain knowledge data and question information into the trained language model, and the language model generates the corresponding model response information based on the domain knowledge data and question information.

[0084] In practical applications, language models can be pre-trained. In one example, the language model can be a Large Language Model (LLM). The language model can be trained on massive amounts of semantically rich data, enabling it to correctly understand the semantics of the input content and generate the specified natural language text. In some alternative embodiments, the language model can be trained on massive amounts of text data, allowing it to correctly understand the semantics of the input text. In other embodiments, multimodal data can be used to train the language model, such as training a semantic model using data from at least two modalities: images, videos, audio, and text. This allows the trained semantic model to understand the semantics of input content from different modalities and output the specified natural language text.

[0085] In this step, after acquiring the domain knowledge data, the domain knowledge data and the question information can be input into a trained language model. The trained language model performs semantic understanding analysis on the input domain knowledge data, and then generates an answer corresponding to the question information based on the semantic understanding analysis results, i.e., the model response information. The model response information can include at least one of the following forms of information: text, image, audio, or video.

[0086] Specifically, in related technologies, the development of artificial intelligence has enabled the training of question-answering models to handle user questions. Traditional question-answering models no longer use the "match-output" logic, but instead directly generate answers end-to-end through specific mechanisms such as attention mechanisms. Compared to the "match-output" approach, this method offers greater flexibility and reduces the cost of compiling and maintaining FAQ databases. However, this approach requires training a separate question-answering model for each specific scenario, resulting in high training costs, long experimental cycles, and limitations on the model's update and iteration rate. Furthermore, due to limitations in the question-answering model's own knowledge base, its expertise is far from sufficient to provide accurate answers to less common or obscure user questions, leading to lower accuracy.

[0087] In this application, by inputting domain knowledge data related to the question information into the language model, the language model can first obtain background knowledge related to the question information based on the domain knowledge data. By fully understanding and analyzing the semantics of the relevant background knowledge, it can provide targeted and flexible answers to various possible question information based on the analysis results, and generate model response information.

[0088] S204. Based on the model's response information, obtain the target response information to answer the question.

[0089] After obtaining the model's response information, target answer information for responding to the question can be derived based on the text. In some embodiments, the model's response information can be directly used as the question-and-answer information. In other embodiments, the model's response information and its other information can be combined to form the target answer information. For example, in addition to the model's response information, one or more of the following can be included as the target answer information: references, related content links, etc.

[0090] In the aforementioned question-answering method, after receiving the question information, domain knowledge data related to the question information can be obtained from a pre-built knowledge base. The domain knowledge data and the question information are then input into a trained language model. The language model generates corresponding model response information based on the domain knowledge data and the question information. Finally, based on the model response information, the target answer information for answering the question information is obtained. In this embodiment, by inputting the domain knowledge data related to the question information and the question information into the language model, the language model fully understands the domain knowledge data and generates model response information corresponding to the question information. On the one hand, it can fully utilize the existing data in the knowledge base to answer questions related to application operations. When application-related knowledge is updated, only the knowledge base needs to be updated, without retraining the large model. Data updates are convenient and highly scalable. On the other hand, it can provide predictive responses to questions not in the knowledge base, increasing the flexibility and accuracy of the answer while improving knowledge utilization. It can effectively expand the knowledge base and has strong generalization ability. Therefore, it can effectively balance the flexibility and cost in the question-answering process.

[0091] Furthermore, by using the information question-and-answer method provided in this application to answer user questions, the problem of limited human customer service resources, high costs, and the inability to respond in a timely manner can be effectively solved. This significantly saves human resources while effectively improving response speed and optimizing user experience.

[0092] In one embodiment, the knowledge base can be a locally deployed knowledge base. Specifically, the terminology and text in the software's domain are often highly relevant to the business of that domain, and in some cases, it may be difficult to obtain a large amount of high-quality external corpus. Therefore, in this embodiment, a locally deployed local database can be used as the knowledge base. Taking a knowledge base built for application operations as an example, the local database can store one or more application-related knowledge contents, including but not limited to software operation instructions, frequently asked user questions, and explanations of professional terms. It can also include media files. For relevant explanations, please refer to the previous introduction on target databases, which will not be repeated here. By using a locally deployed local database as the knowledge base, the utilization rate of local business knowledge can be improved, and the language model can be helped to improve the accuracy of answers by combining local business knowledge.

[0093] In one embodiment, such as Figure 3 As shown, in step S202, obtaining domain knowledge information related to the question from a pre-built knowledge base may include the following steps:

[0094] S301, retrieve multiple text blocks from a pre-built knowledge base.

[0095] In practice, texts related to the target application are often quite long. To improve analysis and processing efficiency, such as ensuring the accuracy of subsequent text vectorization, the text data related to the target application can be pre-divided into blocks, and the resulting text blocks can be stored in a knowledge base. Then, upon receiving a query, the stored text blocks can be retrieved from the knowledge base.

[0096] S302, based on the first relevance information between the text block and the question information, obtain the target text block corresponding to the question information from multiple text blocks.

[0097] After obtaining multiple text blocks, the relevance information between each text block and the question information can be determined. This relevance information characterizes the degree of correlation between the text blocks and the question information; in one example, the relevance information could be similarity. For ease of distinction, the relevance information between the text blocks and the question information is referred to as the first relevance information.

[0098] After determining the primary relevance information of each of the multiple text blocks to the question information, the text block that is relevant to the question information can be identified from the multiple text blocks based on the primary relevance information, and then used as the target text block.

[0099] S303, Based on the target text block, obtain domain knowledge information related to the question information.

[0100] In practice, the target text block can be directly used as domain knowledge data and input into the language model for analysis and processing.

[0101] In this embodiment, by determining the target text block related to the question information from multiple text blocks based on the first relevance information, and using it as domain knowledge data, the text information can be pre-screened before the text content is submitted to the language model, thereby improving the effective information density of the content related to the question information. This takes into account both the context length of the language model and its limited ability to understand long documents in a single-turn dialogue, and also makes the answer returned by the language model to the user more accurate.

[0102] In one embodiment, the knowledge base can be built through the following steps before receiving query information:

[0103] Obtain the question-and-answer test results corresponding to various text segmentation strategies; select the target text segmentation strategy whose question-and-answer test results meet the strategy selection criteria from the various text segmentation strategies; segment the text data using the target text segmentation strategy to obtain multiple text blocks, and build a knowledge base based on the multiple text blocks.

[0104] Among them, the question-answering test result is the test result of the language model in responding to questions based on the text block set, which is obtained by segmenting the text based on the text block strategy corresponding to the question-answering test result.

[0105] Text segmentation strategy can be understood as a way of dividing text. A text segmentation strategy can include at least one segmentation method. That is, in a text segmentation strategy, the entire text can be segmented according to a fixed single segmentation method, or multiple segmentation methods can be combined in different ways to segment the entire text.

[0106] In practical applications, different text segmentation strategies may yield different results. Text segments that are too small or too large can lead to unnecessary truncation of the context or inaccurate search results. Furthermore, considering subsequent integration with language models, the context length that the language model can effectively understand will also affect the length of the text segments and should be taken into account. In addition, when selecting a text segmentation strategy, the nature of the information in the knowledge base and the user's intent in asking the question should also be considered. For example, whether the information modules in the knowledge base are concise and specific or complex and lengthy will affect the segment length and the selection of the text segmentation strategy.

[0107] Furthermore, different text organization formats are suitable for different text segmentation methods. In some examples, segmentation methods are categorized based on the uniformity of segment size. These methods can include fixed-length text segmentation and variable-length text segmentation. The former has simpler logic and operation processing and can also reduce the uncertainty during vectorization (embedding), while the latter is suitable for formatted text organized using, for example, Markdown (a lightweight markup language that can be used to add formatting elements to plain text) or LaTeX (a typesetting system based on the TeX typesetting engine). It can more intelligently segment content according to its structural hierarchy, ensuring semantic coherence.

[0108] In this embodiment, multiple text segmentation strategies can be pre-set. Then, a language model can be used to obtain the question-answering test results when using various text segmentation strategies. These test results reflect the accuracy of the language model's question responses based on the segmented text block set when using a specific text segmentation strategy to segment the text. The better the question-answering test results obtained by the language model, the more suitable the text segmentation strategy can be considered.

[0109] Furthermore, strategies can be selected based on the question-answering test results corresponding to various text segmentation strategies. The text segmentation strategies whose question-answering test results meet the strategy selection criteria can be identified as the target text segmentation strategies. Specifically, for example, evaluation parameters can be obtained for each text segmentation strategy. These evaluation parameters characterize the question-answering test results achieved by the language model when applying the corresponding text segmentation strategy. In one example, during the testing process, vector libraries corresponding to various text segmentation strategies can be built, and then a series of queries and tests can be performed to meticulously examine the quality and performance of different text segmentation strategies, continuously regressing to obtain a better target text segmentation strategy.

[0110] After determining the target text segmentation strategy, it can be used to segment the relevant text data, obtaining multiple text blocks which are then stored in a knowledge base. In some examples, the final determined target text segmentation strategy can be an open-source text segmentation method that can segment text according to a single text segment length of 350 characters.

[0111] In this embodiment, by comparing the question-answering test results of various text segmentation strategies on the language model, the text data is segmented using the determined target text segmentation strategy. This allows for the accurate and effective selection of a text segmentation strategy that matches the language model, ensuring the accuracy of the segmentation of text data related to the target application. This enables the language model to more fully and accurately understand the semantics of the input text blocks, thereby improving the accuracy of the output model response information.

[0112] In one embodiment, obtaining the question-answering test results corresponding to various text segmentation strategies may include the following steps:

[0113] For each text segmentation strategy, the text data is segmented using the strategy to obtain a set of text blocks. Test question information is obtained to test the question-answering performance of the language model. Associated text blocks related to the test question information are extracted from each set of text blocks. For each associated text block, the associated text block and the test question information are input into the trained language model to obtain the test answer text output by the language model. Based on the test answer text corresponding to each text segmentation strategy, the question-answering performance of each text segmentation strategy is determined.

[0114] In practical implementation, different text segmentation strategies can be used to segment identical text data related to the target application, resulting in a text block set corresponding to each strategy. Then, information about the query application operation method can be obtained to perform question-and-answer testing on the language model. For ease of differentiation, this query application operation method information is called the test question information. Then, for each text block set, text blocks associated with the test question information can be extracted as associated text blocks. Specifically, for example, based on the relevance information between multiple text blocks in the text block set and the test question information, text blocks associated with the test question information can be extracted from multiple text blocks in the text block set as associated text blocks.

[0115] In some optional embodiments, after obtaining multiple sets of text blocks, for each set of text blocks, the individual text blocks can be vectorized (embedding) to construct a vector library corresponding to the text block set. Subsequently, the language model input can be obtained based on the text vectors corresponding to the test question information and the text vectors in the vector library. Vectorization refers to mapping each text block to a vector in the real number domain. Vectorization can transform high-dimensional sparse features into low-dimensional dense features. In some examples, content-based vectorization generation methods can be implemented using open-source natural language processing tool libraries or open-source text embedding models, such as Text toVector (an open-source natural language processing tool) or Moka Massive Mixed Embedding (an open-source text embedding model). For example, when the text contains Chinese and also involves a small amount of English, the Moka Massive Mixed Embedding series of models can be used for vectorization.

[0116] After obtaining the associated text blocks under each text segmentation strategy, for each associated text block under each strategy, the associated text blocks and the test question information can be input into a trained language model. The language model then generates and outputs the test answer text corresponding to the test question information based on the input associated text blocks, and determines the matching degree between the test answer text and the test query text, such as analyzing whether the test answer text accurately answers the test query text. Furthermore, based on the test answer text corresponding to each text segmentation strategy, the question-answering test performance of each text segmentation strategy can be determined.

[0117] In this embodiment, by inputting the test question information and the associated text blocks corresponding to each text segmentation strategy into the trained language model, question-and-answer tests are conducted respectively. Based on the test answer text corresponding to each text segmentation strategy, the question-and-answer test effect of each segmentation strategy is determined. This can accurately identify the adaptability of each text segmentation strategy and the language model in the question-and-answer scenario, which helps to accurately select the best target text segmentation strategy.

[0118] In one embodiment, step S302 may include the following steps:

[0119] Obtain the first relevance information between the text vector of each text block and the text vector of the question information; determine the number of filters K based on the number of text blocks corresponding to multiple text blocks in the knowledge base; select K text blocks from multiple text blocks whose first relevance information satisfies the relevance filtering condition as target text blocks.

[0120] Where K is a positive integer that is positively correlated with the number of text blocks and is less than the number of text blocks.

[0121] In practice, a vector index can be pre-built to generate the text vector for each text block, i.e., to obtain the embedding vector for each text block. Since a pre-built vector library is available, there's no need to re-vectorize it each time, simplifying the operation and improving efficiency. Upon receiving a question, the corresponding text vector can be retrieved. Then, the similarity between the text vector of each text block and the text vector of the question can be calculated to obtain the first relevance information.

[0122] On the other hand, different knowledge bases have varying amounts of data. In some cases, the knowledge base used in question-and-answer scenarios has a large amount of data. In this embodiment, the filtering quantity K can be determined based on the number of text blocks corresponding to multiple text blocks in the knowledge base, allowing the filtering quantity to be adjusted in a timely manner. For example, when the knowledge base is large and there is a lot of related content, the filtering quantity K can be set higher. Of course, in other embodiments, the processing capability of the language model can also be considered when determining the filtering quantity, that is, the filtering quantity K can be determined based on the number of text blocks corresponding to multiple text blocks in the knowledge base and the data processing capability of the language model.

[0123] Furthermore, from multiple text blocks, K text blocks whose first relevance information satisfies the relevance filtering condition can be obtained as target text blocks. For example, when the first relevance information is similarity, they can be sorted from largest to smallest based on similarity, and the K text blocks with the highest similarity can be used as target text blocks. In some embodiments, when there are a large number of target knowledge base text blocks, if it is desired to accurately sort the similarity, the computational cost will be very high. Therefore, approximate nearest neighbor search can be used. Under the premise of allowing accuracy, higher search speed than brute-force search can be obtained by sacrificing accuracy. For example, ANNOY (Approximate Nearest Neighbors Oh Yeah, a fast approximate nearest neighbor search algorithm) or tools / models for efficient similarity search and clustering tasks can be used for matching and recall to obtain K target text blocks whose first relevance information satisfies the relevance filtering condition.

[0124] In this embodiment, on the one hand, text vectors can be used to accurately match the similarity of the question information and multiple text blocks, which can improve the information density of the effective information input to the language model. On the other hand, by determining the number of filtering K according to the number of text blocks in the knowledge base, K text blocks that meet the relevance filtering conditions are obtained as target text blocks, which can make full use of the text blocks in the knowledge base.

[0125] In one embodiment, step S203, where domain knowledge data and question information are input into a trained language model, and the language model generates corresponding model response information based on the domain knowledge data and question information, may include the following steps:

[0126] Obtain text generation prompts to control the output format of the language model; the text generation prompts contain domain knowledge information and question information; input the text generation prompts into the language model, and the language model outputs model response information corresponding to the question information according to the output format based on the domain knowledge information.

[0127] In practical applications, after obtaining domain knowledge data and question information, a text-generated prompt can be submitted to the language model to request formatted text output. In this embodiment, the text-generated prompt obtains a text-generated prompt used to control the output format of the language model.

[0128] After matching is completed in the text database, the top few vectors obtained from the matching and sorting are submitted to the large language model along with the user's question as prompts, requesting a structured answer output. Text-generated prompts allow control over the output format of the language model's text. For example, prompts can restrict the model's output text to originate from a knowledge base, and can also control the word count of the output text. In some examples, the output format set in the text-generated prompts can be modified according to actual conditions, thus standardizing the language model's output text in a specified way.

[0129] In some embodiments, in addition to containing domain knowledge and question information, text generation prompts can also incorporate multiple rounds of dialogue between the user and the language model before the current round of dialogue as contextual prompts into the text generation prompts, and then input them into the language model, so that the language model can better understand the user's needs and the logic of the question.

[0130] Once the language model receives a text generation prompt, it can analyze and understand the domain knowledge data. Based on the analysis results, it can output the model's response information corresponding to the question information in the output format.

[0131] In this embodiment, by including domain knowledge data and question information, the language model can be controlled to output the corresponding model response information according to a specified output format, which significantly optimizes the quality of the response output by the language model.

[0132] In one embodiment, the model response information includes model response text, which is the content output by the language model in text form to answer the user's question based on domain knowledge and question information. Step S204, obtaining the target answer information for answering the question based on the model response information, may include the following steps:

[0133] Identify the text tags corresponding to each of the multiple media files stored in the knowledge base; determine the target media file associated with the question information from the multiple media files based on the second relevance information between each text tag and the question information; obtain the target answer information for answering the question information based on the model's response text and the target media file.

[0134] In practice, multiple media files can be pre-acquired and stored in a knowledge base. In some examples, the media files can be explanatory files, in addition to text files, used to help answer user questions. They can be organized and presented in the form of graph databases and / or videos.

[0135] After obtaining the media files, text tags can be added to the media files in the media library in advance. In some exemplary embodiments, staff can summarize and generalize the content of the media files and the related issues involved, determine the corresponding text tags of the media files, and then vectorize the text tags so as to perform similarity matching with the question information in the future.

[0136] Furthermore, after obtaining the question information, the text tags of each media file can be matched with the question information to obtain the relevance information between the text tags of each media file and the question information. For ease of distinction, this relevance information is called the second relevance information. In one embodiment, when the number of media files is small and the text tag length is short, for example, when both the total number of media files and the text tag length are less than their respective thresholds, the second relevance information can be determined by cosine similarity vector matching. Specifically, this can be done by obtaining the cosine similarity between the text vectors of the media file text tags and the text vectors of the question information, obtaining the similarity between the text tags and the question information, and using this similarity as the second relevance information. Cosine similarity matching, as a more lightweight matching method, can save computational costs while preserving the effect.

[0137] Then, based on the second relevance information between each text tag and the question information, the target media file associated with the question information can be determined from multiple media files. The model response text generated by the language model and the filtered target media file are then used as the target answer information to answer the question information. In some embodiments, the media files can be sorted in descending order according to similarity, and the top M media files are selected as target media files. The target answer information containing the M target media files in descending order can then be output to the user, allowing the user to browse the relevant target media files first. In other embodiments, if the similarity scores are all below the output threshold, no output is made; if the similarity scores are all high, more entries can be output.

[0138] In some embodiments, a file viewing link for the target media file, such as the file's URL (uniform resource locator), can be obtained. Then, the file viewing link and application operation instructions text are returned to the terminal as the target answer information, reducing data transmission volume and improving the efficiency of users viewing the target answer information.

[0139] In this embodiment, by using the model's response text and the target media file as the target response information, the text response flexibly output by the language model and the media file in the knowledge base can be integrated to answer the user's questions, improving the system's usability. In parallel, different organizational forms of answers are provided, allowing users to understand the question and answer information from multiple modalities. The two complement each other, making the answer more complete, better meeting the user's needs, and effectively improving the quality of question responses.

[0140] To enable those skilled in the art to better understand the above steps, the following example illustrates the embodiments of this application, but it should be understood that the embodiments of this application are not limited thereto.

[0141] This example uses a question-and-answer scenario related to application operations for illustration. For example... Figure 4 As shown, a knowledge base can be built locally to obtain a corresponding local database, which includes text data and media files. For text data, text segmentation can be performed in advance to obtain multiple text blocks. Vectorization of these text blocks can then be used to obtain a vector library. For media files, text tags for each media file can be obtained through annotation. Similarly, text tags can be vectorized to obtain text vectors for the text tags.

[0142] Furthermore, upon receiving a user's input question regarding a target application operation, the system can obtain the question's text vector. This text vector is then compared with the text vectors of text data and media file tags to determine the text vector corresponding to the most relevant text block and the most relevant media file. The most relevant text block, along with the user's input question, is added to a prompt, submitted to the large language model, and the model's output answer is obtained. This answer is then integrated with the most relevant media file and returned to the user.

[0143] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0144] Based on the same inventive concept, this application also provides an information question-answering device for implementing the information question-answering method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more application information question-answering device embodiments provided below can be found in the limitations of the information question-answering method described above, and will not be repeated here.

[0145] In one exemplary embodiment, such as Figure 5 As shown, an information question-and-answer device is provided, comprising:

[0146] Question information receiving module 501 is used to receive question information;

[0147] The knowledge base query module 502 is used to retrieve domain knowledge information related to the question information from a pre-built knowledge base;

[0148] The model processing module 503 is used to input the domain knowledge data and the question information into the trained language model, and the language model generates model response information corresponding to the question information based on the domain knowledge data.

[0149] The answer information acquisition module 504 is used to acquire target answer information for answering the question information based on the model answer information.

[0150] In one embodiment, the knowledge base query module 502 is used for:

[0151] Retrieve multiple text blocks from a pre-built knowledge base;

[0152] Based on the first relevance information between the text block and the question information, a target text block corresponding to the question information is obtained from multiple text blocks;

[0153] Based on the target text block, domain knowledge information related to the question information is obtained.

[0154] In one embodiment, the apparatus further includes a knowledge base construction module, the knowledge base construction module being used for:

[0155] Obtain the question-answering test results corresponding to various text segmentation strategies; the question-answering test results are the test results of the language model in responding to questions based on the text block set, and the text block set is obtained by segmenting based on the text segmentation strategy corresponding to the question-answering test results;

[0156] From the various text segmentation strategies, select the target text segmentation strategy whose question-answering test results meet the strategy selection criteria.

[0157] The text data is segmented using the target text segmentation strategy to obtain multiple text blocks, and the knowledge base is constructed based on the multiple text blocks.

[0158] In one embodiment, the knowledge base building module is used for:

[0159] For each text segmentation strategy, the text data is segmented using the text segmentation strategy to obtain a set of text blocks;

[0160] Obtain test question information for testing the question-answering effect of the language model, and obtain the associated text blocks associated with the test question information from each text block set;

[0161] For each of the associated text blocks, the associated text block and the test question information are input into the trained language model to obtain the test answer text output by the language model;

[0162] Based on the test response text corresponding to each of the text segmentation strategies, determine the question-answering test effect of each of the text segmentation strategies.

[0163] In one embodiment, the knowledge base query module 502 is used for:

[0164] Obtain first correlation information between the text vector of each text block and the text vector of the question information;

[0165] The number of text blocks to be filtered is determined based on the number of text blocks corresponding to the multiple text blocks in the knowledge base; K is a positive integer that is positively correlated with the number of text blocks and is less than the number of text blocks.

[0166] From the plurality of text blocks, K text blocks whose first relevance information satisfies the relevance filtering condition are selected as target text blocks.

[0167] In one embodiment, the model processing module 503 is used for:

[0168] Obtain text generation prompts for controlling the output format of the language model; the text generation prompts include the domain knowledge information and the question information;

[0169] The text-generated prompt is input into the language model, which then outputs the corresponding model response information according to the domain knowledge data and the question information, in accordance with the output format.

[0170] In one embodiment, the model response information includes model response text; the response information acquisition module 504 is used for:

[0171] Determine the text tags corresponding to each of the multiple domain knowledge materials in the knowledge base;

[0172] Based on the second relevance information between each of the text tags and the question information, target domain knowledge materials associated with the question information are determined from the plurality of media files;

[0173] Based on the model response text and the target media file, target response information is obtained to answer the question.

[0174] Each module in the aforementioned information question-and-answer device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0175] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data related to the target application. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements an information query-answering method.

[0176] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0177] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0178] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0179] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0180] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0181] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0182] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0183] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An information question-answering method, characterized in that, The method includes: Receive questions; Obtain domain knowledge information related to the question from a pre-built knowledge base; The domain knowledge data and the question information are input into the trained language model, and the language model generates corresponding model response information based on the domain knowledge data and the question information. Based on the model's response information, obtain the target answer information for responding to the question.

2. The method according to claim 1, characterized in that, The step of obtaining domain knowledge data related to the question information from a pre-built knowledge base includes: Retrieve multiple text blocks from a pre-built knowledge base; Based on the first relevance information between the text block and the question information, a target text block corresponding to the question information is obtained from multiple text blocks; Based on the target text block, domain knowledge information related to the question information is obtained.

3. The method according to claim 2, characterized in that, The step of obtaining the target text block corresponding to the question information from a plurality of text blocks based on the first relevance information between the text block and the question information includes: Obtain first correlation information between the text vector of each text block and the text vector of the question information; The number of text blocks to be filtered is determined based on the number of text blocks corresponding to the multiple text blocks in the knowledge base; K is a positive integer that is positively correlated with the number of text blocks and is less than the number of text blocks. From the plurality of text blocks, K text blocks whose first relevance information satisfies the relevance filtering condition are selected as target text blocks.

4. The method according to claim 1, characterized in that, Prior to the step of receiving query information, the knowledge base is constructed through the following steps: Obtain the question-answering test results corresponding to various text segmentation strategies; the question-answering test results are the test results of the language model in responding to questions based on the text block set, and the text block set is obtained by segmenting based on the text segmentation strategy corresponding to the question-answering test results; From the various text segmentation strategies, select the target text segmentation strategy whose question-answering test results meet the strategy selection criteria. The text data is segmented using the target text segmentation strategy to obtain multiple text blocks, and the knowledge base is constructed based on the multiple text blocks.

5. The method according to claim 4, characterized in that, The process of obtaining the question-answering test results corresponding to various text segmentation strategies includes: For each text segmentation strategy, the text data is segmented using the text segmentation strategy to obtain a set of text blocks; Obtain test question information for testing the question-answering effect of the language model, and obtain the associated text blocks associated with the test question information from each text block set; For each of the associated text blocks, the associated text block and the test question information are input into the trained language model to obtain the test answer text output by the language model; Based on the test response text corresponding to each of the text segmentation strategies, determine the question-answering test effect of each of the text segmentation strategies.

6. The method according to claim 1, characterized in that, The step of inputting the domain knowledge data and the question information into a trained language model, and having the language model generate corresponding model response information based on the domain knowledge data and the question information, includes: Obtain text generation prompts for controlling the output format of the language model; the text generation prompts include the domain knowledge information and the question information; The text-generated prompt is input into the language model, which then outputs the corresponding model response information according to the domain knowledge data and the question information, in accordance with the output format.

7. The method according to any one of claims 1 to 6, characterized in that, The model response information includes the model response text; The step of obtaining target answer information for answering the question information based on the model response information includes: Determine the text tags corresponding to each of the multiple media files stored in the knowledge base; Based on the second relevance information between each of the text tags and the question information, a target media file associated with the question information is determined from the plurality of media files; Based on the model response text and the target media file, target response information is obtained to answer the question.

8. An information question-and-answer device, characterized in that, The device includes: The question information receiving module is used to receive question information; The knowledge base query module is used to retrieve domain knowledge information related to the question information from a pre-built knowledge base; The model processing module is used to input the domain knowledge data and the question information into the trained language model, and the language model generates corresponding model response information based on the domain knowledge data and the question information. The answer information acquisition module is used to acquire target answer information for answering the question information based on the model answer information.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.