A chat accurate response generation method and system based on prompt word knowledge retrieval

By building a knowledge graph and reachable path reasoning algorithm, combined with the business logic information of the graph structure, the shortcomings of traditional search engines in understanding users' deep intentions are solved, and more accurate chat responses and data analysis support are achieved.

CN120316217BActive Publication Date: 2025-10-17BEIJING JUZI INTERACTIVE TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510381872.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-10-17
Estimated Expiration
2045-03-28

AI Technical Summary

Technical Problem

Traditional search engines have difficulty understanding users' deep intentions when processing complex semantics and long-tail queries, resulting in retrieval results that do not meet the needs. Existing retrieval methods have limitations.

Method used

A method for generating accurate chat responses based on prompt word knowledge retrieval is adopted. By constructing a knowledge graph and a reachable path reasoning algorithm, combined with the business logic information contained in the graph structure, joint modeling of entities and relationships is performed, and a large language model is used to improve intent recognition and feedback accuracy.

Benefits of technology

It significantly improves the accuracy of user intent understanding and feedback, reduces data collection and annotation costs, enhances the system's data processing and analysis capabilities, and improves user experience and satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120316217B_ABST
    Figure CN120316217B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of natural language processing, and discloses a chat accurate response generation method based on prompt word knowledge retrieval, and the specific steps are as follows: step one: accepting user input data and business information data collection refers to collecting business data and dialogue sample data. Through the innovative graph sample generation technology, rich and varied graph structure samples can be quickly constructed under the condition of limited data resources, effectively making up for the lack of data quantity, and significantly improving the diversity and balance of the data. Moreover, by using the graph sample generation technology, high-quality samples can be quickly generated without relying on a large amount of original data, thereby greatly reducing the cost of data collection and labeling. Finally, by introducing the prompt word mechanism, the system can more accurately capture the key information in the data and deeply mine the hidden rules and characteristics in the data, which enhances the data processing and analysis capability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of natural language processing, and specifically relates to a chat accurate response generation method and system based on prompt word knowledge retrieval. BACKGROUND

[0002] A search engine is an online tool that uses specific algorithms to crawl, index, and rank information on the Internet, allowing users to quickly find relevant web pages, images, videos, and other resources after entering keywords. It greatly simplifies the information retrieval process and helps people quickly access the content they need.

[0003] In traditional search engines, retrieval results are usually based on keyword matching. However, as users demand more accurate search results and better vocabulary association capabilities, traditional search results often fail to meet users' actual needs, especially when dealing with complex problems and long-tail queries. To address these issues, RAG (Retrieval-Augmented Generation) search enhancement technology has emerged. It combines retrieval technology and language generation technology to enhance the generation process, helping traditional search engines generate more accurate, relevant, and diverse information to meet users' needs. Traditional retrieval is based on embedding vector queries. While this method improves retrieval efficiency and scope to some extent, it still has some limitations, especially in understanding complex semantics and context. Embedding vectors can capture the similarity and association between words, but they often fail to fully understand the deep intent and specific needs behind the query. This leads to a situation where traditional embedding vector query methods may return a large number of results that are partially relevant to the query but do not fully meet the user's needs when dealing with long-tail queries or queries with complex semantic structures. Therefore, improvements are needed. SUMMARY

[0004] The purpose of the present application is to provide a chat accurate response generation method and system based on prompt word knowledge retrieval to solve the problems raised in the background art.

[0005] To achieve the above-mentioned purpose, the present application provides the following technical solution: a chat accurate response generation method based on prompt word knowledge retrieval, the specific steps are as follows:

[0006] Step 1: Accept user input data and business information

[0007] Data collection refers to collecting business data and dialogue sample data, obtaining business-related data requires combining the purchase provided by Party A and defining dialogue logic by oneself; or obtaining dialogue sample data through the API interface provided by the existing website, also known as corpus and question and answer pairs. Collecting dialogue sample data refers to obtaining more items of annotatable data;

[0008] When the response system is initialized, there is no real sample and question and answer pair. First, a dialogue template is built. The dialogue template is a kind of fast-acting matching tool. According to the training set, high-quality templates can be abstracted to improve the effect. The system built by this template is put into operation, and real dialogue sample data is further accumulated;

[0009] When the template system is put into operation, the system collects the data generated in the cloud, analyzes the existing data communicated with the customer, including customer requests, support service orders, chat records, uses industry data, and collects the log data generated by the cloud product directly into the data platform of the system, and converts the materials provided by the customer into data and knowledge;

[0010] Step 2: Data cleaning and entity extraction, based on entity extraction context semantic features

