User input text completion method and device, electronic equipment and storage medium

By acquiring the user's target context data, performing intent parsing and structured processing, and using knowledge graphs and large language models to generate completion information, the problem of poor accuracy in user input text completion technology is solved, and more accurate completion results are achieved.

CN122064797APending Publication Date: 2026-05-19CHINA MOBILE ONLINE SERVICES CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE ONLINE SERVICES CO LTD
Filing Date
2025-12-25
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing user input text completion technologies struggle to accurately capture users' true intentions when faced with new word combinations, complex semantic structures, and highly colloquial expressions, resulting in poor completion accuracy.

Method used

By acquiring the user's target context data, performing intent parsing and structuring, generating completion information using a pre-set knowledge graph and a trained large language model, and combining user profiles and historical data, a completion result that conforms to business rules and semantic logic is generated.

Benefits of technology

It improves the accuracy of the completion results, covers a wider range of recommendation scenarios, meets the real needs of users, and avoids the limitations of understanding single dialogue fragments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122064797A_ABST
    Figure CN122064797A_ABST
Patent Text Reader

Abstract

The invention discloses a user input text completion method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining target context data of a user under the condition that a to-be-complemented text input by the user in a current session is received; the target context data comprises portrait data of the user; performing intention analysis based on the target context data and the to-be-complemented text to obtain intention distribution information, and generating a structured result based on the intention distribution information and the to-be-complemented text; performing association reasoning based on the structured result, determining a target business entity in second business entities of a preset knowledge graph, and generating first completion information through a trained large language model based on the structured result and the target business entity; and generating a completion result of the to-be-completed text based on the target service entity and the first completion information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence technology, specifically relating to a method, apparatus, electronic device, and storage medium for user input text completion. Background Technology

[0002] In intelligent customer service scenarios, real-time suggestion and completion of user input are core elements for improving service efficiency, user experience, and business conversion. When users inquire about services through applications (APPs), official accounts, mini-programs, and other terminals, the ability to quickly obtain accurate input suggestions directly determines the speed of problem resolution, customer service communication costs, and the effectiveness of business recommendations.

[0003] When faced with newly emerging word combinations, complex semantic structures, highly colloquial expressions, and domain-specific terminology, relevant user input text completion technologies, based on historical data statistics, sequence pattern learning, or static semantic retrieval methods, struggle to accurately capture and understand the user's true intent, resulting in discrepancies between suggested words and the user's actual needs.

[0004] In other words, the relevant user input text completion technology has the problem of poor accuracy in the completion results. Summary of the Invention

[0005] This application provides a user input text completion method, apparatus, electronic device, and storage medium, which can solve the problem of poor accuracy of completion results in related user input text completion technologies.

[0006] In a first aspect, embodiments of this application provide a method for user input text completion, the method comprising: upon receiving text to be completed input by a user in the current session, obtaining target context data of the user; wherein the target context data includes user profile data; performing intent parsing based on the target context data and the text to be completed to obtain intent distribution information, and generating a structured result based on the intent distribution information and the text to be completed; wherein the intent distribution information includes one or more of the user's inquiry intent scenario, a first business entity related to the current session, and the user's intent action toward the first business entity; performing association reasoning based on the structured result to determine a target business entity in a second business entity of a preset knowledge graph, and generating first completion information based on the structured result and the target business entity through a trained large language model; and generating the completion result of the text to be completed based on the target business entity and the first completion information.

[0007] Secondly, embodiments of this application provide a user input text completion device, the device comprising: an acquisition module, configured to acquire target context data of the user upon receiving text to be completed input by the user in the current session; wherein the target context data includes the user's profile data; a parsing module, configured to perform intent parsing based on the target context data and the text to be completed, obtain intent distribution information, and generate a structured result based on the intent distribution information and the text to be completed; wherein the intent distribution information includes one or more of the user's inquiry intent scenario, a first business entity related to the current session, and the user's intent action towards the first business entity; a reasoning module, configured to perform association reasoning based on the structured result, determine a target business entity in a second business entity of a preset knowledge graph, and generate first completion information based on the structured result and the target business entity through a trained large language model; and a generation module, configured to generate the completion result of the text to be completed based on the target business entity and the first completion information.

[0008] Thirdly, embodiments of this application provide an electronic device comprising: a processor; and a memory arranged to store computer-executable instructions configured to be executed by the processor, the executable instructions including instructions for performing the user input text completion method as described in the first aspect.

[0009] Fourthly, embodiments of this application provide a storage medium for storing computer-executable instructions that cause a computer to perform the user input text completion method as described in the first aspect.

[0010] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the user input text completion method as described in the first aspect.

[0011] In a sixth aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the user input text completion method as described in the first aspect.

[0012] In this embodiment, upon receiving text to be completed input by a user in the current session, target context data of the user is obtained; wherein, the target context data includes the user's profile data; based on the target context data and the text to be completed, intent parsing is performed to obtain intent distribution information, and based on the intent distribution information and the text to be completed, a structured result is generated; wherein, the intent distribution information includes one or more of the user's inquiry intent scenario, a first business entity related to the current session, and the user's intent action towards the first business entity; based on the structured result, association reasoning is performed to determine a target business entity in a second business entity of a preset knowledge graph, and based on the structured result and the target business entity, first completion information is generated through a trained large language model; based on the target business entity and the first completion information, the completion result of the text to be completed is generated. Compared to existing user input text completion technologies, this application combines the text to be completed with the user's target context data for intent analysis, avoiding the limitations of understanding single dialogue fragments. The intent analysis results are more consistent with the user's true intent. Furthermore, by collaboratively utilizing the generation capabilities of structured knowledge graphs and trained large language models, it can generate completion results that conform to business rules and semantic logic, and the completion results cover a wider range of recommendation scenarios. Consequently, the completion results are more in line with the user's actual needs, i.e., the completion results are more accurate. This solves the problem of poor accuracy in existing user input text completion technologies. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating a user input text completion method provided in an embodiment of this application; Figure 2 A flowchart illustrating another user input text completion method provided in this application embodiment; Figure 3 This is a schematic diagram of the structure of a user input text completion device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0016] The user input text completion method, apparatus, electronic device, and storage medium provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0017] Figure 1 This illustration shows a user input text completion method according to an embodiment of the present invention. The method can be executed by an electronic device, which may include a server and / or a terminal device, wherein the terminal device may be, for example, an in-vehicle terminal or a mobile phone terminal. The method includes the following steps: S102: Upon receiving the text to be completed entered by the user in the current session, obtain the user's target context data.

[0018] The target context data includes user profile data.

[0019] In practical applications, users can access online customer service through apps, mini-programs, or official accounts on their terminal devices, or through web pages on servers, and input the text to be completed in the current online customer service session. For example, when the user inputs ≥2 characters in the current session, such as "no data traffic", a real-time capture mechanism can be triggered, and the electronic device in this embodiment can obtain the text to be completed, that is, receive the text to be completed input by the user in the current session.

[0020] The user profile data may include, but is not limited to, one or more of user tags and preferred services; both user tags and preferred services can be one or more. For example, user tags can be ["high consumption", "frequent complaints"]. Preferred services can be ["international roaming"].

[0021] In addition, user profile data can be dynamically updated based on user behavior data.

[0022] S104: Based on the target context data and the text to be completed, perform intent parsing to obtain intent distribution information, and generate structured results based on the intent distribution information and the text to be completed.

