Prompt word optimization method, system and equipment based on artificial intelligence and medium
By constructing a multi-source fusion knowledge graph and a hierarchical dialogue memory network, the problems of insufficient semantic understanding and inability to handle non-literal expressions in existing technologies are solved, achieving accurate understanding of users' deep meanings and personalized prompt word generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI SANQI JIYU NETWORK TECH CO LTD
- Filing Date
- 2025-12-25
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies are insufficient in terms of semantic understanding depth, interaction continuity and language diversity. They struggle to handle complex semantic structures, polysemous words and implicit user needs, lack maintenance and utilization of multi-turn dialogue contexts, and cannot dynamically access external knowledge bases, resulting in insufficient or outdated prompt word information.
We construct a multi-source fusion knowledge graph, combine it with a hierarchical dialogue memory network and a state machine model to perform semantic completion, deep intent parsing and candidate prompt word generation, and optimize the prompt word list through multi-constraint reasoning and personalized reordering.
It achieves a precise understanding of the user's deeper meaning and non-literal expression, generating personalized, coherent and insightful prompts, thus improving the accuracy and timeliness of the prompts.
Smart Images

Figure CN121996772A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence technology, and in particular relates to a method, system, device and medium for optimizing prompt words based on artificial intelligence. Background Technology
[0002] As the core medium for user interaction with search engines, intelligent assistants, and content generation tools, suggestion words directly impact the efficiency and experience of information retrieval. Traditional methods primarily rely on statistical language models and predefined rule engines, analyzing shallow features such as query frequency and co-occurrence relationships to provide basic relevance suggestions in simple and explicit scenarios. For example, when a user enters specific keywords, the system can generate conventional association or completion suggestions based on historical search data. However, with increasingly complex application scenarios and deepening user needs, these traditional technologies have revealed inherent limitations at several core levels.
[0003] First, in terms of semantic understanding depth, existing systems are primarily limited to processing literal meanings, struggling to analyze complex semantic structures, polysemous words, and implicit user needs. Their surface-level word matching mechanism is inadequate when encountering knowledge dependent on deep logic and context. Second, regarding interaction continuity, existing systems typically treat each user query as an independent event, lacking effective maintenance and utilization of multi-turn dialogue context. Third, in terms of the breadth and timeliness of knowledge utilization, most systems rely on closed, static local knowledge bases, unable to dynamically access and integrate external general knowledge bases or real-time updated vertical domain data, resulting in insufficient or outdated information in generated prompts. Finally, in terms of understanding linguistic diversity, existing technologies are helpless against non-literal expressions such as metaphors and exaggerations frequently used in daily communication. For example, when faced with a user expressing "I'm so hungry I could swallow a cow," the system cannot discern the underlying need for "finding a restaurant with large portions and high cost-performance," thus generating irrelevant prompts and rendering the interaction ineffective.
[0004] Therefore, there is an urgent need for a prompt word optimization technology to fundamentally address the challenges of complex interaction scenarios and achieve accurate, coherent, intelligent, and insightful prompt word generation and service. Summary of the Invention
[0005] This application provides an artificial intelligence-based prompt word optimization method, system, device, and medium, which can solve one of the above-mentioned problems in the prior art.
[0006] In a first aspect, embodiments of this application provide an artificial intelligence-based method for optimizing prompt words, including: Based on structured domain knowledge, common sense, and interactive data, a multi-source fusion knowledge graph is constructed. Maintain the session context and receive user queries. Combine the multi-source fusion knowledge graph to perform semantic completion and deep intent parsing on the user queries to obtain a complete semantic representation. Based on the complete semantic representation, and combined with the conditional generation model, multiple candidate prompt words are generated in parallel; The candidate prompt words are reordered in a personalized manner to generate an optimized prompt word list.
[0007] Furthermore, the construction of a multi-source fusion knowledge graph based on structured domain knowledge, common sense, and interactive data includes: Collect multi-source heterogeneous data from vertical domain databases, general commonsense graphs, and historical interaction logs; The multi-source heterogeneous data is subjected to entity disambiguation and attribute alignment, and multi-level relationship extraction is performed to construct an initial knowledge network containing attribute relationships, classification relationships, and scene relationships. By using entity linking technology, the domain entities in the vertical domain database are aligned with the concepts in the general common sense graph to generate background knowledge completion. By mining frequently co-occurring entity pairs and query patterns from the historical interaction logs, semantic association rules that reflect users' implicit needs are formed. The initial knowledge network, the background completion knowledge, and the semantic association rules are fused based on a graph neural network to generate a multi-source fused knowledge graph.
[0008] Furthermore, maintaining the session context includes: A hierarchical dialogue memory network is constructed, which includes a short-term memory layer, a medium-term memory layer, and a long-term memory layer. Based on the hierarchical dialogue memory network and the multi-source fusion knowledge graph, referential resolution is achieved through multi-constraint reasoning. The evolution of user intent in multi-turn dialogue is modeled and tracked based on the state machine model, and the current intent state and context continuation path are output.
[0009] Furthermore, the reference resolution through multi-constraint reasoning includes: An entity list is extracted from the short-term memory layer, and related entities are retrieved from the multi-source fusion knowledge graph to form a candidate entity set; Based on the focus tracking model, the focus heat score of each candidate entity in the candidate entity set is dynamically calculated; Based on the combined grammatical consistency, knowledge graph verification results, and focus popularity score, a comprehensive referential score is calculated for each candidate entity, and the candidate entity with the highest score is determined as the referential object.
[0010] Furthermore, the process of receiving a user query, combined with the multi-source fusion knowledge graph, performs semantic completion and deep intent parsing on the user query to obtain a complete semantic representation, including: Obtain the session context packet and the user's query statement, and perform joint encoding to generate complete query semantics; Based on the multi-source fusion knowledge graph, entity link disambiguation, semantic completion, and contextual information injection are performed on the user query statement to form a semantically enhanced query representation. The semantically enhanced query representation is parsed and slot filled using a deep parsing network to generate a deep semantic intent. The semantically enhanced query representation is subjected to non-literal expression recognition and conversion to generate standard semantic intent; Based on the complete query semantics, the deep semantic intent, and the standard semantic intent, a complete semantic representation is generated.
[0011] Furthermore, based on the complete semantic representation, and combined with the conditional generation model, multiple candidate prompt words are generated in parallel, including: Construct multiple parallel prompt word generation paths, each of which corresponds to a different knowledge source and generation strategy; For each of the aforementioned prompt words, a structured conditional prompt is constructed to generate a path, and the conditional signal of the corresponding knowledge source is encoded into a conditional vector; By using a dynamic gating fusion network, condition vectors from different prompt generation paths are weighted and fused to generate condition control signals. Based on the aforementioned conditional control signal, the pre-trained language model is driven to perform controllable parallel decoding, generating multiple candidate prompt words; The prompt word generation path includes at least: a knowledge framework extension path based on the multi-source fusion knowledge graph and the complete semantic representation; a path based on the current intent state and context continuation of the conversation context packet; an information injection path based on real-time external knowledge retrieval; and a creative inspiration path based on standard semantic intent.
[0012] Furthermore, the personalized reordering of the candidate prompt words to generate an optimized prompt word list includes: Based on the personalized fit prediction model, combined with real-time user profiles, current conversation preferences and metadata of candidate prompt words, the personalized adoption probability of each candidate prompt word is predicted; Based on the personalized adoption probability, the candidate prompt words are reordered to generate an optimized prompt word list.
[0013] Secondly, embodiments of this application provide an artificial intelligence-based prompt word optimization system, including: The first processing module is used to construct a multi-source fusion knowledge graph based on structured domain knowledge, common sense, and interactive data. The second processing module is used to maintain the session context and receive user queries. It combines the multi-source fusion knowledge graph to perform semantic completion and deep intent parsing on the user queries to obtain a complete semantic representation. The third processing module is used to generate multiple candidate prompt words in parallel based on the complete semantic representation and in combination with the conditional generation model. The fourth processing module is used to personalize and reorder the candidate prompt words to generate an optimized prompt word list.
[0014] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the aforementioned artificial intelligence-based prompt word optimization method.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium, including a computer program stored in the computer-readable storage medium, which, when executed by a processor, implements the aforementioned artificial intelligence-based prompt word optimization method.
[0016] The beneficial effects of the embodiments in this application compared with the prior art are: This application discloses an artificial intelligence-based prompt word optimization method. By constructing a multi-source fusion knowledge graph, this invention provides rich semantic relationships and common-sense background for prompt word generation. At the same time, the tracking and maintenance of multi-turn dialogue states provide accurate context, enabling precise semantic completion and deep intent analysis of user queries. Furthermore, it introduces the recognition and conversion of non-literal expressions, thereby accurately understanding the user's deeper meaning and non-literal expression intent, effectively solving the problems of "insufficient semantic understanding" and "helplessness in dealing with non-literal expressions" in the prior art. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating an artificial intelligence-based prompt word optimization method according to an embodiment of the present invention; Figure 2This is a schematic diagram of the structure of an artificial intelligence-based prompt word optimization system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0019] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0020] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0021] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0022] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0023] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0024] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0025] Please see Figure 1 As shown, this invention is an artificial intelligence-based suggestion word optimization method, which includes the following steps: S100: Construct a multi-source fusion knowledge graph based on structured domain knowledge, common sense, and interactive data; In some embodiments, step S100 above includes: Collect multi-source heterogeneous data from vertical domain databases, general commonsense graphs, and historical interaction logs; The multi-source heterogeneous data is subjected to entity disambiguation and attribute alignment, and multi-level relationship extraction is performed to construct an initial knowledge network containing attribute relationships, classification relationships, and scene relationships. By using entity linking technology, the domain entities in the vertical domain database are aligned with the concepts in the general common sense graph to generate background knowledge completion. By mining frequently co-occurring entity pairs and query patterns from the historical interaction logs, semantic association rules that reflect users' implicit needs are formed. The initial knowledge network, the background completion knowledge, and the semantic association rules are fused based on a graph neural network to generate a multi-source fused knowledge graph.
[0026] In this embodiment, a multi-source fusion knowledge graph that integrates domain depth, common sense breadth, and dynamic intelligence is constructed for subsequent in-depth understanding of the user's input query intent, providing rich semantic relationships and common sense background for the generation of prompt words.
[0027] In this embodiment, the collection of multi-source heterogeneous data is obtained from vertical domain databases, general common sense graphs, and historical interaction logs, which can achieve comprehensive knowledge coverage and a balance of depth.
[0028] Specifically, high-precision and timely domain knowledge is obtained from professional industry databases through authorized interfaces. Taking the catering industry as an example, detailed attributes (average spending per person, ratings, signature dishes), categories (cuisine, scene), and relationships (branch relationships, chef affiliation, location relationships) of restaurants are obtained from catering platforms. This allows the construction of a database vertical to the catering industry. In this vertical domain database, each restaurant is a domain entity, and the detailed attributes of the restaurant are domain entity attributes. Based on the categories and relationships, the associations between different restaurants are determined to form domain ontology data.
[0029] More specifically, the aforementioned vertical domain databases are integrated with large-scale general knowledge graphs such as Wikidata and CN-DBpedia to address the lack of common-sense background knowledge in domain knowledge. Specifically, entity linking technology is used to associate domain entities in the vertical domain data with common concepts in the general knowledge graph, and to import the common concepts from the general knowledge graph into the corresponding domain entities in the vertical domain database as background supplementary knowledge to compensate for the lack of common-sense and background knowledge in domain knowledge. For example, the "Michelin restaurant" entity in the vertical domain graph is linked to the concept "Q174903 (Michelin Guide)" in the general knowledge graph CN-DBpedia, thereby importing common-sense attributes such as "rating institution" and "historical background" from the CN-DBpedia graph into the corresponding "Michelin restaurant" entity. Thus, when generating prompts related to Michelin, "Michelin" is not merely a restaurant label, but also represents a specific rating system and cultural background, improving the accuracy of prompt generation.
[0030] In this embodiment, historical query data is extracted from users' historical interaction logs, such as search engine logs and intelligent dialogue records. This historical query data contains users' real demand patterns and language habits. Therefore, sequence pattern mining and relation extraction techniques can be used to discover and extract undefined, implicit semantic association rules. For example, a large number of logs show that users often mention "having a children's play area" after querying "family dinner". Implicit association edges between the "family dinner" scenario and the "children's facilities" attribute can be established in the knowledge graph, thereby enabling the final multi-source fusion knowledge graph to have personalized and contextual understanding capabilities.
[0031] Furthermore, for the same entity from different sources, a method based on vector similarity and rule verification is used for disambiguation and merging, assigning it a globally unique ID, and integrating attributes from all sources to form a "rich entity". Specifically, domain entities in the vertical domain database and general concepts in the general common sense graph are subjected to vector similarity calculation based on BERT entity embedding, and a similarity threshold is set. If the vector similarity is higher than the similarity threshold, it is initially determined that the two are the same entity. Then, it is further confirmed to be the same entity from preset matching rules such as address matching, phone number matching, and description similarity. For the confirmed same entity, duplicate information is removed, possible ambiguities are resolved, and a globally unique ID is assigned to the merged entity for subsequent management and querying. At the same time, attribute information from all sources is integrated to form a "rich entity" containing rich information. Taking the catering industry as an example, a "rich entity" may include multiple attributes such as entity name, address, phone number, description, rating, reviews, menu information, and business hours.
[0032] Furthermore, the disambiguated and merged multi-source heterogeneous data is used to construct a multi-level relational network, including attribute relations, classification relations, scene relations, mapping relations, and implicit semantic relations. Specifically, domain entities in the vertical domain database are set as entity nodes, and the detailed attributes corresponding to the domain entities are set as attribute nodes. Then, corresponding relational edges are constructed between the above types of nodes. Attribute relations correspond to attribute edges, representing the relationship between entity nodes and attribute nodes, such as Restaurant A - average cost per person -> 150 yuan; classification relations correspond to classification edges, representing the category relationship between entity nodes, such as Italian restaurant - subcategory -> Western restaurant; scene relations correspond to scene edges. The relationship between entity nodes and scenarios, time, and location is defined, such as Restaurant A - located in the Wangfujing business district, and Restaurant B - suitable for family gatherings. This constructs an initial knowledge network. In addition, the general concepts corresponding to the background knowledge are set as concept nodes, and mapping edges are set between concept nodes and entity nodes to correspond to the mapping relationship. Concept nodes are used to supplement the background knowledge of entity nodes. Semantic association rules obtained from historical interaction logs are set as implicit nodes, and then implicit edges are set to correspond to implicit semantic relationships, representing the implicit associations related to entity nodes mined from the interaction data, such as marriage proposal - implicit association -> Restaurant C. This constructs a multi-source fusion knowledge graph.
[0033] In some embodiments, fixed patterns are abstracted from multi-turn dialogues in the user's historical interaction logs to form a context-query template library, which serves as an appendix to the multi-source fusion knowledge graph to represent the graph's reasoning rules. For example, template A [user asks entity A] -> [then asks "its" + attribute B] can be directly used to guide referential resolution. These templates enable the multi-source fusion knowledge graph to have a structured understanding of user interaction data.
[0034] S200. Maintain the session context and receive user queries. Combine the multi-source fusion knowledge graph to perform semantic completion and deep intent parsing on the user queries to obtain a complete semantic representation. In some embodiments, maintaining the session context includes: A hierarchical dialogue memory network is constructed, which includes a short-term memory layer, a medium-term memory layer, and a long-term memory layer. Based on the hierarchical dialogue memory network and the multi-source fusion knowledge graph, referential resolution is achieved through multi-constraint reasoning. The evolution of user intent in multi-turn dialogue is modeled and tracked based on the state machine model, and the current intent state and context continuation path are output.
[0035] In this embodiment, a hierarchical dialogue memory network is constructed to manage dialogue information across different time spans, thereby maintaining the conversation context and enabling the tracking and maintenance of multi-turn dialogue states. This provides precise context. Specifically, the hierarchical dialogue memory network includes a short-term memory layer, a medium-term memory layer, and a long-term memory layer. The short-term memory layer stores the original dialogue text using a first-in-first-out (FIFO) cache queue, storing the original text sequence of the most recent N rounds (e.g., 3-5 rounds), i.e., user query statements and system response statements. The medium-term memory layer encodes the conversation topics and topic flows. A neural network encoder compresses and abstracts the data stored in the short-term memory layer to generate a conversation state vector. This conversation state vector encodes the core conversation topics, active topic flows, and a set of constraints, such as... In one embodiment, a user is looking for an Italian restaurant suitable for a family dinner. By recording data in the short-term memory layer, the core conversation topic of the current session can be determined as "planning a family dinner," with sub-topic flows of "cuisine → location → budget → special needs." The corresponding constraints are quantitative requirements of 200 yuan per person and a distance of 5 kilometers, and qualitative requirements of child-friendliness. The long-term memory layer is used to record the user's long-term interaction habits, which are associated with the user profile. It focuses on the user's interaction behavior patterns across sessions, specifically interaction habits and intent evolution patterns. For interaction habits, such as the context of the same entity, what kind of referential method does the user prefer to use, such as "it" or "this"? For intent evolution patterns, such as the user usually asks for "parking information" after selecting a restaurant.
[0036] In some embodiments, the reference resolution via multi-constraint reasoning includes: An entity list is extracted from the short-term memory layer, and related entities are retrieved from the multi-source fusion knowledge graph to form a candidate entity set; Based on the focus tracking model, the focus heat score of each candidate entity in the candidate entity set is dynamically calculated; Based on the combined grammatical consistency, knowledge graph verification results, and focus popularity score, a comprehensive referential score is calculated for each candidate entity, and the candidate entity with the highest score is determined as the referential object.
[0037] In this embodiment, when constructing a hierarchical dialogue memory network, it is necessary to perform reference resolution in order to understand the core of continuous dialogue. Specifically, the data stored in the short-term memory layer is combined with a multi-source fusion knowledge graph to perform reference resolution, thereby understanding the conversation topics and topic flows in the conversation context and storing them in the middle-level memory layer. At the same time, the reference habits of the same entity in each conversation are classified to generate corresponding interaction habits, which are stored in the long-term memory layer, which is beneficial for reference resolution in subsequent conversations.
[0038] Specifically, for designated pronouns such as "it," "this," and "this" in the conversation context, the most recently mentioned entities are retrieved from the short-term memory layer to generate an entity list. Extended entities with strong semantic associations with each entity in the entity list are retrieved from the multi-source fusion knowledge graph to generate a candidate entity set. The strong semantic associations are specifically related to the same semantics, similar competing products, the same location, part-whole relationships, etc. The referents are determined from the candidate entity set, and the words related to the entities in the conversation context are associated with the entity nodes in the multi-source fusion knowledge graph to improve the accuracy of subsequent prompt word optimization through the multi-source fusion knowledge graph.
[0039] Furthermore, for each candidate entity in the candidate entity set, focus tracking and popularity calculation are performed. Specifically, based on the N rounds of dialogue text in the short-term memory layer where the specified pronoun appears, a real-time changing focus popularity score is calculated for each candidate entity. This focus popularity score is measured by relevance, frequency, and topic centrality. Relevance is measured by introducing a time index to ensure the most recently mentioned entity has the highest popularity. Specifically, R(e) = (exp(-(t_current-t_e) / τ), where t_current represents the current timestamp, t_e represents the timestamp of the last mention of candidate entity e, and τ represents the time decay factor, which can be set to the average time span of the session or a fixed value. Frequency is measured by counting the total number of times the candidate entity appears in the session. Specifically, F(e) = count(e) / count(e`), where count(e) represents the total number of times candidate entity e appears in the N rounds of dialogue text, and count(e`) represents the number of times the candidate entity with the most occurrences appears. Understandably, e` represents the most frequently occurring candidate entity. Candidate entities; topic centrality is determined by calculating the semantic relevance between candidate entities and the core conversation topic. Specifically, C(e) = Sim(embed(e), embed(core_topic)), where Sim(·) represents the cosine similarity calculation formula, embed(·) represents encoding the candidate entity or core conversation topic into a vector, and core_topic represents the core conversation topic. Thus, the focus heat score is obtained as α×R(e) + β×F(e) + γ×C(e), where α, β, and γ represent weight coefficients, satisfying α+β+γ=1, used to adjust the contribution ratio of each dimension to the focus heat score. It is understandable that for a candidate entity set generated with strong semantic associations, when calculating the focus heat score, some candidate entities may have a recentity and frequency score of 0. Similarly, when using semantic relevance as the focus heat score, there may be cases where all dimensions of the focus heat score have a score of 0. For example, under the same location, there is a hotel A, whose semantic relevance to the core conversation topic "planning a family dinner" is 0. This achieves partial filtering of the candidate entity set.
[0040] In addition, each candidate entity needs to be screened based on grammatical consistency and knowledge graph verification results. For grammatical consistency, the singular / plural form, gender, etc., of specified pronouns are checked to see if they match the candidate entities. The grammatical attributes of specified pronouns, such as "it," "they," and "this," are analyzed. Possible grammatical attributes include singular / plural, masculine / feminine / neuter, animate, etc., and are compared with the corresponding attributes of the candidate entities. For example, the specified pronoun "they" requires the candidate entity to be in plural form, such as "those restaurants." A match is marked as 1, while a serious mismatch results in zero or negative scores, which can quickly eliminate obviously mismatched candidate entities. For knowledge graph verification, the grammatical properties of specified pronouns are analyzed. The knowledge graph verification results are obtained by judging whether the referential relationship of a specified pronoun in the sentence is consistent with the attributes or relationships in the multi-source fusion knowledge graph. For example, for the referential relationship "its rating", the referent "it" has the attribute "rating". Therefore, the corresponding attribute of the candidate entity needs to be verified in the multi-source fusion knowledge graph. For the candidate entity "restaurant", it has the attribute "rating" in the multi-source fusion knowledge graph, so the knowledge graph verification result is determined and marked as 1. However, for the candidate entity "weather", it is shown in the multi-source fusion knowledge graph that it does not have the attribute "rating", so its knowledge graph verification result is determined as 0. Finally, the grammatical consistency, knowledge graph verification results, and focus popularity scores are standardized and weighted to obtain a comprehensive referential score. The candidate entity with the highest comprehensive referential score is determined as the referent object and explicitly replaced in the current query for subsequent determination of various entities or specified pronouns in the topic flow of the intermediate memory layer.
[0041] Furthermore, for determining the topic flow in the intermediate memory layer, a state machine model is adopted. A multi-turn dialogue is treated as a dynamic intent realization process and tracked to determine its intent state and intent evolution history path as the topic flow, which is stored in the intermediate memory layer. Specifically, each dialogue is defined as an intent state, and each intent state represents a tuple, including intent type, target domain, core parameter slot, and state completion degree. Intent types include "information query", "comparison", "decision", etc.; target domains include "dining", "family dinner", "transportation", "travel", etc.; and core parameter slots are specific entity parameters in the conversation process, such as {restaurant type: Italian, location: Beijing, budget: 500}. At the same time, the transition mode between intent states is defined, specifically including refinement, transition, and merging. Understandably, refinement specifically refers to the refinement of the target domain. That is, the new query adds more specific constraints to the target domain. For example, the target domain is refined from "restaurant" to "quiet Italian restaurant". This is transformed into related sub-tasks under the same target domain. In other words, the new query is transformed into different sub-tasks under the same target domain, such as "find restaurant" to "find route to restaurant". Merging represents processing compound queries, such as "compare the advantages and disadvantages of A and B". Therefore, the state machine model continuously outputs the tuple of the current intent state and the transition path between query states. For example, [S1: find restaurant] -> [S2: refine (Italian food)] -> [S3: transition (find rating)]. This transition path is used as the context continuation path of the intent state to clearly depict the deepening process of the user's decision-making logic and provide a basis for generating prompts that conform to the development of the topic.
[0042] In some embodiments, receiving a user query, combined with the multi-source fusion knowledge graph, performs semantic completion and deep intent parsing on the user query to obtain a complete semantic representation, including: Obtain the session context packet and the user's query statement, and perform joint encoding to generate complete query semantics; Based on the multi-source fusion knowledge graph, entity link disambiguation, semantic completion, and contextual information injection are performed on the user query statement to form a semantically enhanced query representation. The semantically enhanced query representation is parsed and slot filled using a deep parsing network to generate a deep semantic intent. The semantically enhanced query representation is subjected to non-literal expression recognition and conversion to generate standard semantic intent; Based on the complete query semantics, the deep semantic intent, and the standard semantic intent, a complete semantic representation is generated.
[0043] In this embodiment, the session context package generated by maintaining the session context provides accurate context, enabling precise semantic completion and deep intent parsing of user queries. It also introduces the recognition and conversion of non-literal expressions, thereby accurately understanding the user's deeper meaning and non-literal expression intent, effectively solving the problems of "insufficient semantic understanding" and "helplessness in dealing with non-literal expressions" in the prior art.
[0044] Understandably, the session context package is the structured information output by maintaining the context in step S200 above. Specifically, it includes the resolved query, the list of focus entities, the current intent state, and the context continuation path. The resolved query is generated by deconstructing the query text in the session context to produce semantically clear query text. The list of focus entities consists of the entities that receive much attention in the session context and their popularity, which can be determined by the focus popularity score. The current intent state and the context continuation path correspond to the output results of the state machine model. Then, through a context fusion encoder, such as a neural network based on an attention mechanism, the above session context package and the user query statement are deeply fused and encoded to generate a complete query semantic that includes historical and current information.
[0045] Furthermore, based on a multi-source fusion knowledge graph, semantic information that users may omit or default is made explicit, forming a complete query representation. This includes entity link disambiguation, semantic completion, and contextual information injection. Entity link disambiguation involves linking entities mentioned in the user's query to the conversation topic, determining their corresponding entities in the multi-source fusion knowledge graph. For example, the entity "apple" mentioned in the query, combined with the conversation topic "choosing an Apple phone," indicates that it refers to the technology product "apple," not the fruit, laying a correct foundation for subsequent analysis. Attribute completion identifies semantic omissions in the query. For example, if the user's query is "recommend Michelin," then based on the multi-source fusion... In the knowledge graph, the "Michelin" node is used to obtain its associated mapping relationships and implicit semantic relationships to complete the query semantics. For example, by obtaining the definition of "Michelin" as a "restaurant rating system" and its common perception as "symbolizing high-end dining", the query can be completed as "recommend high-end restaurants rated by the Michelin Guide". For contextual information injection, the target domain of the current intent state is used as the context information. Attributes related to the context information are queried from the multi-source fusion knowledge graph and added as potential constraints to the semantic representation. For example, if the target domain is "family dinner", the association attributes of entity nodes related to "family dinner" in the multi-source fusion knowledge graph are queried, such as "whether there are child seats" and "whether it is suitable for multiple people".
[0046] Furthermore, the semantically enhanced query representation formed after entity link disambiguation, semantic completion, and contextual information injection is subjected to deep analysis to understand the user's real needs. Specifically, the deep analysis network adopts a shared encoder-multi-task decoder network architecture, including a shared encoder layer and a multi-task decoder layer. The shared encoder layer is based on pre-trained Transformer models such as BERT and RoBERTa, receives the semantically enhanced query representation, and generates a context-aware vector representation containing each word, which serves as the data foundation for deep analysis in the subsequent multi-task decoder layer. This ensures that different tasks share the same set of deep semantic features for understanding the text.
[0047] Specifically, the multi-task decoding layer includes at least a fine-grained intent classifier and a semantic slot filler, used for deep parsing of fine-grained intent classification and semantic slot filling of semantically enhanced query representations. Specifically, the fine-grained intent classifier adopts a structure of a fully connected neural network plus a softmax layer. The fully connected neural network consists of multiple neuron layers, with each neuron connected to all neurons in the previous layer. Its input is a context-aware vector representation of the shared encoding layer output. Feature extraction and transformation are performed through a series of linear transformations and non-linear activation functions. After feature extraction by the fully connected neural network, the output of the last layer is connected to the softmax layer. The softmax layer converts the output into a probability distribution. Each neuron corresponds to a preset fine-grained intent label, and the output value represents the probability that the input text belongs to that fine-grained intent label. The softmax layer calculates a probability value for each fine-grained intent label, and the sum of the probability values of all labels is 1. Finally, the label with the highest probability value is selected as the final fine-grained intent classification result.
[0048] It is worth noting that the preset fine-grained intent tags are determined in conjunction with the intent type of the current intent state in the complete query semantics. For example, in one embodiment, if a user inputs "Italian restaurant recommendation", the intent type in their intent state is information query. The setting of fine-grained intent tags is determined based on this intent type, including fine-grained query operation types such as Query-Recommend, Query-Compare-Attribute, and Query-Filter.
[0049] More specifically, the semantic slot filler is used to extract specific constraint parameters related to the semantically enhanced query representation. These specific constraint parameters include entities, attribute values, time, location, and quantity. Specifically, for each word vector in the context-aware vector representation output by the shared coding layer, the BIOES annotation system is used, and it is modeled as a sequence labeling model to predict the semantic slot label to which each word belongs.
[0050] It's worth noting that the BIOES annotation system is a commonly used annotation system in named entity recognition and semantic role labeling. The annotation format is specifically word-tag. Words include: B (Begin), indicating the beginning of a semantic slot; I (Inside), indicating the word is inside a semantic slot; O (Outside), indicating the word does not belong to any semantic slot; E (End), indicating the word ends in a semantic slot; and S (Single), indicating the word constitutes a semantic slot on its own. The tag represents the semantic slot corresponding to that word. Taking a user query for "recommend Italian restaurants in Beijing with an average price of around 150 RMB per person" as an example, assuming the word segmentation results in the sequence: ["recommend", "Beijing", "average price", "150", "around", "of", "Italian", "restaurant"], then the semantic slot filler can output the predicted semantic slot labels as ["O", "S-Location", "O", "B-PriceRange", "E-PriceRange", "O", "B-Cuisine", "E-Cuisine"]. Based on this prediction, the relevant specific constraint parameters can be obtained as {'Location': 'Beijing', 'PriceRange': 'around 150', 'Cuisine': 'Italian restaurant'}.
[0051] In some embodiments, the multi-task decoding layer also includes a sentiment label classifier, which analyzes the non-factual dimension of the semantically enhanced query representation and maps the context-aware vector representation to multiple non-exclusive labels, such as sentiment labels (positive, negative, eager, hesitant) and style labels (formal, casual, concise, detailed), for subsequent generation of context-appropriate prompts.
[0052] Furthermore, semantically enhanced query representation also includes the identification and conversion of non-literal expressions, thereby generating standard semantic intent. The identification employs a dual-channel mechanism based on rules and deep learning. Specifically, the rule channel matches common rhetorical phrases such as "like…" and "…to the point of being able to…", while the deep learning channel identifies potential non-literal expressions by analyzing syntactic anomalies and semantic conflicts, such as the exaggeration between "hungry" and "swallowing a cow". The identified non-literal expressions are then mapped to standard semantic intents that represent their true intents using a contrastive learning-based semantic mapping model. It's worth noting that this semantic mapping model is trained on a triplet dataset consisting of non-literal sentences, standard intent sentences, and negative sample sentences. Its core objective is to learn a mapping function that brings the semantic representation of non-literal sentences closer to the standard intent sentence corresponding to their true intent, while simultaneously distancing irrelevant negative sample sentences. For example, the semantic mapping model learns to map the vector of "hungry enough to swallow a cow" to the vicinity of the standard semantic vector of "finding a restaurant with large portions and high cost-performance ratio".
[0053] In this embodiment, the complete query semantics, deep semantic intent, and standard semantic intent are organized into a complete semantic representation, which may include core intent, semantic framework, sentiment metadata, context anchors, and non-literal processing results. The core intent is the user query target generated after semantic information completion, deep parsing, and non-literal expression transformation. The semantic framework is the set of all identified and completed entities, attributes, relationships, and constraints. The sentiment metadata is the sentiment tag corresponding to the user query. The context anchors are the current intent state and the intent evolution of the intent state to ensure traceability. The non-literal processing results record the original non-literal expression, transformation results, and confidence level for subsequent evaluation and feedback learning.
[0054] S300. Based on the complete semantic representation, and combined with the conditional generation model, multiple candidate prompt words are generated in parallel. In some embodiments, step S300 above includes: Construct multiple parallel prompt word generation paths, each of which corresponds to a different knowledge source and generation strategy; For each of the aforementioned prompt words, a structured conditional prompt is constructed to generate a path, and the conditional signal of the corresponding knowledge source is encoded into a conditional vector; By using a dynamic gating fusion network, condition vectors from different prompt generation paths are weighted and fused to generate condition control signals. Based on the aforementioned conditional control signal, the pre-trained language model is driven to perform controllable parallel decoding, generating multiple candidate prompt words; The prompt word generation path includes at least: a knowledge framework extension path based on the multi-source fusion knowledge graph and the complete semantic representation; a path based on the current intent state and context continuation of the conversation context packet; an information injection path based on real-time external knowledge retrieval; and a creative inspiration path based on standard semantic intent.
[0055] In this embodiment, the generation of candidate prompts is based on a complete semantic representation and employs a scalable multi-path generation mode to maximize the diversity, relevance, and creativity of candidate prompts. It also explores multiple expression variations under the same intent. Specifically, it uses a large-scale pre-trained language model, such as the GPT series or T5, as the base engine. This engine is fine-tuned and excels at understanding and executing conditional instructions in natural language form corresponding to different knowledge sources. Different conditional instructions correspond to different paths, including knowledge framework expansion paths, context continuation paths, information injection paths, and creative inspiration paths. The knowledge framework expansion path is based on the semantic framework in the complete semantic representation, from... The system uses a multi-source fusion knowledge graph to query information related to entities, attributes, relationships, and constraints within the semantic framework, generating corresponding candidate prompts. The context continuation path generates candidate prompts based on the current intent state and the context continuation path, ensuring a natural transition from the previous dialogue and helping users refine or deepen their current query. The information injection path retrieves the latest news, authoritative assessments, and niche knowledge related to the current user query in real time, using these as core materials for candidate prompt generation. The creative inspiration path uses the standard semantic intent output during non-literal recognition and conversion as creative seeds to generate candidate prompts.
[0056] Specifically, for the prompt template of the threshold parameter of each path, the conditional instructions of each path are converted into instructions that are easy to understand. For example, in one embodiment, the template of the knowledge framework extended path may be: "Based on the following facts: [semantic framework], and related knowledge: [multi-source fusion knowledge graph], please generate a query prompt for [core intent]". Furthermore, the conditional information of each path is converted into conditional vectors. For example, the conditional information of the knowledge framework extension path is the semantic framework and the multi-source fusion knowledge graph. The encoder converts them into conditional vectors, and then the conditional vectors of each path are input into the dynamic gating fusion network. The weights of the conditional vectors of each path are calculated in real time, and weighted fusion is performed to generate conditional control signals. This allows the pre-trained language model to be simultaneously influenced by multiple knowledge sources when performing controllable parallel decoding, thereby generating candidate prompt words.
[0057] In this embodiment, during the decoding process, the pre-trained language model initiates multiple parallel beam searches for multiple sampling decodings. At the same time, each decoding path shares the same conditions in the initial stage, while controllable randomness or guidance is introduced during the generation process to generate candidate prompt words with different expressions, perspectives, or emphases. Soft constraints are applied according to the characteristics of the path during the decoding process. In addition, after each candidate prompt word is generated, metadata is attached to it, including path identifiers and knowledge source information. The knowledge source information refers to the specific knowledge entities or attributes referenced in the candidate prompt word.
[0058] More specifically, in the gated fusion network, conversation scene information and real-time user profiles are encoded into scene feature vectors. These scene feature vectors are used as query vectors, and condition vectors from each generation path are used as key and value vectors. A multi-head attention mechanism is used to calculate the dynamic weights of the condition vectors for each generation path. Then, the condition vectors of each path are weighted and summed based on the calculated dynamic weights to generate a condition control signal. The conversation scene information includes conversation stage identification and topic focus stability assessment. Specifically, based on the context continuation path, it is identified whether the current stage is "early exploration," "information gathering," "comparison and screening," or "final decision-making." Different stages have different requirements for prompt word generation strategies. The topic focus stability assessment is determined by the degree of change of core entities / attributes in recent rounds of dialogue. The changes of core entities are determined from the focus entity list in the conversation context package. High stability means that the user's needs are clear, and the knowledge framework path should be prioritized; low stability may mean that the user is still exploring, and the creative inspiration path should be given higher weight. Furthermore, for real-time user profiles, which include short-term interest vectors and long-term interest vectors, it is understandable that short-term interest vectors are real-time preferences extracted based on the user's click, dwell, and query sequences in the current session, while long-term preference vectors are stable user interest features obtained from the long-term memory layer in the hierarchical dialogue memory network. Then, the above-mentioned session scenario information and real-time user profiles are encoded separately, and the encoding results are concatenated to generate a unified scenario feature vector.
[0059] In some embodiments, applying soft constraints based on path characteristics specifically includes: integrity constraints on knowledge framework paths, novelty guidance on creative inspiration paths, coherence checks on contextual continuity paths, and factual verification of external knowledge paths. Specifically, for candidate prompts generated by knowledge framework paths, named entity recognition tools are used to extract entities and match them with a list of focus entities. For example, in one embodiment, if core entities such as "Italian cuisine" or "Beijing" are not mentioned in the candidate prompts generated by knowledge framework paths, an entity injection step is triggered to integrate the core entity into the prompt in a natural way, such as correcting "recommend a high-end restaurant" to "recommend a high-end Italian restaurant in Beijing". For candidate prompts of creative inspiration paths, word frequency analysis is performed. For adjectives or phrases that appear too frequently in the common prompt word library, such as "best" or "good", a set of alternative word suggestions are provided from the thesaurus or through word vector nearest neighbor retrieval, such as replacing "best" with "top" or "first-rate", and selecting the replacement scheme that optimizes the overall lexical diversity index. For contextual continuation paths: Dependency parsing is used to check if candidate prompts contain appropriate logical connectors such as "in addition," "in comparison," and "especially," and whether the focus entity from the preceding dialogue appears. If logical breaks are found, appropriate connecting phrases can be added. For external knowledge paths: The claimed facts in candidate prompts are quickly extracted, and queries are initiated to the multi-source fusion knowledge graph for verification. If the record does not exist in the graph or a conflict exists, the candidate prompt's metadata is marked with a "to be verified" tag, and its weight is appropriately reduced in subsequent rankings, or a more precise query is triggered directly to obtain the latest information.
[0060] S400: Personalize and reorder the candidate prompt words to generate an optimized prompt word list.
[0061] In some embodiments, step S400 above includes: Based on the personalized fit prediction model, combined with real-time user profiles, current conversation preferences and metadata of candidate prompt words, the personalized adoption probability of each candidate prompt word is predicted; Based on the personalized adoption probability, the candidate prompt words are reordered to generate an optimized prompt word list.
[0062] In this embodiment, the personalized fit prediction model receives dynamic signals from multiple sources, specifically real-time user profiles, current conversation preferences, and metadata attached when generating each candidate prompt word in step S300. It employs a deep neural network, using the aforementioned dynamic signals as input features, and ultimately outputs a personalized adoption score. It is understood that this personalized fit prediction model is trained on a large amount of historical interaction data and can learn complex, non-linear personal preference patterns. In addition, the current conversation preference includes fine-grained intent classification, sentiment tags, and conversation scenario information for the current query.
[0063] Specifically, the real-time user profile vector, current session preference vector, and metadata vectors of each candidate suggestion word are concatenated or fused to construct the input feature matrix of the personalized fit prediction model. This constructed input feature matrix is then fed into the input layer of a deep neural network. The number of neurons in the input layer is the same as the number of columns in the input feature matrix. Multiple fully connected hidden layers are used, each containing a certain number of neurons. The input features undergo linear transformations and non-linear activations in the hidden layers, gradually extracting higher-level features. For example, the first hidden layer might map the input features from the original low-level feature space to an intermediate feature space. The second hidden layer further transforms and extracts more abstract features within this intermediate feature space. The output layer has only one neuron, outputting a personalized adoption score. A sigmoid activation function is used to map the output value to the (0,1) interval, representing the probability that a candidate suggestion word will be adopted by the user. Finally, the candidate suggestions words are reordered based on this personalized adoption probability to generate an optimized suggestion word list for the user to choose from.
[0064] Please see Figure 2 As shown, the present invention also provides an artificial intelligence-based prompt word optimization system, the system comprising: First processing module 201: used to construct a multi-source fusion knowledge graph based on structured domain knowledge, common sense, and interactive data; The second processing module 202 is used to maintain the session context and receive user queries. It combines the multi-source fusion knowledge graph to perform semantic completion and deep intent parsing on the user queries to obtain a complete semantic representation. The third processing module 203 is used to generate multiple candidate prompt words in parallel based on the complete semantic representation and in combination with the conditional generation model. The fourth processing module 204 is used to personalize and reorder the candidate prompt words to generate an optimized prompt word list.
[0065] It is understandable that, such as Figure 1The content of the AI-based prompt word optimization method embodiments shown herein is applicable to the AI-based prompt word optimization system embodiments. The specific functions implemented by the AI-based prompt word optimization system embodiments are the same as those shown below. Figure 1 The illustrated AI-based prompt word optimization method is the same as the one shown, and achieves the same beneficial effects. Figure 1 The beneficial effects achieved by the AI-based prompt word optimization method shown in the embodiment are the same.
[0066] It should be noted that the information interaction and execution process between the above systems are based on the same concept as the method embodiments of the present invention. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0067] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0068] Please see Figure 3 As shown, this embodiment of the invention also provides a computer device 3, including: a memory 302 and a processor 301, and a computer program 303 stored on the memory 302. When the computer program 303 is executed on the processor 301, it implements the artificial intelligence-based prompt word optimization method as described in any of the above methods.
[0069] The computer device 3 may be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will understand that... Figure 3 The computer device 3 is merely an example and does not constitute a limitation on the computer device 3. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0070] The processor 301 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0071] In some embodiments, the memory 302 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 302 may be an external storage device of the computer device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 3. Furthermore, the memory 302 may include both internal and external storage units of the computer device 3. The memory 302 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 302 can also be used to temporarily store data that has been output or will be output.
[0072] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the AI-based prompt word optimization method as described in any of the above methods.
[0073] In this embodiment, if the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, 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 computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / computer device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0074] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A suggestion word optimization method based on artificial intelligence, characterized in that, include: Based on structured domain knowledge, common sense, and interactive data, a multi-source fusion knowledge graph is constructed. Maintain the session context and receive user queries. Combine the multi-source fusion knowledge graph to perform semantic completion and deep intent parsing on the user queries to obtain a complete semantic representation. Based on the complete semantic representation, and combined with the conditional generation model, multiple candidate prompt words are generated in parallel; The candidate prompt words are reordered in a personalized manner to generate an optimized prompt word list.
2. The method as described in claim 1, characterized in that, The construction of a multi-source fusion knowledge graph based on structured domain knowledge, common sense, and interactive data includes: Collect multi-source heterogeneous data from vertical domain databases, general commonsense graphs, and historical interaction logs; The multi-source heterogeneous data is subjected to entity disambiguation and attribute alignment, and multi-level relationship extraction is performed to construct an initial knowledge network containing attribute relationships, classification relationships, and scene relationships. By using entity linking technology, the domain entities in the vertical domain database are aligned with the concepts in the general common sense graph to generate background knowledge completion. By mining frequently co-occurring entity pairs and query patterns from the historical interaction logs, semantic association rules that reflect users' implicit needs are formed. The initial knowledge network, the background completion knowledge, and the semantic association rules are fused based on a graph neural network to generate a multi-source fused knowledge graph.
3. The method as described in claim 1, characterized in that, The maintenance of the session context includes: A hierarchical dialogue memory network is constructed, which includes a short-term memory layer, a medium-term memory layer, and a long-term memory layer. Based on the hierarchical dialogue memory network and the multi-source fusion knowledge graph, referential resolution is achieved through multi-constraint reasoning. The evolution of user intent in multi-turn dialogue is modeled and tracked based on the state machine model, and the current intent state and context continuation path are output.
4. The method as described in claim 3, characterized in that, The method of resolving references through multi-constraint reasoning includes: An entity list is extracted from the short-term memory layer, and related entities are retrieved from the multi-source fusion knowledge graph to form a candidate entity set; Based on the focus tracking model, the focus heat score of each candidate entity in the candidate entity set is dynamically calculated; Based on the combined grammatical consistency, knowledge graph verification results, and focus popularity score, a comprehensive referential score is calculated for each candidate entity, and the candidate entity with the highest score is determined as the referential object.
5. The method as described in claim 1, characterized in that, The process of receiving a user query, combined with the multi-source fusion knowledge graph, involves semantic completion and deep intent parsing of the user query to obtain a complete semantic representation, including: Obtain the session context packet and the user's query statement, and perform joint encoding to generate complete query semantics; Based on the multi-source fusion knowledge graph, entity link disambiguation, semantic completion, and contextual information injection are performed on the user query statement to form a semantically enhanced query representation. The semantically enhanced query representation is parsed and slot filled using a deep parsing network to generate a deep semantic intent. The semantically enhanced query representation is subjected to non-literal expression recognition and conversion to generate standard semantic intent; Based on the complete query semantics, the deep semantic intent, and the standard semantic intent, a complete semantic representation is generated.
6. The method as described in claim 1, characterized in that, Based on the complete semantic representation, and combined with a conditional generation model, multiple candidate prompt words are generated in parallel, including: Construct multiple parallel prompt word generation paths, each of which corresponds to a different knowledge source and generation strategy; For each of the aforementioned prompt words, a structured conditional prompt is constructed to generate a path, and the conditional signal of the corresponding knowledge source is encoded into a conditional vector; By using a dynamic gating fusion network, condition vectors from different prompt generation paths are weighted and fused to generate condition control signals. Based on the aforementioned conditional control signal, the pre-trained language model is driven to perform controllable parallel decoding, generating multiple candidate prompt words; The prompt word generation path includes at least: a knowledge framework extension path based on the multi-source fusion knowledge graph and the complete semantic representation; a path based on the current intent state and context continuation of the conversation context packet; an information injection path based on real-time external knowledge retrieval; and a creative inspiration path based on standard semantic intent.
7. The method as described in claim 1, characterized in that, The step of personalized reordering of the candidate prompt words to generate an optimized prompt word list includes: Based on the personalized fit prediction model, combined with real-time user profiles, current conversation preferences and metadata of candidate prompt words, the personalized adoption probability of each candidate prompt word is predicted; Based on the personalized adoption probability, the candidate prompt words are reordered to generate an optimized prompt word list.
8. A prompt word optimization system based on artificial intelligence, characterized in that, include: The first processing module is used to construct a multi-source fusion knowledge graph based on structured domain knowledge, common sense, and interactive data. The second processing module is used to maintain the session context and receive user queries. It combines the multi-source fusion knowledge graph to perform semantic completion and deep intent parsing on the user queries to obtain a complete semantic representation. The third processing module is used to generate multiple candidate prompt words in parallel based on the complete semantic representation and in combination with the conditional generation model. The fourth processing module is used to personalize and reorder the candidate prompt words to generate an optimized prompt word list.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.