[0011] After the dialogue sample data is collected, the dialogue sample data needs to be cleaned again. The process of building a knowledge graph based on text prompt words starts from natural language processing technology. First, entities and relationships are extracted from a large number of documents through text mining; these entities and relationships are identified and classified through named entity recognition and relationship extraction technology, and then the information is structured into nodes and edges using a graph database, and the nodes and edges correspond to entities and relationships respectively, and finally a knowledge graph is formed; through continuous addition of new data and relationships for expansion and update, the original data is processed by BERT to extract sentence structure features, analyze sequence information features, connect and fuse sentence structure features to improve intent recognition performance, and use natural language processing algorithms to analyze the meaning of user's speech, parse the syntax structure and identify the emotion, which can track the context of the dialogue, including the previous communication history and the change of the topic, which helps to more accurately capture the user's intent in long dialogue or complex interaction;

[0012] Step 3: Constructing a business graph with a directed graph structure according to semantic information and business information

[0013] The retrieval technology proposed in the present application relies on a super large vocabulary, and entities and relationships correspond to words. In this way, combined with the business logic information contained in the graph structure, entities and relationships can be jointly modeled as units during retrieval, so as to more accurately understand the query intent and provide more accurate retrieval results;

[0014] Through the reachable path reasoning algorithm, the entity relationship vector in the directed graph is used to calculate the triplet of the target and the difference from the head node to the tail node of the target path, the semantic distance of the path is selected, the path with the maximum semantic distance among all paths is connected with the output ht of the recurrent neural network to form a vector S, and then the vector S is nonlinearly processed to obtain the value of R(t|h):

[0015]

[0016] In the formula: Mt refers to the set of all nodes to node t, OD(ei) is the outbound of node ei, and BW(eit) is the path hop count from node ei to node t of the outbound of node ei; therefore, for each node ei in Mt, the resource amount t transferred from node ei to node t is:

[0017]

[0018] Errors and noise in knowledge may destroy the closed loop of the directed graph, in order to improve the fault tolerance of the model, it is assumed that the probability of each node jumping to a random node is the same, and the random traffic of the resource t is 1 / N, wherein N is the total number of nodes;

[0019] Step four: intent recognition based on user intent and semantic information

[0020] Through the reachable path reasoning, the entity relationship vector in the directed graph is calculated, which is used to calculate the semantic features of the triplet (h, r, t) of the target and the difference from the head node h to the tail node t of the path, the semantic distance of the path is selected, the path with the maximum semantic distance among all paths is connected with the neural network output to form a vector S, and then the vector S is nonlinearly processed to obtain the value of RP((h, r, t)), and the formula of RP((h, r, t)) is:

[0021]

[0022] The effectiveness of the method is highly relevant to the actual application, wherein β is a nonlinear activation function, Wj and bj parameters can be trained in the modeling process, j∈{1, 2}, and the value range of RP((h, r, t)) is [0, 1], and the closer the value is to 1, the higher the confidence is;

[0023] CBMB=[Hjg,RP((h,r,t))]

[0024] The above formula is a graph classification formula, where CBMB is the spliced business structure feature and semantic feature. The knowledge graph-based retrieval enhancement technology displays the connection between entities and relationships in the form of a graph by constructing a knowledge representation of the graph model, optimizes the hallucinations existing in the large language model retrieval process, and optimizes the feedback information to be more in line with business logic.

[0025] P = softmax(Wf * CBMB + bf)

[0026] The above formula is an intent classification formula, where Wf and bf are weight and bias terms, respectively, and P represents intent classification. The softmax function is used to convert the output into a probability distribution. The knowledge graph is constructed using graph technology, which organizes and connects information in a graphical format, improving the comprehensiveness of the system and providing more complex contextual information to users. This helps the large language model better understand the relationships between entities and improves its expression and reasoning capabilities.

[0027] The accuracy of intent recognition and the effectiveness of the response are monitored in real time to evaluate the overall performance of the system. The system can learn and optimize the intent recognition model and response strategy using user feedback and interaction results. Through continuous learning and adjustment, the system can adapt to new user behaviors and dialogue patterns, maintaining its advanced and effective dialogue processing capabilities.

[0028] Step five: generate feedback information based on the intent and prompt words contained in the user data and return it to the user

[0029] After the system processes the user's question, it will obtain a result that includes an understanding of the user's intent. The content in the input large model is reconstructed based on intent recognition and prompt words, and the dialogue state and understanding of the user's intent are quickly updated. This query method can provide complex data analysis and decision support for customer relationship management, risk assessment, and market analysis. Through knowledge graph query, enterprises can quickly obtain related information and discover hidden patterns and relationships, thereby improving business insight and decision-making efficiency.