[0023] The intent distribution information includes one or more of the user's intent scenario, the first business entity related to the current session, and the user's intent action toward the first business entity.

[0024] In practical applications, target context data, text to be completed, user identity code (ID), and current session ID can be integrated into structured data for intent parsing.

[0025] The intent scenario for user inquiries can be a predefined set of business scenarios, such as package complaints, business processing, troubleshooting, and bill inquiries.

[0026] The first business entity related to the current session can be a specific business object mentioned in the current session, such as a 5G data package or a domestic voice package.

[0027] The user's intended action for the first business entity can take values ​​including but not limited to processing, changing, canceling, and querying.

[0028] The structured result can include intent distribution information and the text to be completed. Additionally, error correction can be performed on the text to be completed to obtain the corrected text; correspondingly, the structured result can include intent distribution information and the corrected text to be completed.

[0029] S106: Based on the structured results, perform associative reasoning, determine the target business entity in the second business entity of the preset knowledge graph, and generate the first completion information based on the structured results and the target business entity through the trained large language model.

[0030] The target business entity can be a preset number of second business entities associated with the first business entity and / or associated with the corrected text to be completed; the target business entity can also be a preset number of second business entities associated with the first business entity and / or associated with the text to be completed.

[0031] Specifically, the first business entity in the structured result, as well as the text to be completed or corrected, can be mapped to a second business entity in the knowledge graph, serving as the query entity. Starting from the query entity, a path query is performed in the knowledge graph based on a preset number of hops to obtain candidate second business entities associated with the query entity. These candidate second business entities are those within the preset number of hops of the query entity on the path. The candidate second business entities are then deduplicated to obtain deduplicated candidate second business entities. Next, the weight of the path from each deduplicated candidate second business entity to the corresponding query entity is calculated, and the deduplicated candidate second business entities are sorted in descending order based on this weight. Finally, the top M candidate second business entities from the sorted deduplicated candidate second business entities are selected as the target business entities, where M is a preset number. The preset number of hops, such as 1 hop or 2 hops, is not specifically limited.

[0032] The nodes in the knowledge graph can contain second business entities and user profile tags, with relationships including but not limited to: business dependencies and semantic associations. Business dependencies, such as "5G package" - matching → "5G phone", and semantic associations, such as "insufficient data" - solution → "add-on package".

[0033] For example, based on the text to be completed or the text to be completed after correction in the structured result, association reasoning is performed to determine the target business entity in the second business entity of the preset knowledge graph, as shown in Table 1 below: Table 1

[0034] It should be noted that the weights of the text to be completed or the corrected text to be completed, the target business entity, and the path mentioned above are for ease of understanding only and do not constitute specific limitations.

[0035] The trained large language model can be a domain-based fine-tuned Qwen3-0.6B model, without specific limitations. Specifically, a defined target business entity can be used as a related business constraint to guide the trained large language model in generating first-stage completion information that conforms to the business logic.

[0036] For example, if the structured information includes the text to be completed, intent distribution information, and preferred business information from the profile data, then the following templated prompts can be used accordingly: prompt=f""" Task: Based on the text to be completed and intent distribution information, generate three completion suggestions that conform to the operator's business logic.

[0037] Intent distribution information: {context_state} (i.e., one or more of the user's intent scenario, the first business entity related to the current session, and the user's intent action on the first business entity). Text to be completed: {input_text} Related business constraints: {r_kg} (i.e., the target business entity), the first completed information generated must include or be associated with the business corresponding to the target business entity; Preference business: {P}, the first completed information generated must match the user's historical preferences; Output requirements: 1. The first completed information generated needs to address the direct requirements of {input_text}, such as "Insufficient traffic" which needs to be related to the requirement of "insufficient traffic"; 2. Each first completion message should be a complete short sentence, which can be 5 to 15 characters long, in line with customer service interaction scenarios; 3. Avoid duplication; each initial completion should cover different business areas, such as inquiry, processing, and complaint. Thus, the trained large language model complements the knowledge graph reasoning semantically and structurally, making up for the knowledge graph's insufficient coverage of unstructured semantics and generating first-order completion information that is more in line with the user's input context.

[0038] It should be noted that the above prompts are for ease of understanding only and do not constitute any specific limitation.

[0039] Confidence of the first completion information generated by the trained large language model Lexical units output by the trained large language model The probability is calculated using the following formula (1): (1) in, To complete the first piece of information of quantity, For the first indivual , Output for the trained large language model The conditional probability; The value ranges from [0,1]. A higher confidence value indicates that the trained large language model has a stronger certainty about the generated results.

[0040] Following the example above, the first completion information and confidence scores generated by the trained large language model corresponding to the above prompt words are shown in Table 2 below: Table 2

[0041] It should be noted that the above-mentioned text to be completed, intent distribution information, preferred business, first completion information and confidence level are for ease of understanding only and do not constitute specific limitations.

[0042] S108: Based on the target business entity and the first completion information, generate the completion result of the text to be completed.

[0043] Optionally, the target business entity and the first completion information can be directly used as the completion result of the text to be completed; alternatively, candidate completion results can be generated based on the target business entity and the first completion information, and one or more of the following can be evaluated: semantic relevance, timeliness, personalization, and business value, to obtain an evaluation score; then, based on the user tags in the profile data and whether the current session is the user's first session, the target business entity and the first completion information in the candidate completion results are adjusted to obtain the adjusted second weight, and based on the evaluation score and the adjusted second weight, the target business entity and the first completion information in the candidate completion results are reordered to generate the completion result; the specific process is as described in steps D3 to D4 below.

[0044] The user input text completion method provided in this invention involves obtaining the user's target context data upon receiving the text to be completed input by the user in the current session; wherein the target context data includes the user's profile data; performing intent parsing based on the target context data and the text to be completed to obtain intent distribution information, and generating a structured result based on the intent distribution information and the text to be completed; wherein the intent distribution information includes one or more of the user's inquiry intent scenario, a first business entity related to the current session, and the user's intent action towards the first business entity; performing association reasoning based on the structured result to determine the target business entity in the second business entity of a preset knowledge graph, and generating first completion information based on the structured result and the target business entity through a trained large language model; and generating the completion result of the text to be completed based on the target business entity and the first completion information. Compared to existing user input text completion technologies, this application combines the text to be completed with the user's target context data for intent analysis, avoiding the limitations of understanding single dialogue fragments. The intent analysis results are more consistent with the user's true intent. Furthermore, by collaboratively utilizing the generation capabilities of structured knowledge graphs and trained large language models, it can generate completion results that conform to business rules and semantic logic, and the completion results cover a wider range of recommendation scenarios. Consequently, the completion results are more in line with the user's actual needs, i.e., the completion results are more accurate. This solves the problem of poor accuracy in existing user input text completion technologies.

[0045] In one implementation, obtaining the user's target context data (i.e., S102) can be achieved by performing the following steps A1 to A3: Step A1: Determine whether the current session is the user's first session.

[0046] In practical applications, the system can obtain the user's previous session and its timestamp. Then, based on the current session's timestamp, a preset time window threshold, and whether the user's previous session and its timestamp are available, it can determine whether the current session is the user's first session. Specifically, if the user's previous session and its timestamp do not exist, or if the time difference between the current session's timestamp and the previous session's timestamp is greater than the preset time window threshold, then the current session can be considered the user's first session. If the user's previous session and its timestamp exist, and the time difference between the current session's timestamp and the previous session's timestamp is less than or equal to the preset time window threshold, then the current session can be considered not the user's first session. The preset time window threshold can be 2 hours, etc., and is not specifically limited thereto.

[0047] Step A2: If yes, then obtain the user's first context data.

[0048] The first context data also includes one or more of the user's browsing behavior data prior to the current session and the user's historical ticket data.

[0049] Specifically, browsing behavior data refers to the user's browsing history on pages such as apps, mini-programs, and official accounts, such as "data plan page → 5G phone details page". Browsing behavior data can include the page name and dwell time for each record. Historical ticket data is a collection of service or complaint requests submitted by the user in the past; for example, a ticket titled "Complaint about exceeding data plan without reminder".

[0050] Step A3: If not, obtain the user's second context data.

[0051] The second context data also includes a dialogue sequence of the user's past conversations; the dialogue sequence includes the user's input statements and the corresponding customer service responses.

[0052] Additionally, an interaction scenario identifier can be set for the current session. The value of the corresponding interaction scenario identifier is determined based on whether the current session is the user's first session. Then, based on the value of the interaction scenario identifier, the target context data corresponding to that value is obtained. The target context data includes either first context data or second context data; both the first and second context data include the user's profile data.

[0053] For example, if the current session is the user's first session, the interaction scenario identifier S is determined. C If the value is 0, then the user's first context data is obtained. The first context data includes one or more of the user's profile data, the user's browsing behavior data before the current session, and the user's historical work order data. If the current session is not the user's first session (i.e., a multi-round interaction session), then the interaction scenario identifier S is determined. C If the value is 1, then the user's second context data is retrieved. This second context data includes the user's profile data and the dialogue sequence of the user's previous conversations. Of course, to ensure the validity of the second context data, it can include the user's profile data and the dialogue sequence within a preset time range preceding the current conversation. It should be noted that the above example is for ease of understanding only and does not impose specific limitations on the value of the interaction scenario identifier.

[0054] In this embodiment, different contextual data are obtained based on whether the current session is the user's first conversation. Intent parsing is then performed based on this data, achieving dynamic intent perception and a deep understanding of contextual semantics. Furthermore, by effectively integrating and utilizing the rich contextual information contained in multi-turn dialogue history, the associative recommendation enhances contextual relevance and can flexibly adjust recommendation strategies according to the immediate context, thereby dynamically adapting to semantic changes and specific user needs during the dialogue's evolution.

[0055] In one implementation, intent parsing is performed based on the target context data and the text to be completed to obtain intent distribution information (i.e., S104), and the following steps B1 to B3 can be executed: Step B1: Based on the target context data, semantic abstraction is performed using the trained large language model to obtain multiple structured dialogue state vectors.

[0056] The dialogue state vector includes one or more of the following: the user's candidate intent scenario for consultation, the candidate business entity related to the current session, the user's intent action for the candidate business entity, the user's intent slot information, and the question information to be confirmed.

[0057] Intent slot information refers to the specific needs or problems explicitly expressed by the user. It is a list of slot-value pairs, such as "Traffic Status": "Insufficient", "Network Problem": "Slow Internet Speed", etc.

[0058] Information to be confirmed: Information that needs further confirmation, such as "whether the speed reduction is due to reaching the target volume" and "whether a temporary speed increase is needed".

[0059] In practical applications, before performing semantic abstraction processing through a trained large language model, the target context data can be cleaned and standardized first. Exemplarily, taking the cleaning and standardization processing of the second context data as an example, the specific operations can include: filtering out meaningless words in the second context data based on a preset stop word list; wherein, the preset stop word list combines a general stop word list and operator business-specific stop words, such as meaningless semantic words like "Hello", "Please", "Oh", etc.; removing non-semantic symbols contained in the second context data, including but not limited to punctuation marks, emojis, Uniform Resource Locator (URL) links, and garbled characters; for punctuation marks such as ",", "、", "?", retain only the pure text content.

[0060] Next, input the cleaned and standardized target context data and the preset prompt into the trained large language model. The trained large language model performs semantic abstraction processing on the cleaned and standardized target context data to convert the unstructured target context data after cleaning and standardization into a structured dialogue state vector that can be understood by the machine. Exemplarily, the preset prompt can be as follows: prompt=f""" Please extract the core information based on the following conversation content.