[0030] Entity disambiguation is performed on the result, and potential duplicates are removed through text embedding similarity and lexical distance. The generated output needs to be further processed to ensure that it meets business logic and constraints. For non-deterministic output, a confidence threshold is needed to determine whether it is a standard output. Finally, the system outputs the processed result to the user in a standardized format.

[0031] Preferably, the data cleaning described in step 2 needs to exclude non-critical information and minimize the impact of this information on the algorithm model. For corpus crawled from the web, HTML tags need to be removed; after the system imports the stop word list, it is converted into a list format. After the text is segmented, the words in the stop word list are removed to reduce the interference of meaningless words, and specific data are deformed to adapt to more scenarios. At the same time, common language misuse problems need to be dealt with.

[0032] Preferably, the data cleaning in step 2 includes data conversion. After data collection, it is necessary to process data in different formats, including PDF, Word, PPT, video, picture and audio. In order to ensure the availability of the data, these diverse data formats need to be converted into standardized text data for subsequent processing.

[0033] Preferably, the entities described in step 2 need to be encoded with relationships, and the time encoding rules: the standard time code format shall prevail, and the specific format is: YYYY-MM-DD hh:mm:ss:ff (year, month, day, hour, minute, second and frame value); entity encoding rules: it is necessary to extract the relational knowledge graph of the data group based on the temporal encoding rules, including the intention of target to target, the intention of target to group, the intention of group to target, and the intention of group to group. The encoding method of intention is the same as the order of target type, and their first order is used to encode the decimal starting from 0 and adding 1 in sequence.

[0034] Preferably, the construction of the knowledge graph described in step 2 is simply arranged in sequence by dividing the original document into an ordered list of nodes and the node relationships between them as a vocabulary graph.

[0035] Preferably, the intent recognition described in step 4 can be regarded as a classification problem. Given a user input sequence X = {x1, x2, ..., xn}, the goal is to map it to one of a predefined intent set I = {i1, i2, ..., im}, which involves constructing a mapping function f:X→I.

[0036] Preferably, in step 4, the knowledge representation is constructed by constructing a graph model, the connection between entities and relationships is displayed in the form of a graph, and then the large language model LLM (Large Language Model) is used for retrieval enhancement.

[0037] Preferably, the intention recognition model in step four is aimed at the existing intention recognition model in the professional knowledge graph question and answer, and the identification of the field entity and the classification error of the question sentence are prone to occur, and a combined intention recognition joint model of the field knowledge graph is proposed, the entity corresponding ontology label and the ontology relationship in the field knowledge graph are introduced into the training data set, the knowledge text containing the ontology label and the knowledge text graph containing the ontology relationship are formed, the knowledge text containing the ontology label is converted into embedding representation through character level embedding and position information embedding, and the entity relationship visual matrix is created according to the knowledge text graph, and the correlation degree of each component of the knowledge text is determined, and finally the embedding representation and the entity relationship visual matrix are input into the model coding layer for model training.

[0038] Preferably, the feature formula extracted by the BERT network in step two is:

[0039] H jg =BERT(x t )

[0040] Wherein: x t is the original text, and H jg is the feature extracted by the pre-trained BERT network.

[0041] A chat accurate response generation system based on prompt word knowledge retrieval, comprising:

[0042] The response system generates feedback information based on the intention and prompt word contained in the user data and returns the feedback information to the user;

[0043] The response system comprises:

[0044] The dialogue module is used for accumulating real dialogue sample data;

[0045] The data collection module is responsible for collecting business data and dialogue sample data;

[0046] The data processing module is used for cleaning the collected data and extracting entities using natural language processing technology;

[0047] The business graph construction module is used for constructing a directed graph structure business graph according to semantic information and business information;

[0048] The intention recognition module is used for intention recognition of user intention and semantic information;

[0049] The feedback generation and output module is used for generating feedback information based on the intention and prompt word contained in the user data.

[0050] The beneficial effects of the present application are as follows:

[0051] Through the innovative graph sample generation technology, rich and diverse graph structure samples can be quickly constructed in the case of limited data resources, effectively making up for the lack of data quantity and significantly improving the diversity and balance of the data. Moreover, by using the graph sample generation technology, high-quality samples can be quickly generated without relying on a large amount of original data, thereby greatly reducing the cost of data collection and labeling. Finally, by introducing the prompt word mechanism, the system can more accurately capture the key information in the data and deeply mine the hidden rules and characteristics in the data. This ability not only enhances the data processing and analysis capabilities of the system, but also provides strong support for subsequent data applications. At the same time, the knowledge graph-based retrieval enhancement technology enables the system to more accurately understand user intent and provide feedback information that is more in line with business logic, thereby significantly improving user experience and satisfaction. BRIEF DESCRIPTION OF DRAWINGS

[0052] Fig. 1 The structure diagram of the object library, the difference file library and the ground state library in the application;

[0053] Fig. 2 The corresponding ground state and change process diagram after the spatial entity changes in the application;

[0054] Fig. 3 The process diagram of the system adaptively deciding whether to correct the current dynamic ground state according to the user's search preference in the application;

[0055] Fig. 4 The response system diagram in the application. DETAILED DESCRIPTION

[0056] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, not all embodiments. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the application.

[0057] As Figs. 1 to 4 shown, the embodiment of the application provides a chat accurate response generation method based on prompt word knowledge retrieval, and the specific steps are as follows:

[0058] Step 1: Accept user input data and business information

[0059] Data collection refers to collecting business data and dialogue sample data. To obtain business-related data, the purchase and dialogue logic provided by Party A need to be defined by oneself; or dialogue sample data, also known as corpus and question-answer pairs, can be obtained through the API interface provided by the existing website. Collecting dialogue sample data refers to obtaining more items of annotatable data;

[0060] When the response system is initialized, there is no real sample and question and answer pair. First, a dialogue template is built. The dialogue template is a fast-acting matching tool. High-quality templates can be abstracted according to the training set to improve the effect. The system built by this template is put online, and real dialogue sample data is further accumulated;

[0061] When the template system is put online, the system collects the data generated in the cloud, analyzes the existing data communicated with the customer, including customer requests, support service orders, chat records, uses industry data, and directly collects the log data generated by the cloud product into the data platform of the system. The materials provided by the customer are converted into data and knowledge;

[0062] Step 2: Data cleaning and entity extraction, context semantic feature extraction based on entity extraction

[0063] After the dialogue sample data is collected, the dialogue sample data needs to be cleaned again. The process of building a knowledge graph based on text prompt words starts from natural language processing technology. First, entities and relationships are extracted from a large number of documents through text mining. These entities and relationships are identified and classified through named entity recognition and relationship extraction technology, and then the information is structured into nodes and edges using a graph database. The nodes and edges correspond to entities and relationships respectively, and finally a knowledge graph is formed. Through continuous addition of new data and relationships, the original data is processed by BERT to extract sentence structure features, analyze sequence information features, connect and fuse sentence structure features to improve intent recognition performance. Using natural language processing algorithms for word sense analysis, syntactic structure analysis and sentiment recognition of user speech, the context of the dialogue can be tracked, including the previous communication history and topic change, which helps to more accurately capture the user's intent in long conversations or complex interactions;

[0064] Step 3: Constructing a business graph with a directed graph structure according to semantic information and business information

[0065] The retrieval technology proposed in this application relies on a super large vocabulary, and entities and relationships correspond to words. In this way, combined with the business logic information contained in the graph structure, entities and relationships can be jointly modeled as units during retrieval, so as to more accurately understand the query intent and provide more accurate retrieval results;

[0066] Through the reachable path reasoning algorithm, the entity relationship vector in the directed graph is used to calculate the triad of the target and the difference from the target head node to the target tail node. The semantic distance of the selected path is the path with the maximum semantic distance among all paths. The path is connected with the recurrent neural network output ht to form a vector S, and then the vector S is nonlinearly processed to obtain the value of R(t|h):

[0067]

[0068] In the formula: Mt refers to the set of all nodes to node t, OD(ei) is the outbound of node ei, BW(eit) is the path hop count of the outbound of node ei from node ei to node t; therefore, for each node ei in Mt, the amount of resources t transferred from node ei to node t is:

[0069]

[0070] The existence of errors and noise in knowledge may break the closed loop of the directed graph, in order to improve the fault tolerance of the model, it is assumed that the probability of each node jumping to a random node is the same, and the random traffic of this part of resources t is 1 / N, where N is the total number of nodes;

[0071] Step four: intent recognition based on user intent and semantic information

[0072] Through the reasoning of the reachable path, the entity relationship vector calculated in the directed graph is used to calculate the semantic features of the target triad (h, r, t) and the path difference from the head node h to the tail node t, select the semantic distance of the path, and the path with the maximum semantic distance in all paths is connected with the neural network output to form a vector S, and then the vector S is nonlinearly processed to obtain the value of RP((h, r, t)). The formula of RP((h, r, t)) is:

[0073]

[0074] The effectiveness of the method is highly relevant to the actual application, where β is a nonlinear activation function, and the parameters Wj and bj can be trained during the modeling process, j∈{1,2}, and the value range of RP((h, r, t)) is in [0,1], and the closer the value is to 1, the higher the confidence is;

[0075] CBMB=[Hjg,RP((h,r,t))]