[0061] Target context data after cleaning and standardization: {context_clean} Please extract the key information, including the intention scenario of the current user's consultation, the candidate business entities related to the current conversation, the intention actions of the user towards the candidate business entities, the intention slot information of the user, and the information of the待确认问题 (to-be-confirmed question).

[0062] The output format example is as follows: [Intention scenario: Package complaint; Candidate business entities: [Data package]; Intention actions: [Cancel]; Intention slot information: [Data: Insufficient, Network problem: Slow network speed]; Information of待确认问题 (to-be-confirmed question): Whether there is speed throttling when the data volume is reached]""" Step B2, by calculating the similarity between the second business entity and the candidate business entity in the knowledge graph, determine the first business entity among the second business entities in the knowledge graph, and update the dialogue state vector based on the first business entity to obtain the updated dialogue state vector.

[0063] Specifically, the semantic similarity between the second business entity and the candidate business entity in the knowledge graph can be calculated first. Then, based on a preset similarity threshold and the semantic similarity, the second business entity corresponding to the candidate business entity can be determined as the aligned entity. Specifically, a pre-trained BERT model can be used to vectorize the second business entity and the candidate business entity in the knowledge graph, outputting a first semantic vector corresponding to the second business entity and a second semantic vector corresponding to the candidate business entity. Then, a cosine similarity calculation is performed on the first and second semantic vectors to obtain the semantic similarity between the second business entity and the candidate business entity. If the semantic similarity is greater than the preset similarity threshold, the corresponding second business entity is determined as the aligned entity.

[0064] For example, candidate business entities "Traffic" and the second business entity of knowledge graphs semantic similarity of "data plans" =0.85, compared to the second business entity of the knowledge graph. Semantic similarity of "voice packs" =0.3, since the preset similarity threshold is 0.7, then the entities are aligned. "Data plan".

[0065] For a single candidate business entity, there are multiple corresponding aligned entities. Optionally, the aligned entity with the highest semantic similarity can be determined as the first business entity based on the semantic similarity between the aligned entities; alternatively, the aligned entity with the highest relevance to the candidate business entity in the intent scenario can be determined as the first business entity based on the relevance of the multiple aligned entities to the candidate business entity. Specifically, the weights of the semantic association links between k aligned entities and the candidate business entity in the intent scenario are determined, and the sum of the weights of the semantic association links corresponding to each aligned entity is taken as the relevance of that aligned entity. Based on this relevance, the first business entity is determined from among the k aligned entities. For example, if the candidate business entity "traffic" has aligned entities "traffic packages" and "traffic parcels", and it is determined that in the "package complaint" intent scenario, the business relevance of the candidate business entity "traffic" to the aligned entity "traffic packages" is higher than that of the aligned entity "traffic parcels", then the aligned entity "traffic packages" is taken as the first business entity.

[0066] Next, the candidate business entity in the dialogue state vector is replaced with the first business entity, resulting in an updated dialogue state vector. This associates the entity information in the dialogue state vector with the knowledge graph, improving the accuracy of subsequent intent parsing.

[0067] At this point, the updated dialogue state vector can be directly used as the intent distribution information. Alternatively, step B3 can be performed to determine the optimal updated dialogue state vector as the intent distribution information.

[0068] Step B3: Based on the target context data, adjust the first weights of multiple updated dialogue state vectors to obtain the adjusted first weights, and determine the target updated dialogue state vector based on the adjusted first weights; and use the target updated dialogue state vector as intent distribution information.

[0069] The intent distribution information includes one or more of the intent slot information and the information on issues to be confirmed.

[0070] In practical applications, based on the adjusted first weight, the dialogue state vector with the highest adjusted first weight is determined as the target updated dialogue state vector.

[0071] Specifically, the first weight of the updated dialogue state vector can be adjusted based on user tags in the target context data. For example, if the user tag includes "high consumption," the weight of the dialogue state vector corresponding to marketing intents, such as "package upgrade," is increased, and the adjusted first weight is w. profile =1.2. It should be noted that the above-adjusted first weight is for ease of understanding only and does not constitute a specific limitation.

[0072] Following the example above, if the target context data also includes the user's browsing behavior data before the current session and the user's historical work order data, then an intent weight adjustment coefficient can be set. If the browsing behavior data includes a "complaint handling page", then increase the weight of the dialogue state vector corresponding to "problem complaint". For high-frequency topics in historical work order data, set an intent weight adjustment coefficient. If there are more than two "data package overrun" related work orders in the past three months in the historical work order data, then the weight of the dialogue state vector corresponding to "data package processing" will be increased. 1; Obtain the adjusted first weight : .

[0073] In this embodiment, the accuracy of subsequent intent parsing is improved by precisely aligning with the second business entity in the knowledge graph; on this basis, the accuracy of intent parsing is further improved by dynamically adjusting the intent parsing weight.

[0074] In one implementation, after determining the updated dialogue state vector based on the adjusted first weight (i.e., step B3), steps C1 to C3 can also be performed to obtain the corrected text to be completed: Step C1: Based on the preset business-specific mapping table, perform the first error correction process on the text to be completed to generate the first candidate text to be completed.

[0075] This includes analyzing historical customer service conversations, user tickets, and common input error logs to construct a pre-defined business-specific mapping table. This pre-defined mapping table contains frequently confused word pairs in the business scenario and is updated weekly based on newly generated error data.

[0076] The first step is error correction, which is related to correcting homophones and misspellings.

[0077] For example, in communication service scenarios, the common incorrect expression "broadband relocation" is explicitly corrected to the correct expression "broadband relocation" in the mapping table. A pre-defined service-specific mapping table can be shown in Table 3 below: Table 3

[0078] It should be noted that the above-mentioned preset service-specific mapping table only shows a portion of the content for ease of understanding and does not constitute a specific limitation on the preset service-specific mapping table.

[0079] Specifically, the text to be completed can first be segmented to obtain the segmented text to be completed. Then, the segmented text to be completed is searched word by word in a preset business-specific mapping table, easily confused words are checked and automatically replaced, and the replaced word sequence is reorganized into the first candidate text to be completed.

[0080] Step C2: Based on the first candidate text to be completed and the target context data, a second error correction process is performed using the edit distance function and the trained large language model to generate the second candidate text to be completed.

[0081] Specifically, the trained large language model can be used to correct errors in the first candidate text to be completed based on the target context data, generating a third candidate text to be completed. Then, based on the first and third candidate texts to be completed, the second candidate text to be completed can be determined using an edit distance function.

[0082] Alternatively, based on the first candidate text to be completed and the target context data, a candidate text set including multiple fourth candidate texts to be completed can be generated using the edit distance function and the trained large language model. Then, based on the first candidate text to be completed, the fourth candidate text to be completed, and the trained large language model, the conditional probability and edit distance function of the fourth candidate text to be completed are generated under the target context data. The score of the fourth candidate text to be completed in the candidate text set is determined, and the fourth candidate text to be completed with the smallest score is taken as the second candidate text to be completed.

[0083] For example, based on the first candidate text to be completed, the fourth candidate text to be completed, the conditional probability of the fourth candidate text to be completed generated by the trained large language model in the target context data, and the edit distance function, the score of the fourth candidate text to be completed in the candidate error correction text set can be determined by the following formula (1). Then, based on the score of the fourth candidate text to be completed in the candidate error correction text set, the second candidate text to be completed is determined as shown in formula (2). (1) (2) in, This is the first candidate text to be completed. The fourth candidate text to be completed; EditDistance is the distance function. This generates the conditional probability of x' for the trained large language model in the target context data; λ is the weight parameter, which can be set according to actual needs, for example, ; This is the second candidate text to be completed; This is the set of candidate error-correction texts.

[0084] At this point, the second candidate text to be completed can be used directly as the corrected text to be completed, or step C3 below can be performed to perform conflict verification on the second candidate text to be completed.

[0085] Step C3: Based on the updated dialogue state vector, perform conflict verification on the second candidate text to be completed, and if the conflict verification passes, use the second candidate text to be completed as the corrected text to be completed.

[0086] Specifically, based on the first business entity and / or intent scenario in the updated dialogue state vector, conflict verification is performed on the second candidate text to be completed. For example, if the intent scenario is "package complaint" and the second candidate text to be completed contains terms unrelated to the intent scenario, such as "broadband installation," then the conflict verification is determined to have failed. The second candidate text to be completed can be reselected from the candidate correction text set until the second candidate text to be completed passes the conflict verification. The second candidate text to be completed that passes the conflict verification is then used as the corrected text to be completed.

[0087] Based on the intent distribution information and the text to be completed, a structured result (i.e., S104) is generated, and the following step C4 can be performed: Step C4: Based on the intent distribution information and the corrected text to be completed, generate a structured result.

[0088] The structured results include intent distribution information and the text to be completed after error correction.

[0089] Additionally, based on preset business rules and intent distribution information, corresponding suggested actions can be generated. Correspondingly, based on the intent distribution information and the text to be completed, a structured result can be generated. This can be executed as follows: Generate a structured result based on intent distribution information, suggested actions, and the text to be completed. That is, the structured result includes intent distribution information, suggested actions, and the corrected text to be completed. The structured result may also include the adjusted first weight mentioned above.

[0090] For example, based on preset business rules and intent distribution information, the generated suggested actions can be shown in Table 4 below: Table 4

[0091] It should be noted that the above suggested actions and intention distribution information is for ease of understanding only and does not constitute a specific limitation.

[0092] In this embodiment, a two-layer mechanism is used to correct errors in the text to be completed by combining a first error correction process based on a preset business-specific mapping table with a second error correction process using an edit distance function and a trained large language model. This addresses issues such as homophone confusion, typos, and semantic incoherence, resulting in an accurate second candidate text to be completed. Furthermore, semantic verification of the updated dialogue state vector further enhances the accuracy of error correction.

[0093] In one implementation, before generating the completion result of the text to be completed (i.e., S108) based on the target business entity and the first completion information, the following steps D1 to D2 may also be performed to generate the second completion information: Step D1: Obtain user business data and regional characteristic data from the search engine; Step D2: Based on the business data and regional characteristic data, sorting is performed to obtain sorted business data and regional characteristic data. Based on the sorted business data and regional characteristic data, as well as the structured results, second completion information is generated.

[0094] In practical applications, business data and region-specific data are generally stored in a search engine (Elasticsearch, ES). Business data and region-specific data include, but are not limited to, the following fields: service_name, associated user ID, last_access_time, click_count, location, channel code, and business_type.

[0095] Specifically, the user's business data and regional characteristic data can be sorted based on the most recent access time and click count. Based on the structured results, the sorted business data, and the regional characteristic data, a preset number of second-order completion information entries can be generated. For example, the preset number of recommendations is 3. Three second-order completion information entries can be returned based on priority given to most recent access time, followed by business data and regional characteristic data with high click counts, and the text to be completed or corrected in the structured results, as shown in Table 5 below. Table 5

[0096] It should be noted that the above suggested actions and intention distribution information is for ease of understanding only and does not constitute a specific limitation.

[0097] Accordingly, based on the target business entity and the first completion information, the completion result of the text to be completed is generated (i.e., S108), which can be executed as follows: Based on the target business entity, the first completion information, and the second completion information, the completion result of the text to be completed is generated. Specifically, steps D3 to D4 can be executed as follows.

[0098] Based on the target business entity and the first completion information, the completion result of the text to be completed is generated (i.e., S108), and the following steps D3 to D4 can be performed: Step D3: Based on the target business entity, the first completion information, and the second completion information, generate candidate completion results, and perform multiple evaluations on the candidate completion results, including semantic relevance evaluation, timeliness evaluation, personalization evaluation, and business value evaluation, to obtain the corresponding evaluation score.

[0099] The evaluation score includes multiple scores from semantic relevance, timeliness, personalization, and business value.

[0100] Semantic relevance evaluation can be performed on candidate completion results based on the text to be completed or the corrected text to be completed. Specifically, the semantic relevance score is determined by calculating the semantic similarity between the text to be completed or the corrected text to be completed and the target business entity, the first completion information, and the second completion information in the candidate completion results. This semantic similarity is, for example, cosine similarity.

[0101] The timeliness of the target business entity, first completion information, and second completion information in the candidate completion results can be evaluated based on the launch time of the business corresponding to the candidate completion results. Recently launched businesses can be prioritized. Specifically, the timeliness score can be determined using the following formula (3). : (3) in, For the launch time, The attenuation coefficient is used to normalize the timeliness score to [0,1].

[0102] Based on the click-through rate (CTR) and conversion rate (CVR) of the user's interactions with the corresponding services in the aforementioned sessions, a personalized evaluation can be performed on the target business entity, the first completion information, and the second completion information in the candidate completion results. This results in higher scores for frequently interacting services. For example, the personalized score can be determined using the following formula (4). : Spersonal=0.4 CTR +0.6 CVR (4) Based on the regional business marketing priority, the target business entity, first complete information, and second complete information in the candidate completion results can be evaluated for business value. The priority corresponding to the main business is the highest, and the priority can be set from 1 to 5. Specifically, the following formula (5) can be used to determine the business value score. : (5) Step D4: Based on the user tags in the profile data and whether the current session is the user's first session, adjust the second weight corresponding to the evaluation score to obtain the adjusted second weight. Based on the evaluation score and the adjusted second weight, reorder the target business entity, the first completion information and the second completion information in the candidate completion results to generate the completion result.

[0103] For example, These are the second weights corresponding to the semantic relevance score, timeliness score, personalization score, and business value score, respectively. If the current session is the user's first session, meaning the user's intent is not yet clear, the semantic relevance score and timeliness score are prioritized, with their corresponding second weights set to α=0.6, β=0.2, γ=0.1, and δ=0.1, respectively. If the current session is not the user's first session, and the user's intent is clear, the personalization score is strengthened, with its corresponding second weights set to α=0.3, β=0.1, γ=0.5, and δ=0.1, respectively. The business value score and semantic relevance score are adjusted in real time using user tags from the profile data. For example, if the user tag is "high-spending user," the second weight δ of the corresponding business value score is increased to 0.2; if the user tag is "frequent complaining user," the second weight δ of the business value score is decreased to 0.05, and the value of the semantic relevance score α is increased to 0.65. It should be noted that the second weights corresponding to the semantic relevance score, timeliness score, personalization score, and business value score mentioned above are for ease of understanding only and do not constitute specific limitations.

[0104] For example, the candidate result score can be obtained by weighted summation based on semantic relevance score, timeliness score, personalization score, and business value score and the corresponding adjusted second weight, as shown in the following formula (6): (6) in, These are the adjusted second weights, satisfying... This is used to balance the importance of each dimension.

[0105] Then, based on the candidate result scores, the target business entity, the first completion information, and the second completion information in the candidate completion results are reordered to generate the completion results.

[0106] In this embodiment, on the one hand, by combining user historical behavior and real-time characteristics with regional business configuration, completion suggestions highly matched with individual user preferences are generated. This focuses on solving the adaptation problem between "general completion" and "user personalized needs" and "regional characteristics," achieving accurate recommendations through structured rules and a search engine. On the other hand, the target business entity, the first completion information, and the second completion information are uniformly reordered, ultimately outputting a Top-N completion result that balances accuracy, diversity, and business value. By dynamically balancing semantic matching, user preferences, and business goals, the collaborative optimization problem of heterogeneous recall results is solved.

[0107] In one implementation, before performing relational reasoning based on the structured results and determining the target business entity (i.e., S106) in the second business entity of the preset knowledge graph, the following step E1 may also be performed: Step E1 involves incrementally updating the original knowledge graph based on work order data, user feedback relationship descriptions, and customer service knowledge base update documents to obtain the knowledge graph.

[0108] Specifically, based on work order data, user feedback relationship descriptions, and updated documents from the customer service knowledge base, the original knowledge graph can be incrementally updated through the following steps e1 to e3 to obtain the knowledge graph: Step e1 involves extracting information from work order data, user feedback relationship descriptions, and customer service knowledge base update documents to obtain attribute relationship information between third business entities and the third business entities. Then, based on the third business entity, the relationship information between the third business entities, and the fourth business entity in the original knowledge graph, entity matching is performed to obtain a set of candidate new entities and a set of candidate new relationships.

[0109] This involves extracting and processing work order data to obtain a third business entity, such as "Campus Data Package 2025 Edition". User feedback includes relationship descriptions, such as "Campus Data Package is only available to students". Structured business rules are parsed from the customer service knowledge base update document; for example, from "5G Speed ​​Package: 100GB data per month, speed limit threshold is 80GB", the third business entity "5G Speed ​​Package" and the attribute relationship information "speed limit threshold → 80GB" are extracted. Step e2: Disambiguate the candidate new entity set to obtain the disambiguated candidate new entity set, and determine the frequency value of the third business entity in the disambiguated candidate new entity set based on the candidate new entity set.

[0110] The frequency value of the third business entity in the candidate new entity set after disambiguation can be determined using the TF-IDF algorithm.

[0111] For example, if "5G Speed ​​Package" and "5G Speed-Up Package" in the candidate new entity set are different expressions of the same service, and their corresponding cosine similarity is ≥0.85, they are determined to be the same third service entity and merged into the standard name "5G Speed ​​Package". In the case of the same third service entity but with different service attributes, such as the entity name of "Daily Data Package" and "Monthly Package" in the business knowledge being "Data Package", combined with the attribute relationship information of the third service entity - the validity period is "Valid for 1 day" and "Valid for 30 days" respectively, it can be determined that they are two different third service entities, and the entity names are labeled as "Daily Data Package" and "Monthly Data Package" respectively.

[0112] Step e3: Based on the frequency value, determine the incremental update candidate entities in the candidate new entity set after disambiguation, and update the original knowledge graph based on the incremental update candidate entities and the attribute relationship information corresponding to the incremental update candidate entities, to obtain the above knowledge graph.

[0113] Specifically, the TF-IDF algorithm can be used to calculate the set of candidate new entities. The term frequency-inverse document frequency (IF-IVF) of entities in the incremental data, i.e., the frequency values ​​mentioned above, are used to ensure that the extracted entities are valid business items frequently mentioned by users. Entities with a frequency value ≥ 0.3 in the candidate new entity set after de-ambiguation are selected as incremental update candidate entities. The incremental update candidate entities and their corresponding attribute relationship information are written into the original knowledge graph, updating the new nodes, relationships, and attributes. The attributes of the existing entities in the original knowledge graph, i.e., the fourth business entity, are then iteratively updated.

[0114] Before generating the first completion information (i.e., S106) using the trained large language model based on the structured results and the target business entity, the following steps E2 to E3 can also be performed: Step E2: Obtain dialogue data and preprocess the dialogue data to generate fine-tuning data including the text sample to be completed and the first completion information sample.

[0115] The text samples to be completed include new business terms that users have not used in historical session data.

[0116] Preprocessing the dialogue data can be done in the same way as the cleaning and standardization process in step B1. The first completed information sample is the completed result that conforms to the business logic and corresponds to the text sample to be completed. The first completed information sample is, for example, "5G speed package can be applied for through the APP homepage - package application - entry". By fine-tuning the data, all newly launched services are covered.

[0117] Step E3: Based on the fine-tuning data, the pre-trained large language model is fine-tuned using low-rank adaptive LoRA to obtain the trained large language model.

[0118] For example, a lightweight fine-tuning strategy combining LoRA can be used to freeze the base model of the pre-trained large language model. The main parameters are determined by applying a rank-8 low-rank decomposition to the linear layers of the pre-trained large language model. The training parameters account for 5% of the pre-trained large language model, and the weight matrix is ​​updated. As shown in the following formula (7): (7) in, These are the pre-trained weights, and the frozen portion. and For trainable matrices ( =8).

[0119] The training objective is to minimize the cross-entropy loss between the first complete information and the first complete information sample, as shown in the following formula (8): (8) in, The number of samples is denoted as , and each sample includes a sample of the text to be completed and a sample of the first completion information. For sequence length, For the goal , To obtain the target for prediction by a pre-trained large language model The probability of.

[0120] The training hyperparameters can be set as follows: learning rate 5e-5, batch size 32, and training epochs 5.

[0121] The base model can be Qwen3-0.6B.

[0122] After obtaining the fine-tuned large language model, the accuracy of new term recognition and the business compliance of the first completion information can be determined. Based on these two metrics, the fine-tuned large language model is evaluated, and the evaluation results determine whether it should be used as the final trained large language model. The accuracy of new term recognition is... The proportion of new terms correctly interpreted by the statistical model; the business compliance of the first completed information. This is used to evaluate the matching degree between the first completed information generated by the model and the latest business rules. For example, if... ≥90% and If the evaluation result is ≥90%, indicating that the fine-tuned large language model has passed the evaluation, then the fine-tuned large language model can be used as the new large language model to replace the current new large language model; otherwise, return to manual optimization and fine-tuning data and retrain.

[0123] In this embodiment, incremental graph updates and lightweight fine-tuning of large models are used to adapt to new terms, enabling real-time iteration of knowledge and model capabilities and ensuring continuous adaptation to new businesses and scenarios.

[0124] Figure 2 This is a flowchart illustrating another user input text completion method provided in an embodiment of this application. For example... Figure 2 As shown, the method includes: Step 202: Upon receiving the text to be completed input by the user in the current session, determine whether the current session is the user's first session.

[0125] Step 204: If yes, then obtain the user's first context data.

[0126] The first context data includes one or more of the following: user profile data, user browsing behavior data prior to the current session, and user historical work order data.

[0127] Step 206: If not, obtain the user's second context data.

[0128] The second contextual data includes user profile data and dialogue sequences of user conversations; the dialogue sequences include user-inputted statements and corresponding customer service responses.

[0129] Step 208: Based on the target context data and the text to be completed, perform intent parsing to obtain intent distribution information, and generate structured results based on the intent distribution information and the text to be completed.

[0130] The target context data includes either first context data or second context data. The intent distribution information includes one or more of the following: the user's intent scenario, the first business entity related to the current session, the user's intent action towards the first business entity, intent slot information, and information on questions to be confirmed.

[0131] Step 210: Based on the structured results, perform associative reasoning, determine the target business entity in the second business entity of the preset knowledge graph, and generate the first completion information based on the structured results and the target business entity through the trained large language model.

[0132] Step 212: Obtain the user's business data and regional characteristic data in the search engine.

[0133] Step 214: Based on the business data and regional characteristic data, sort the data to obtain sorted business data and regional characteristic data. Based on the sorted business data and regional characteristic data, as well as the structured results, generate the second complete information.

[0134] Step 216: Based on the target business entity, the first completion information, and the second completion information, generate candidate completion results, and perform multiple evaluations on the candidate completion results, including semantic relevance evaluation, timeliness evaluation, personalization evaluation, and business value evaluation, to obtain the corresponding evaluation scores.

[0135] The evaluation score includes multiple scores from semantic relevance, timeliness, personalization, and business value.

[0136] The target business entity, the first complete information, and the second complete information can be, for example, shown in Table 6 below: Table 6

[0137] It should be noted that the above examples of candidate completion results are for ease of understanding only and do not constitute a specific limitation on the candidate completion results.

[0138] Step 218: Based on the user tags in the profile data and whether the current session is the user's first session, adjust the second weight corresponding to the evaluation score to obtain the adjusted second weight. Based on the evaluation score and the adjusted second weight, reorder the target business entity, the first completion information and the second completion information in the candidate completion results to generate the completion results.

[0139] The specific processes of steps 202 to 218 have been described in detail in the above embodiments and will not be repeated here.

[0140] In this embodiment, upon receiving text to be completed input by a user in the current session, the system obtains the user's target context data, which includes the user's profile data. Based on the target context data and the text to be completed, intent parsing is performed to obtain intent distribution information. Based on the intent distribution information and the text to be completed, a structured result is generated. The intent distribution information includes one or more of the user's inquiry intent scenario, a first business entity related to the current session, and the user's intent action towards the first business entity. Based on the structured result, associative reasoning is performed to determine the target business entity from the second business entities in a preset knowledge graph. Based on the structured result and the target business entity, first completion information is generated using a trained large language model. Based on the target business entity and the first completion information, the completion result of the text to be completed is generated. Compared to existing user input text completion technologies, this application combines the text to be completed with the user's target context data for intent analysis, avoiding the limitations of understanding single dialogue fragments. The intent analysis results are more consistent with the user's true intent. Furthermore, by collaboratively utilizing the generation capabilities of structured knowledge graphs and trained large language models, it can generate completion results that conform to business rules and semantic logic, and the completion results cover a wider range of recommendation scenarios. Consequently, the completion results are more in line with the user's actual needs, i.e., the completion results are more accurate. This solves the problem of poor accuracy in existing user input text completion technologies.

[0141] Corresponding to the user input text completion method provided in the above embodiments, based on the same technical concept, the present invention also provides a user input text completion device. Figure 3 This is a schematic diagram of a user input text completion device according to an embodiment of the present invention. The user input text completion device is used to perform... Figures 1 to 2 The described user input text completion method, such as Figure 3 As shown, the user input text completion device includes: an acquisition module 310, a parsing module 320, a reasoning module 330, and a generation module 340.

[0142] The acquisition module 310 is used to acquire the user's target context data when it receives the text to be completed input by the user in the current session; wherein, the target context data includes the user's profile data; The parsing module 320 is used to perform intent parsing based on the target context data and the text to be completed, obtain intent distribution information, and generate structured results based on the intent distribution information and the text to be completed; wherein, the intent distribution information includes one or more of the user's inquiry intent scenario, the first business entity related to the current session, and the user's intent action for the first business entity. The reasoning module 330 is used to perform associative reasoning based on the structured results, determine the target business entity in the second business entity of the preset knowledge graph, and generate the first completion information based on the structured results and the target business entity through the trained large language model. The generation module 340 is used to generate the completion result of the text to be completed based on the target business entity and the first completion information.

[0143] In one implementation, module 310 is specifically used for: Determine if the current session is the user's first session; If so, then obtain the user's first context data; wherein, the first context data also includes one or more of the user's browsing behavior data before the current session and the user's historical ticket data; If not, then obtain the user's second context data; wherein, the second context data also includes the dialogue sequence of the user's existing conversations; the dialogue sequence includes the statement information entered by the user and the customer service response information corresponding to the statement information.

[0144] In one implementation, the parsing module 320 is specifically used for: Based on the target context data, semantic abstraction is performed through the trained large language model to obtain multiple structured dialogue state vectors. Among them, the dialogue state vector includes one or more of the following: the user's intent scenario for consultation, the candidate business entities related to the current conversation, the user's intent action for the candidate business entities, the user's intent slot information, and the information of the question to be confirmed. By calculating the similarity between the second business entity and the candidate business entity in the knowledge graph, the first business entity is determined among the second business entities in the knowledge graph, and the dialogue state vector is updated based on the first business entity to obtain the updated dialogue state vector. Based on the target context data, the first weights of multiple updated dialogue state vectors are adjusted to obtain the adjusted first weights, and the target updated dialogue state vector is determined based on the adjusted first weights; and the target updated dialogue state vector is used as intent distribution information; wherein, the intent distribution information also includes one or more of intent slot information and question information to be confirmed.

[0145] In one implementation, the user input text completion device further includes an error correction module. This error correction module is used for: Based on a pre-defined business-specific mapping table, the text to be completed undergoes the first error correction process to generate the first candidate text to be completed. Based on the first candidate text to be completed and the target context data, a second error correction process is performed by editing the distance function and the trained large language model to generate the second candidate text to be completed. Based on the updated dialogue state vector, conflict verification is performed on the second candidate text to be completed, and if the conflict verification passes, the second candidate text to be completed is used as the corrected text to be completed. Parsing module 320 is specifically used for: Based on the intent distribution information and the text to be completed after error correction, a structured result is generated.

[0146] In one implementation, the user input text completion device further includes a personalization generation module. The personalization generation module is used for: Acquire user business data and regional characteristic data in search engines; Based on business data and regional characteristic data, sorting is performed to obtain sorted business data and regional characteristic data. Based on the sorted business data and regional characteristic data, as well as the structured results, second supplementary information is generated. Module 340 is generated, specifically for: Based on the target business entity, the first completion information, and the second completion information, candidate completion results are generated. Multiple evaluations are then performed on the candidate completion results, including semantic relevance evaluation, timeliness evaluation, personalization evaluation, and business value evaluation, to obtain the corresponding evaluation scores. The evaluation scores include multiple evaluations of semantic relevance score, timeliness score, personalization score, and business value score. Based on the user tags in the profile data and whether the current session is the user's first session, the second weight corresponding to the evaluation score is adjusted to obtain the adjusted second weight. Based on the evaluation score and the adjusted second weight, the target business entity, the first completion information and the second completion information in the candidate completion results are reordered to generate the completion results.

[0147] In one implementation, the user input text completion device further includes an update module. The update module is specifically used for: Based on work order data, user feedback relationship descriptions, and customer service knowledge base update documents, the original knowledge graph is incrementally updated to obtain the knowledge graph. Acquire dialogue data and preprocess the dialogue data to generate fine-tuning data including the text sample to be completed and the first completion information sample; Based on the fine-tuning data, the pre-trained large language model is fine-tuned using low-rank adaptive LoRA to obtain the trained large language model.

[0148] In this embodiment, upon receiving text to be completed input by a user in the current session, the system obtains the user's target context data, which includes the user's profile data. Based on the target context data and the text to be completed, intent parsing is performed to obtain intent distribution information. Based on the intent distribution information and the text to be completed, a structured result is generated. The intent distribution information includes one or more of the user's inquiry intent scenario, a first business entity related to the current session, and the user's intent action towards the first business entity. Based on the structured result, associative reasoning is performed to determine the target business entity from the second business entities in a preset knowledge graph. Based on the structured result and the target business entity, first completion information is generated using a trained large language model. Based on the target business entity and the first completion information, the completion result of the text to be completed is generated. Compared to existing user input text completion technologies, this application combines the text to be completed with the user's target context data for intent analysis, avoiding the limitations of understanding single dialogue fragments. The intent analysis results are more consistent with the user's true intent. Furthermore, by collaboratively utilizing the generation capabilities of structured knowledge graphs and trained large language models, it can generate completion results that conform to business rules and semantic logic, and the completion results cover a wider range of recommendation scenarios. Consequently, the completion results are more in line with the user's actual needs, i.e., the completion results are more accurate. This solves the problem of poor accuracy in existing user input text completion technologies.

[0149] Those skilled in the art will understand that the above-described user input text completion device can be used to implement the user input text completion method described above. The detailed description therein should be similar to the method description above, and will not be repeated here to avoid repetition.

[0150] Based on the same technical concept, this application also provides an electronic device for performing the above-described user input text completion method. Figure 4This is a schematic diagram of the structure of an electronic device to implement various embodiments of this application. The electronic device can vary significantly due to differences in configuration or performance, and may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440. The processor 410, communications interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can call a computer program stored in the memory 430 and executable on the processor 410 to perform the following steps: Upon receiving the text to be completed input by the user in the current session, the target context data of the user is obtained; wherein, the target context data includes the user's profile data; Based on the target context data and the text to be completed, intent parsing is performed to obtain intent distribution information. Based on the intent distribution information and the text to be completed, a structured result is generated. The intent distribution information includes one or more of the user's inquiry intent scenario, the first business entity related to the current session, and the user's intent action for the first business entity. Based on the structured results, we perform associative reasoning, determine the target business entity in the second business entity of the pre-set knowledge graph, and generate the first completion information based on the structured results and the target business entity through the trained large language model. Based on the target business entity and the first completion information, the completion result of the text to be completed is generated.

[0151] In this embodiment, upon receiving text to be completed input by a user in the current session, the system obtains the user's target context data, which includes the user's profile data. Based on the target context data and the text to be completed, intent parsing is performed to obtain intent distribution information. Based on the intent distribution information and the text to be completed, a structured result is generated. The intent distribution information includes one or more of the user's inquiry intent scenario, a first business entity related to the current session, and the user's intent action towards the first business entity. Based on the structured result, associative reasoning is performed to determine the target business entity from the second business entities in a preset knowledge graph. Based on the structured result and the target business entity, first completion information is generated using a trained large language model. Based on the target business entity and the first completion information, the completion result of the text to be completed is generated. Compared to existing user input text completion technologies, this application combines the text to be completed with the user's target context data for intent analysis, avoiding the limitations of understanding single dialogue fragments. The intent analysis results are more consistent with the user's true intent. Furthermore, by collaboratively utilizing the generation capabilities of structured knowledge graphs and trained large language models, it can generate completion results that conform to business rules and semantic logic, and the completion results cover a wider range of recommendation scenarios. Consequently, the completion results are more in line with the user's actual needs, i.e., the completion results are more accurate. This solves the problem of poor accuracy in existing user input text completion technologies.

[0152] The specific execution steps can be found in the various steps of the above-described user input text completion method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.

[0153] It should be noted that the electronic devices in the embodiments of this application include: servers, terminals, or other devices besides terminals.

[0154] The above electronic device structure does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or arrange them differently. For example, an input unit may include a Graphics Processing Unit (GPU) and a microphone, and a display unit may use a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar display panels. User input units include at least one of a touch panel and other input devices. A touch panel is also called a touchscreen. Other input devices may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be elaborated further here.

[0155] Memory can be used to store software programs and various data. Memory can primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area can store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, memory can include volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (Synchlink DRAM, SLDRAM), and direct memory bus RAM (DRRAM).

[0156] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly handles operations related to the operating system, user interface, and applications, while the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor.

[0157] This application also provides a storage medium storing computer-executable instructions. When these computer-executable instructions are executed by a processor, they implement the various processes of the above-described user input text completion method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.

[0158] The processor is the processor in the electronic device described in the above embodiments. The storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0159] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described user input text completion method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0160] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0161] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the various processes of the above-described user input text completion method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0162] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include multitasking and parallel processing according to the functions involved, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0163] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of the various embodiments of this application.

[0164] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A method for completing user-input text, characterized in that, The method includes: Upon receiving text to be completed input by a user in the current session, the target context data of the user is obtained; wherein, the target context data includes the user's profile data; Based on the target context data and the text to be completed, intent parsing is performed to obtain intent distribution information, and based on the intent distribution information and the text to be completed, a structured result is generated; wherein, the intent distribution information includes one or more of the user's inquiry intent scenario, the first business entity related to the current session, and the user's intent action for the first business entity. Based on the structured results, association reasoning is performed to determine the target business entity in the second business entity of the preset knowledge graph. Based on the structured results and the target business entity, the first completion information is generated through the trained large language model. Based on the target business entity and the first completion information, the completion result of the text to be completed is generated.

2. The method according to claim 1, characterized in that, The process of obtaining the user's target context data includes: Determine whether the current session is the user's first session; If so, then the user's first context data is obtained; wherein, the first context data further includes one or more of the user's browsing behavior data before the current session and the user's historical work order data; If not, then the user's second context data is obtained; wherein, the second context data further includes the dialogue sequence of the user's past conversations; the dialogue sequence includes the statement information input by the user and the customer service response information corresponding to the statement information.

3. The method according to claim 1, characterized in that, The process of parsing intent based on the target context data and the text to be completed to obtain intent distribution information includes: Based on the target context data, semantic abstraction is performed through the trained large language model to obtain multiple structured dialogue state vectors; wherein, the dialogue state vector includes one or more of the following: the user's intent scenario for consultation, the candidate business entities related to the current session, the user's intent action for the candidate business entities, the user's intent slot information, and the information of the question to be confirmed. By calculating the similarity between the second business entity and the candidate business entity in the knowledge graph, the first business entity is determined among the second business entities in the knowledge graph, and the dialogue state vector is updated based on the first business entity to obtain the updated dialogue state vector. Based on the target context data, the first weights of multiple updated dialogue state vectors are adjusted to obtain adjusted first weights, and the target updated dialogue state vector is determined based on the adjusted first weights; and the target updated dialogue state vector is used as the intent distribution information; wherein the intent distribution information further includes one or more of the intent slot information and the question information to be confirmed.

4. The method according to claim 3, characterized in that, After determining the updated dialogue state vector based on the adjusted first weight, the method further includes: Based on a preset business-specific mapping table, the text to be completed is subjected to a first error correction process to generate a first candidate text to be completed. Based on the first candidate text to be completed and the target context data, a second error correction process is performed using the edit distance function and the trained large language model to generate a second candidate text to be completed. Based on the updated dialogue state vector, conflict verification is performed on the second candidate text to be completed, and if the conflict verification passes, the second candidate text to be completed is used as the corrected text to be completed. The step of generating a structured result based on the intent distribution information and the text to be completed includes: The structured result is generated based on the intent distribution information and the corrected text to be completed.

5. The method according to claim 1, characterized in that, Before generating the completion result of the text to be completed based on the target business entity and the first completion information, the method further includes: Obtain the user's business data and regional characteristic data from the search engine; Based on the business data and regional characteristic data, sorting processing is performed to obtain sorted business data and regional characteristic data. Based on the sorted business data and regional characteristic data, as well as the structured result, second completion information is generated. The step of generating the completion result of the text to be completed based on the target business entity and the first completion information includes: Based on the target business entity, the first completion information, and the second completion information, candidate completion results are generated, and multiple of the following are evaluated on the candidate completion results: semantic relevance evaluation, timeliness evaluation, personalization evaluation, and business value evaluation, to obtain corresponding evaluation scores; the evaluation scores include multiple of the following: semantic relevance score, timeliness score, personalization score, and business value score. Based on the user tags in the profile data and whether the current session is the user's first session, the second weight corresponding to the evaluation score is adjusted to obtain the adjusted second weight. Based on the evaluation score and the adjusted second weight, the target business entity, the first completion information and the second completion information in the candidate completion results are reordered to generate the completion results.

6. The method according to claim 1, characterized in that, Before performing association reasoning based on the structured results to determine the target business entity in the second business entity of the preset knowledge graph, the method further includes: Based on work order data, user feedback relationship descriptions, and customer service knowledge base update documents, the original knowledge graph is incrementally updated to obtain the knowledge graph. Before generating the first completion information based on the structured result and the target business entity using the trained large language model, the method further includes: Acquire dialogue data and preprocess the dialogue data to generate fine-tuning data including a text sample to be completed and a first completion information sample; Based on the fine-tuning data, the pre-trained large language model is fine-tuned using low-rank adaptive LoRA to obtain the trained large language model.

7. A user input text completion device, characterized in that, The device includes: The acquisition module is used to acquire the user's target context data when it receives the text to be completed input by the user in the current session; wherein, the target context data includes the user's profile data; The parsing module is used to perform intent parsing based on the target context data and the text to be completed, obtain intent distribution information, and generate a structured result based on the intent distribution information and the text to be completed; wherein, the intent distribution information includes one or more of the user's inquiry intent scenario, the first business entity related to the current session, and the user's intent action for the first business entity; The reasoning module is used to perform association reasoning based on the structured results, determine the target business entity in the second business entity of the preset knowledge graph, and generate the first completion information based on the structured results and the target business entity through the trained large language model. The generation module is used to generate the completion result of the text to be completed based on the target business entity and the first completion information.

8. An electronic device, characterized in that, include: processor; as well as A memory configured to store computer-executable instructions configured to be executed by the processor, the executable instructions including instructions for performing the user input text completion method as described in any one of claims 1-6.

9. A storage medium, characterized in that, The storage medium is used to store computer-executable instructions that cause a computer to perform the user input text completion method as described in any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the user input text completion method as described in any one of claims 1-6.