[0076] The above formula is a graph classification formula, where CBMB is the spliced business structure feature and semantic feature, and the retrieval enhancement technology based on knowledge graph constructs a knowledge expression of the graph model, displays the connection between entities and relationships in the form of a graph, optimizes the illusion existing in the retrieval process of the large language model, and optimizes the feedback information to be more in line with the business logic;

[0077] P=softmax(Wf*CBMB+bf)

[0078] The above formula is an intent classification formula, where Wf and bf are weight and bias terms, respectively, and P represents intent classification. The output is converted to a probability distribution using a softmax function. The knowledge graph is constructed using graph technology, which organizes and connects information in a graphical format, improving the comprehensiveness of the system and providing more complex contextual information to users. This helps large language models better understand the relationships between entities and improves their expression and reasoning abilities.

[0079] The system monitors the accuracy of intent recognition and the effectiveness of responses in real-time to evaluate the overall performance of the system. The system can learn and optimize the intent recognition model and response strategy using user feedback and interaction results. Through continuous learning and adjustment, the system can adapt to new user behaviors and dialogue patterns, maintaining its advanced and effective dialogue processing capabilities.

[0080] Step five: generate feedback information based on the intent and cue words contained in the user data and return it to the user

[0081] After the system processes the user's question, it will obtain a result that includes an understanding of the user's intent. The content in the input large model is reconstructed based on intent recognition and cue words, and the dialogue state and user intent understanding are quickly updated. This query method can be used for complex data analysis and decision support for customer relationship management, risk assessment, and market analysis. Through knowledge graph query, enterprises can quickly obtain related information and discover hidden patterns and relationships, thereby improving business insight and decision-making efficiency.

[0082] Entity disambiguation is performed on the result, and potential duplicates are removed based on text embedding similarity and lexical distance. The generated output needs further processing to ensure that it meets business logic and constraints. For non-deterministic output, a confidence threshold is used to determine whether it is a standard output. Finally, the system outputs the processed result to the user in a standardized format.

[0083] First, accept user input data and business information, then perform data cleaning and extract entities, extract contextual semantic features based on entities, construct a knowledge graph using natural language processing techniques, and extract sentence structure features using BERT processing to improve intent recognition performance. Then, based on semantic information and business information, construct a directed graph structure business graph, calculate entity relationship vectors using reachable path reasoning algorithms to improve model fault tolerance. Next, based on user intent and semantic information, perform intent recognition, optimize feedback information to better fit business logic through graph classification and intent classification formula. Finally, generate feedback information based on the intent and cue words contained in the user data and return it to the user, process complex data analysis and decision support, perform entity disambiguation and confidence threshold judgment, and output the result in a standardized format.

[0084] In step two, data cleaning is required to exclude non-key information and minimize its impact on the algorithm model. For web crawled corpus, HTML tags need to be removed. After importing the stopword list, it is converted to list format. After text segmentation, remove words in the stopword list to reduce the interference of meaningless words. Deformation processing is performed on specific data to adapt to more scenarios, and common language misuse problems need to be handled.

[0085] When the data set contains noise unrelated to the task, it is difficult to train an efficient model even if the data volume is large. Data can take many forms, including but not limited to missing data, unstructured data, or data lacking regular structure. Removing HTML tags and other non-text elements is a necessary step because such HTML tags and other non-text elements are unrelated to the theme of the text content. Removing these tags can reduce interference.

[0086] In step two, data cleaning includes data conversion. After data collection, different formats of data need to be processed, including PDF, Word, PPT, video, picture and audio. In order to ensure the availability of data, it is necessary to convert these diversified data formats into standardized text data for subsequent processing.

[0087] Different data formats require specific processing tools and technologies. PDF files are read and parsed from servers or locally. After parsing, an object model is generated, including document metadata, page layout, text and images. In addition to basic rendering, text and image data can be extracted from PDFs for data analysis and processing.

[0088] In step two, entities and relationships need to be encoded. Time encoding rules: use standard time code format as reference. Specific format: YYYY-MM-DD hh:mm:ss:ff (year, month, day, hour, minute, second and frame value). Entity encoding rules: based on time encoding rules, extract relationship knowledge graph of data group, including intent target to target, target to group intent, group to target intent, and group to group intent. The encoding method is the same as the order of target types and their first order for decimal encoding starting from 0 and 1.

[0089] In the time code format, the first six data are standard time, where the year is represented by 13-bit binary code, the month by 4-bit binary code, the day and hour by 5-bit binary code, the minute and second by a 6-bit binary code respectively, and the seventh data is the frame number of the video, represented by 17-bit binary code. When generating the time code, fill in 011111111111111, and when calculating, take out the year, month, day, hour, minute, and second codes for calculation, and ignore the last 16 bits.

[0090] In step two, the construction of the knowledge graph is only arranged in order by dividing the original document into an ordered node list and the node relationship between them as a vocabulary graph.

[0091] In human-computer dialogue systems, intent recognition is the key to determining intent or purpose. The information provided by the user during interaction with the system enables the system to provide appropriate responses or operations. By proposing an intent recognition model that combines sequential information and sentence structure, the extracted entities and relationships are constructed into triples: subject, predicate, and object. These triples are stored in a graph database such as Neo4j or RDF. The graph database uses nodes to represent entities and edges to represent relationships.

[0092] In step four, intent recognition can be considered a classification problem. Given a user input sequence X = {x1, x2,..., xn}, the goal is to map it to one of a predefined set of intents I = {i1, i2,..., im}. This involves constructing a mapping function f: X → I.

[0093] Before inputting the user text, standard text preprocessing is required, such as word segmentation, lowercase conversion, and stop word removal. Word embedding techniques are used to convert text into numerical vectors for model processing.

[0094] In step four, the knowledge representation of the graph model is constructed to display the relationship between entities and relationships in the form of a graph, and then a large language model (LLM) is used for retrieval enhancement.

[0095] In business applications, knowledge graph queries are usually implemented through graph database query languages. Users input query requests through natural language or structured query language. The system first parses the natural language query into a structured query, then performs matching and retrieval in the knowledge graph, and returns relevant entities and relationships.

[0096] In step four, the intent recognition model is trained to identify the domain entity and the question classification error in the professional field knowledge graph question and answer, and a combined domain knowledge graph intent recognition joint model is proposed. First, the entity corresponding ontology label and the ontology relationship in the domain knowledge graph are introduced into the training data set to form a knowledge text containing ontology label and a knowledge text graph containing additional ontology relationship. Then, the knowledge text containing ontology label is converted into embedding representation through character-level embedding and position information embedding, and the entity relationship visual matrix is created according to the knowledge text graph to determine the correlation degree of each component of the knowledge text. Finally, the embedding representation and the entity relationship visual matrix are input into the model coding layer for model training.

[0097] Through targeted training of the intent recognition joint model, the intent recognition model can perform better in the corresponding field.

[0098] In step two, the feature formula extracted by the BERT network is:

[0099] H jg =BERT(x t )

[0100] Where: x t is the original text, and H jg is the feature extracted by the pre-trained BERT network.

[0101] By analyzing the sequence information feature, the sentence structure feature is connected and fused, effectively utilizing the context and semantic information in the text, thereby improving the accuracy of intent recognition.

[0102] A chat accurate response generation system based on prompt word knowledge retrieval, comprising:

[0103] Response system: generate feedback information based on the intent and prompt word contained in the user data and return it to the user;

[0104] The response system comprises:

[0105] Dialogue module: used for accumulating real dialogue sample data;

[0106] Data collection module: responsible for collecting business data and dialogue sample data;

[0107] Data processing module: used for cleaning the collected data and extracting entities using natural language processing technology;

[0108] Business graph construction module: used for constructing a directed graph structure business graph according to semantic information and business information;

[0109] An intent recognition module is configured to recognize the user intent and semantic information;

[0110] A feedback generation and output module is configured to generate feedback information based on the intent and prompt words contained in the user data.

[0111] The data collection module and the dialogue module are responsible for obtaining and preparing business data and dialogue samples, providing basic information for the system. The data processing module processes the collected data, extracts key entities and relationships, and constructs a knowledge graph. Then the business graph construction module uses this information to construct a directed graph structure business graph to provide structured knowledge support for retrieval. The intent recognition module identifies the user intent based on the user input and semantic information through deep learning and graph technology to ensure accurate responses. Finally, the feedback generation and output module combines the user intent and prompt words to generate feedback information that conforms to the business logic and outputs it to the user in a standardized format, achieving efficient and accurate chat response services.

[0112] It should be noted that, in this text, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply any actual such relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device.

[0113] Although embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.

Claims

1. A chat accurate answer generation method based on prompt word knowledge retrieval, characterized in that: The specific steps are as follows: Step 1: Accept user input data and business information Data collection refers to the collection of business data and conversation sample data. Obtaining business-related data requires customizing the purchase and conversation logic provided by Party A. Alternatively, conversation sample data, also known as corpus and question-answer pairs, can be obtained through the API provided by existing websites. Collecting conversation sample data means obtaining more items that can be annotated. When the answering system is initialized, there are no real samples or question-answer pairs. First, a conversation template is built. This is a fast-acting matching tool that can abstract high-quality templates from the training set to improve performance. The system built with this template is then launched to further accumulate real conversation sample data. After the template system goes online, it collects and analyzes existing customer communication data, including customer requests, support tickets, and chat logs, from logs generated by cloud products. Leveraging industry data, it directly collects log data generated by cloud products into the system's data platform, transforming customer-provided materials into data and knowledge. Step 2: Data cleaning and entity extraction, based on the extraction of contextual semantic features After the conversation sample data is collected, it needs to be cleaned up again. The process of building a knowledge graph based on text prompt words begins with natural language processing technology. First, entities and relationships are extracted from a large number of documents through text mining. These entities and relationships are identified and classified using named entity recognition and relationship extraction technologies. Then, a graph database is used to structure this information into nodes and edges, with nodes and edges corresponding to entities and relationships respectively, ultimately forming a knowledge graph. By continuously adding new data and relationships to expand and update, the raw data is processed by BERT to extract sentence structure features. The sequence information features are analyzed to connect and fuse the sentence structure features to improve intent recognition performance. Natural language processing algorithms are used to analyze the meaning of user speech, parse the syntactic structure, and recognize emotions. It can track the context of the conversation, including previous communication history and topic transitions, helping to more accurately capture user intent in long conversations or complex interactions. Step 3: Build a business graph with a directed graph structure based on semantic information and business information The retrieval technology proposed in this application relies on a very large vocabulary, where entities and relationships correspond to words. In this way, combined with the business logic information contained in the graph structure, entities and relationships can be jointly modeled as units during retrieval, thereby more accurately understanding the query intent and providing more precise search results. Through the reachable path inference algorithm, the entity relationship vector in the directed graph is used to calculate the target triplets and the paths from the target head node to the target tail node. The semantic distance of the paths is selected. The path with the largest semantic distance among all three paths is connected with the recurrent neural network output ht to form a vector S. Then, the vector S is processed nonlinearly to obtain the value of R(t|h): Where: Mt is the set of all nodes pointing to node t, OD(ei) is the outbound of node ei, and BW(eit) is the number of hops from the outbound of node ei to node t; therefore, for each node ei in Mt, the amount of resources t transferred from node ei to node ei is: Errors and noise in the knowledge may destroy the closed loop of the directed graph. To improve the fault tolerance of the model, it is assumed that each node has the same probability of jumping to a random node, and the random flow of this part of the resource t is 1 / N, where N is the total number of nodes; Step 4: Intent recognition based on user intent and semantic information Through reachable path reasoning, the entity relationship vector calculated in the directed graph is used to calculate the semantic features of the target triplet (h, r, t) and the path difference from the head node h to the tail node t. The semantic distance of the path is selected. The path with the largest semantic distance among all three paths is connected together with the neural network output to form a vector S. Then, the vector S is nonlinearly processed to obtain the value of RP((h, r, t)). The formula of RP((h, r, t)) is: The effectiveness of this method is highly relevant to intention recognition and its practical applications, where β is a nonlinear activation function, Wj and bj parameters can be trained during the modeling process, j∈{1, 2}, and the value range of RP((h,r,t)) is [0,1]. The closer the value is to 1, the higher the confidence level. CBMB=[Hjg,RP((h,r,t))] The above formula is a graph classification formula, where CBMB represents the concatenated business structure and semantic features. Knowledge graph-based retrieval enhancement technology constructs a graph model for knowledge representation, presenting the connections between entities and relationships in a graphical form. This optimizes the illusions present in the large language model retrieval process and makes the feedback information more aligned with business logic. P=softmax(Wf*CBMB+bf) The above formula is for intent classification, where Wf and bf are weight and bias terms, respectively, and P represents the intent classification. The softmax function is used to convert the output into a probability distribution. A knowledge graph is constructed using graph technology. By organizing and connecting information in a graphical format, the improved comprehensiveness provides users with more complex contextual information, helping large language models better understand the relationships between entities and improve their expression and reasoning capabilities. The accuracy of intent recognition and the effectiveness of responses are monitored in real time to evaluate the overall performance of the system. The system can use user feedback and interaction results to learn and optimize intent recognition models and response strategies. Through continuous learning and adjustment, the system can adapt to new user behaviors and conversation patterns, maintaining the advancement and effectiveness of its conversation processing capabilities. Step 5: Generate feedback based on the intent and prompts contained in the user data and send it back to the user. After processing the user's question, the system will produce a result that includes an understanding of the user's intent. Combining intent recognition and prompts, it reconstructs the content of the input large model, rapidly updating the conversation status and understanding of user intent. This query method can perform complex data analysis and decision support for customer relationship management, risk assessment, and market analysis. By querying the knowledge graph, enterprises can quickly obtain related information and discover hidden patterns and relationships, thereby improving business insights and decision-making efficiency. The results are subjected to entity disambiguation, and potential duplicates are removed through text embedding similarity and vocabulary distance. The generated output requires further processing to ensure that it complies with business logic and constraints. For non-deterministic output, a confidence threshold is required to determine whether it is a standard output. Finally, the system outputs the processed results to the user in a standardized format.

2. The method for generating accurate chat responses based on prompt word knowledge retrieval according to claim 1, characterized in that: The data cleaning described in step 2 needs to exclude non-critical information and minimize the impact of this information on the algorithm model. For corpus crawled from the web, HTML tags need to be removed; after the system imports the stop word list, it is converted into a list format. After the text is segmented, the words in the stop word list are removed to reduce the interference of meaningless words. Specific data is transformed to adapt to more scenarios, and common language misuse problems need to be addressed.

3. The method for generating accurate chat responses based on prompt word knowledge retrieval according to claim 1, characterized in that: The data cleaning described in step 2 includes data conversion. After data collection, it is necessary to process data in different formats, including PDF, Word, PPT, video, pictures and audio. In order to ensure the availability of the data, these diverse data formats need to be converted into standardized text data for subsequent processing.

4. The method for generating accurate chat responses based on prompt word knowledge retrieval according to claim 1, characterized in that: The entities described in step 2 need to be encoded with relationships. Time encoding rules: the standard time code format shall prevail. The specific format is: YYYY-MM-DD hh:mm:ss:ff, which represents year, month, day, hour, minute, second and frame value; entity encoding rules: it is necessary to extract the relational knowledge graph of the data group based on the temporal encoding rules, including the intention of target to target, the intention of target to group, the intention of group to target, and the intention of group to group. The encoding method of intention is the same as the order of target type, and their first order is used to encode the decimal starting from 0 and adding 1 in sequence.

5. The method for generating accurate chat responses based on prompt word knowledge retrieval according to claim 1, characterized in that: The construction of the knowledge graph described in step 2 is simply arranged in sequence by splitting the original document into an ordered list of nodes and the node relationships between them as a vocabulary graph.

6. The method for generating accurate chat responses based on prompt word knowledge retrieval according to claim 1, characterized in that: The intent recognition described in step 4 can be regarded as a classification problem. Given a user input sequence X = {x1, x2, ..., xn}, the goal is to map it to one of a predefined intent set I = {i1, i2, ..., im}, which involves constructing a mapping function f:X→I.

7. The method for generating accurate chat responses based on prompt word knowledge retrieval according to claim 1, characterized in that: As described in step 4, by constructing a graph model for knowledge representation, the connections between entities and relationships are displayed in the form of a graph, and then the large language model (LLM) is used for retrieval enhancement.

8. The method for generating accurate chat responses based on prompt word knowledge retrieval according to claim 1, characterized in that: The intent recognition model described in step 4 aims to address the problem that existing intent recognition models are prone to misidentifying domain entities and misclassifying questions in professional domain knowledge graph question answering. A joint intent recognition model combined with the domain knowledge graph is proposed. First, the ontology labels corresponding to the entities in the domain knowledge graph and the relationships between ontologies are imported into the training dataset to form a knowledge text containing ontology labels and a knowledge text graph containing additional ontology relationships; then, the knowledge text containing ontology labels is converted into an embedded representation through character-level embedding and position information embedding, and an entity relationship visual matrix is ​​created based on the knowledge text graph to clarify the relevance of each component of the knowledge text; finally, the embedded representation and the entity relationship visual matrix are input into the model encoding layer for model training.

9. The method for generating accurate chat responses based on prompt word knowledge retrieval according to claim 1, characterized in that: The feature formula extracted by the BERT network described in step 2 is: H jg =BERT(x t ) Where: x t is the original text, H jg Features extracted for the pre-trained BERT network.

10. A chat accurate response generation system based on prompt word knowledge retrieval, the system is used to implement the chat accurate response generation method according to any one of claims 1 to 9, characterized in that: include: Response system: Generates feedback information based on the intent and prompt words contained in the user data and sends it back to the user; The response system includes: Dialogue module: used to accumulate real dialogue sample data; Data collection module: responsible for collecting business data and conversation sample data; Data processing module: used to clean the collected data and extract entities using natural language processing technology; Business graph construction module: used to construct a business graph with a directed graph structure based on semantic information and business information; Intent recognition module: used to identify user intent and semantic information; Feedback generation and output module: used to generate feedback information based on the intent and prompt words contained in the user data.

Citation Information

Patent Citations

  • Prompt word optimization method and system based on large language model

    CN119047482A