Prompt word generation method and device, equipment, medium and program product

By using the intent recognition model on the client, generating prompt words that reflect user intentions based on the user knowledge base and intent rule base, and inputting them into the cloud model, the problem that the prompt word optimization function in the prior art cannot effectively adapt to user needs, and improve the accuracy of the output content.

CN119739834APending Publication Date: 2025-04-01GUANGZHOU DULING TECH CO LTD
View PDF 0 Cites 9 Cited by

Patent Information

Application Number
CN202411836290.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

When the prior art faces a large number of users' various output needs and input styles, the prompt word optimization function cannot effectively adapt to user needs, and the matching degree of output results and user needs still needs to be improved.

Method used

By obtaining user input content, based on the constraints of the user knowledge base and/or user intent rule base, the intent recognition model is used to identify the user input content intent, output the prompt words reflecting the user's intention, and input it into the cloud model to obtain the output results.

Benefits of technology

The generation of prompt words that meet users' personalized needs is realized, so that the cloud model can generate content that is more suitable for users' needs based on these prompt words, thereby improving the accuracy of output content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739834A_ABST
    Figure CN119739834A_ABST
Patent Text Reader

Abstract

The invention provides a cue word generation method and device, equipment, a medium and a program product, and relates to the technical field of computers, in particular to the technical field of artificial intelligence, natural language processing and deep learning. According to the specific implementation scheme, user input content is obtained; based on constraints of a user knowledge base and / or a user intention rule base, adopting an intention recognition model to perform cue word intention recognition on user input content, and outputting cue words reflecting user intentions; and inputting the cue word into the cloud model to obtain an output result. According to the embodiment of the invention, the generation accuracy of the cue word can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to artificial intelligence, natural language processing and deep learning technology. Background Art

[0002] When users use the big model to generate content and answer questions, they need to generate prompts based on user input. The prompts need to clearly define the task objectives and adapt to the input requirements of the big model so that the big model can output results according to the target requirements. Therefore, the quality of the prompts has a great impact on the quality of the output results.

[0003] In order to reduce the requirements for user input content, the existing technology generally provides a prompt word optimization and rewriting function, that is, processing the user's original input content to generate prompt words that meet the large model input requirements, thereby improving the quality of the prompt words.

[0004] However, when faced with a large number of users with various output requirements and input styles, the existing prompt word optimization function cannot effectively adapt to user needs, and the matching degree between output results and user needs still needs to be improved. Summary of the invention

[0005] The present disclosure provides a method, device, equipment, medium and program product for generating prompt words to improve the prompt word optimization function.

[0006] According to one aspect of the present disclosure, a method for generating a prompt word is provided, comprising:

[0007] Get user input;

[0008] Based on the constraints of the user knowledge base and / or the user intention rule base, an intention recognition model is used to recognize the prompt word intention of the user input content, and a prompt word reflecting the user intention is output;

[0009] Input the prompt word into the cloud model to obtain the output result.

[0010] According to another aspect of the present disclosure, a device for generating a prompt word is provided, comprising:

[0011] Content acquisition module, used to acquire user input content;

[0012] An intention recognition module is used to recognize the prompt word intention of the user input content based on the constraints of the user knowledge base and / or the user intention rule base using the intention recognition model, and output the prompt word reflecting the user intention;

[0013] The result acquisition module is used to input the prompt words into the cloud model to obtain the output results.

[0014] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0015] at least one processor; and

[0016] a memory communicatively connected to at least one processor; wherein,

[0017] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the method for generating prompt words in any embodiment of the present disclosure.

[0018] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the method for generating a prompt word according to any embodiment of the present disclosure.

[0019] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for generating a prompt word according to any embodiment of the present disclosure is implemented.

[0020] The technical solution of the disclosed embodiment, through the constraints of the user knowledge base and / or the user intention rule base, adopts the intention recognition model to recognize the prompt word intention of the user input content, and obtains the prompt word that meets the user's personalized needs, so that the cloud model can generate content that is more suitable for the user's needs based on the prompt word, thereby improving the accuracy of the cloud model output content.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0023] Figure 1 is a schematic diagram of a large model architecture provided according to an embodiment of the present disclosure;

[0024] Figure 2 is a schematic diagram of a method for generating a prompt word according to an embodiment of the present disclosure;

[0025] Figure 3 is a schematic diagram of a method for generating a prompt word according to an embodiment of the present disclosure;

[0026] Figure 4 is a schematic diagram of a method for generating a prompt word according to an embodiment of the present disclosure;

[0027] Figure 5is a schematic diagram of a method for generating a prompt word according to an embodiment of the present disclosure;

[0028] Figure 6 is a schematic diagram of a method for generating a prompt word according to an embodiment of the present disclosure;

[0029] Figure 7 It is a structural schematic diagram of a prompt word generating device disclosed in an embodiment of the present disclosure;

[0030] Figure 8 The block diagram is a block diagram of an electronic device for implementing the method for generating prompt words according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0032] The technical solution of the embodiment of the present disclosure is applicable to Figure 1 The system architecture shown in Figure 1 As shown, the system architecture of the entire big model service includes: a user client 101 and a cloud big model 102.

[0033] The cloud big model 102 includes at least one big model interface, for example, the big model interface may be a big model 1 API 102a and a big model NAPI 102b. The types of big models corresponding to the big model 1 API 102a and the big model NAPI 102b may be the same or different, and the number of big models may be one or more, which is not limited in the embodiments of the present disclosure.

[0034] The user 103 can input user input content through the input device 104, and the user input content can be voice. The user 103 can send instructions, ask questions or tell content to the user client 101 through voice input, and the voice can be converted into text by the speech (speech) to text conversion module 101a in the user client 101 to obtain disordered text 101b. The disordered text 101b can be preprocessed by the text preprocessing module 101c to obtain preprocessed text.

[0035] The preprocessed text can be input into the pre-trained intent recognition model 101d. The intent recognition model 101d is a model for specific intent recognition classification. For example, the BERT model can be selected. The intent recognition model configured on the local client can be a model with a smaller parameter scale. The BERT model learns context-related word vectors through bidirectional encoder representations. The BERT model can generally train the model through two pre-training tasks: the Masked Language Model (MLM) and the Next Sentence Prediction (NSP). The MLM task randomly masks some words in the input text and then lets the model predict these masked words, thereby learning the representation of the words in the context. The NSP task is to determine whether two sentences are continuous texts to help the model understand the relationship between sentences. Personalized rewriting is achieved through the BERT model, and the content input by the user is replaced with text that meets the specific requirements of the large model. Of course, the intent recognition model in the embodiment of the present disclosure is not limited to the use of the BERT model.

[0036] The user knowledge base / user intention rule base 101e is used to store user personalized content. The user knowledge base is used to store keywords that reflect the user's personal habits and preferences; the user intention rule base is used to store the user's configuration rules (Profile), especially the rules that reflect the user's intention expression. User intention rules are an abstract description and integration of user characteristics and related information, which are used to help the large model better understand and adapt to the needs and behavior patterns of different users, so as to provide users with more personalized services and responses. The keywords in the user knowledge base / user intention rule base 101e are used to constrain the generation range, grammar or semantics of the prompt words generated by the intent recognition model 101d, so that the replaced text meets the user's personalized requirements. The model 1 corresponding to the large model 1API 102a: prompt word 101f and the model 1 corresponding to the large model NAPI 102b: prompt word 101g are obtained. The model 1: prompt word 110 corresponding to the big model 1API 102a is input into the big model 1API 102a of the cloud big model 102 for processing, and the model 1: prompt word 111 corresponding to the big model NAPI 102b is input into the big model 1API 102b of the cloud big model 102 for processing, and the result is returned in the form of text or voice to obtain the big model output content 105 required by the user 103.

[0037] Based on the above system architecture, the technical solution of the embodiment of the present disclosure is described in detail below.

[0038] Figure 2The flowchart of a method for generating prompt words according to an embodiment of the present disclosure is applicable to the case of generating user personalized prompt words for a model. The method can be executed by a prompt word generation device, which can be implemented in hardware and / or software and can be configured in an electronic device, preferably an electronic device that a user can directly input. Figure 2 , the method specifically includes the following:

[0039] S210, obtaining user input content;

[0040] S220, based on the constraints of the user knowledge base and / or the user intention rule base, use the intention recognition model to perform prompt word intention recognition on the user input content, and output a prompt word reflecting the user intention;

[0041] S230: Input the prompt word into the cloud model to obtain an output result.

[0042] The user input content may be the content input by the user to the input device. The user input content is used to describe the user's intention of what kind of feedback the cloud model expects. The restriction conditions for generating prompt words can be clearly defined based on the user input content, guiding the intention recognition model to generate prompt words that meet the user's expectations based on the user input content.

[0043] The user knowledge base can be a warehouse that centrally stores user-related knowledge and information. This knowledge can be quickly and accurately found and used after being sorted, classified and indexed. The user knowledge base may include at least one keyword, and personalized constraints can be formed based on each keyword to guide the intent recognition model to generate prompt words that meet user needs. At least one user intent rule is stored in the user intent rule base. The user intent rule is used to describe the personalized text description habits corresponding to the user, reflecting the mode of the user's description of the intention. The user intent rules corresponding to different users may be different.

[0044] Based on the constraints of the user knowledge base, the prompt word field and subject scope are defined for the user input content. For example, the prompt word is defined as a certain specialty in the medical field or a specific event in a historical period. Based on the constraints of the user intention rule base, the logical relationship between the prompt words is defined for the user input content. For example, in the user intention rule base, various intent categories related to permanent residence are divided in detail, such as consultation on permanent residence application conditions, inquiry on permanent residence application process, and discussion on permanent residence advantages. Different intent categories are given clear labels so that the intent recognition model can clearly identify the approximate intent scope to which the user input content belongs. When the user enters "I want to know what conditions need to be met to apply for XX permanent residence", the model can quickly classify it into the category of "consultation on permanent residence application conditions" based on the intent category label defined in the user intention rule base. The intent recognition model is used to identify the prompt word intent of the user input content, determine the intent corresponding to the user input content, and output the prompt word reflecting the user's intent. The prompt word is input into the cloud model, and the cloud model generates content related to the prompt word based on the prompt word to obtain the output result.

[0045] The technical solution of the disclosed embodiment, through the constraints of the user knowledge base and / or the user intention rule base, adopts the intention recognition model to identify the prompt word intention of the user input content, obtains the prompt word that meets the user needs, and implements the user-level prompt word optimization rewriting model, so that the cloud model can generate content that is more suitable for the user needs according to the prompt word, thereby improving the accuracy of the cloud model output content.

[0046] In the prior art, the prompt words for each user are generated through generalized processing of the cloud model. The cloud model cannot generate personalized prompt words for different user intentions of different users. Therefore, the user input content can be processed locally on the client to form prompt words that are more accurate and match the user's intentions, and then provided to the cloud.

[0047] Optionally, the user knowledge base, user configuration rules and intent recognition model are configured locally on the client, and the cloud model is configured on the cloud.

[0048] Specifically, the intent recognition model can quickly retrieve and access information in the user knowledge base and user configuration rules locally without relying on network connection. In particular, in the case of poor network environment or no network, the user knowledge base and user intent rule base can still be used normally to improve work efficiency. For example, in remote areas or places with poor network signals, data in the local user knowledge base and user intent rule base can still be quickly queried. According to the needs of different users, personalized user knowledge base and user intent rule base content can be customized locally for them. Each user can customize a dedicated user knowledge base and user intent rule base based on their work content, scope of responsibilities, interest preferences, usage habits and historical data. The intent recognition model can also be personalized trained and optimized locally to enable it to understand and predict the user's intention more accurately, and there is no need to purchase expensive cloud storage services or pay high traffic fees. The user knowledge base and user intent rule base can be built and used by using the storage resources of the local client, which reduces the cost of use. Cloud models are configured in the cloud. Configuring them in the cloud can dynamically allocate computing resources, such as CPU and GPU, according to the needs of the model, easily cope with high-concurrency requests or large-scale data processing tasks during peak hours, provide powerful computing power, enable the model to process complex tasks more quickly, and improve efficiency and performance.

[0049] Through the user knowledge base, user configuration rules and intent recognition model, which are configured locally on the client and the cloud model on the cloud, it is easy to obtain the user's local data, generate personalized prompt words for different users based on the local data of different users, and quickly generate user demand content through the cloud model, thereby improving the accuracy of user demand content generation.

[0050] Based on the above solution, the user knowledge base, user configuration rules and intent recognition model are configured locally on the client. Prompt words can be generated on the local client without uploading to the cloud, thus ensuring the privacy of user data. At the same time, the user's local privacy data can be accessed after user authorization.

[0051] Optionally, based on the constraints of the user knowledge base and / or the user intention rule base, an intent recognition model is used to identify the intent of prompt words on the user input content, and a prompt word reflecting the user intention is output, including: based on the constraints of the user knowledge base and / or the user intention rule base, an intent recognition model is used to identify the intent of prompt words on the user input content; based on the intention recognition results, the user privacy data stored locally on the client is called to generate prompt words.

[0052] Specifically, based on the constraints of the user knowledge base and / or the user intention rule base, the intention recognition model is used to identify the prompt word intention of the user input content to obtain the user intention type. If the data acquisition content corresponding to the user intention type is not the user's local private data, the user's local data can be directly called, and the intention recognition model generates a prompt word based on the called non-private data; if the data acquisition content corresponding to the user intention type is the user's local private data, the user authorization can be obtained. After the user authorization, the intention recognition model can call the user's private data stored locally on the client to generate a prompt word. For example, the user proposes, "Open xxx APP, fill in {account}:{password} on the login page to complete the login, and complete the screenshot operation of the xxx page content." Based on the constraints of the user knowledge base and / or the user intention rule base, the intention recognition model recognizes the user's software screenshot intention. The user can store private information such as account password in the client in advance, or the user can enter private information such as account password when the intention recognition model requests to call private data to apply for access rights. The intention recognition model obtains private information such as account password based on the recognized user intention, calls the user's private data stored locally on the client, and generates a prompt word.

[0053] Based on the constraints of the user knowledge base and / or the user intention rule base, the intent recognition model is used to recognize the prompt word intent of the user input content; according to the intention recognition result, the user privacy data stored locally on the client is called to generate prompt words, avoiding the risk of user privacy data being intercepted and stolen during transmission.

[0054] Based on the above solution, the user knowledge base can be configured locally on the user client, and the keyword data in the user knowledge base can be obtained based on the user's local data analysis, so that the intent recognition model can accurately recognize the user's intent based on the user input content.

[0055] Optionally, the user knowledge base includes at least one of the following keywords: domain-specific vocabulary, brand and product names, hobby-related vocabulary, and location-related vocabulary.

[0056] Specifically, the interaction data between the user and the device can be collected. For example, the interaction data can be the user's input data, user click data, user long-time browsing data, user collection data or user system log data in the historical time period, or actively input by the user to obtain the user knowledge base. The user knowledge base is a data warehouse that stores content and vocabulary that conforms to the user's expression habits or interests, which helps to more accurately identify the user's intention from the user's original input content. Examples of local vocabulary knowledge base content: specific field vocabulary: such as "symptoms" and "diagnosis" in the medical field; "litigation" and "regulations" in the legal field; "curriculum system" and "teaching methods" in the education field; "algorithms" and "data structures" in the computer science field; "target market" and "brand positioning" in the marketing field; "stocks" and "funds" in the financial field. Brand and product names: electronic products, cosmetics brands, vehicle brands, air conditioning brands and clothing brands, etc. Users can selectively store the names of their preferred products. Hobby-related words: such as sports hobbies such as "basketball" and "football"; musical instrument hobbies such as "piano" and "ukulele"; extreme sports hobbies such as "skydiving", "diving" and "rock climbing"; cultural and artistic hobbies such as "painting" and "music". Location-related words: covering city landmarks such as "Forbidden City" and "Eiffel Tower"; tourist attraction types such as "beach" and "ancient town"; urban and rural types such as "town", "village" and "suburbs"; place building types such as "school", "hospital" and "supermarket"; location relationship types such as "west", "east" and "above"; location environment types such as "beautiful", "clean" and "polluted". Keywords can be classified and stored separately in the user knowledge base.

[0057] By acquiring extensive historical data corresponding to users and establishing a user knowledge base, the user's intention can be quickly defined based on the user input content and the user knowledge base, thus improving the efficiency of defining the prompt word field and ensuring the accuracy of prompt word generation.

[0058] Based on the above solution, the user intention rule library can be configured locally on the user client, and the intention rules in the user intention rule library can be obtained based on the user's local data analysis, so that the intention recognition model can accurately recognize the user's intention based on the user input content.

[0059] Optionally, user intent rules are used to determine intent types; the rule pattern of user intent rules includes at least one of the following: determining the corresponding intent type based on at least one keyword; determining the corresponding intent type based on the order of appearance and / or logical relationship of at least two keywords.

[0060] Specifically, user intent rules can be used to describe the user's language expression habits, interest preferences or behavior habits. For example, the user's search keywords, browsed pages or clicked links in the client's local historical time period can be accessed. By analyzing these historical data, user intent rules can be obtained. For example, if the user often searches for content related to electronic products, then when he enters some vague words, the system can combine his historical behavior and tend to understand his intention as related to electronic products. User intent rule content example: Combined with vocabulary to determine the intent type: When containing words such as "product name" and "fault", the intention is to check product maintenance information; words such as "buy", "book" and "download" are intended to perform a task; words such as "find", "search" and "understand" are intended to obtain information; and words such as "go to", "open" and "visit" are intended to navigate to a web page information; there are words such as "tourist attractions" and "ticket prices", and the intention is to check the ticketing or opening hours of tourist attractions; there are words such as "I like" and "I want" that express personal preferences or needs, and there is an intention to obtain related products, services or information. Determine the intention based on the word order and logical relationship: starting with "recommendation" followed by related content, the intention is to obtain recommended information; "compare" appears first followed by brand and product type words, the intention is to compare related products; when the user input content matches words such as "query" and "Andersen's fairy tales", the intention is to find content related to Andersen's fairy tales; when the user input content matches words such as "answer" and "the world's highest peak", the intention is to obtain the answer to the world's highest peak; when the user input content matches words such as "calculate" and "1+1", the intention is to calculate the answer to the formula.

[0061] Through user intention rules, even when user input is unclear, the real needs and purposes expressed by the text information entered by the user can be accurately understood, thereby generating prompt words that are more in line with user expectations, avoiding the situation where the prompt words deviate from the user's original intention, and effectively improving the accuracy of prompt word generation.

[0062] Figure 3 This is a flow chart of a method for generating prompt words provided by another embodiment of the present disclosure. Based on the above embodiments, this embodiment further optimizes the specific scheme for generating prompt words. Figure 3 As shown:

[0063] S310, obtaining user input content;

[0064] S320, based on the constraints of the user knowledge base and / or the user intention rule base, use the intention recognition model to perform prompt word intention recognition on the user input content, and output a prompt word reflecting the user intention;

[0065] The above operation S320 specifically includes the following:

[0066] S311, performing word segmentation on the user input content and performing similarity recognition with keywords in the user knowledge base;

[0067] S312, marking, replacing and / or expanding the original words in the user input content that meet the preset similarity conditions according to the similarity recognition result;

[0068] S313, forming a text feature vector according to the words after the marking, replacement and / or expansion operations;

[0069] S314: Input the text feature vector into the intention recognition model to output a prompt word reflecting the user's intention.

[0070] S314: Input the prompt word into the cloud model to obtain an output result.

[0071] Specifically, the user input content can be segmented, and the word segmentation methods include but are not limited to: forward maximum matching method, reverse maximum matching method, two-way maximum matching method, N-gram model, decision tree and support vector machine (SVM), etc., which are not limited in the embodiments of the present disclosure.

[0072] The words after word segmentation are identified with the keywords in the user knowledge base to obtain the similarity value between the words after word segmentation and the keywords in the user knowledge base. Similarity identification methods include but are not limited to: synonym dictionary method, cosine similarity algorithm, Euclidean distance algorithm or Manhattan distance algorithm, which are not limited in the embodiments of the present disclosure. A similarity threshold can be preset, and each similarity value can be compared with the similarity threshold to obtain a similarity identification result.

[0073] If there are similar words in the user input content in the user knowledge base, it means that the two words have the same attributes. For example, the attributes can be the grouping of words or the field to which the words belong. According to the similarity recognition result, the attribute information corresponding to the similar keywords in the user knowledge base is obtained, and the original words in the user input content that meet the preset similarity conditions are annotated according to the attribute information. It can help the intention recognition model to understand the specific tasks expected by the user more clearly. For example, there is a word "roujiamo" in the user input content, and the similar keyword matched in the user knowledge base is "lean roujiamo", and the attributes corresponding to "lean roujiamo" are "Shaanxi" and "local snacks", then "roujiamo" is annotated as "Shaanxi" and "local snacks". The intention recognition model can analyze the annotated content, so as to generate prompt words that are more in line with the actual situation of the product and the user's expectations in a more targeted manner, and enhance the relevance of the prompt words to the user input content. By annotating the vocabulary attributes, the input data or its weight of the intention recognition model can be changed, thereby adjusting the output results when the intention recognition model recognizes.

[0074] According to the similarity recognition results, the original words in the user input content that meet the preset similarity conditions can also be replaced with words that meet the preset similarity conditions. Different words may have similar meanings, but the frequency of use and expression effects may be different in different contexts. By replacing similar words, various possible semantic expressions can be more comprehensively covered, so that the intention recognition model can more accurately understand the intention of the user input and avoid misunderstandings caused by the limited understanding of specific words. Furthermore, different users have different language expression habits. Using similar word replacement can make the prompt words closer to the user's natural language style, making it easier for the intention recognition model to understand the user's input, thereby generating output that is more in line with user expectations. For example, replace "storytelling" with "search for fairy tales"; replace "disease diagnosis" with "symptom judgment" or "disease analysis"; "data preprocessing" is replaced with "pre-data processing" or "initial data processing", and "text generation" can be changed to "text creation" or "copywriting".

[0075] Based on the similarity recognition results, the original vocabulary in the user input content that meets the preset similarity conditions can also be expanded. The user input content may be relatively concise or the expression may not be accurate. Through similar word expansion, richer semantic information can be provided to the intent recognition model to help the model understand the user's intentions and needs more comprehensively and accurately. For example, when the user inputs "beautiful flowers" and expands to similar words such as "pretty flowers" and "good-looking flowers", the model can more clearly understand that the user is describing the appearance attributes of the flower. There are many cases of polysemous words in natural language. Similar word expansion can help the intent recognition model to determine the specific meaning of the words used by the user to a certain extent and reduce ambiguity. For example, the word "apple" can refer to both fruit and Apple. When similar expressions such as "fruit apple" or "Apple" are expanded, the intent recognition model can understand what the user means more accurately.

[0076] A text feature vector is formed based on the words after the annotation, replacement and / or expansion operations. The method for generating the text feature vector may be: one-hot encoding vectorization algorithm or N-gram algorithm, etc. The text feature vector is input into the intent recognition model to output a prompt word reflecting the user's intent.

[0077] The technical solution of the disclosed embodiment optimizes the user input content by marking, replacing and / or expanding the original words in the user input content that meet the preset similarity conditions, providing richer semantic information for the intent recognition model, so that the intent recognition model can more accurately understand the user's intention and improve the accuracy of prompt word generation.

[0078] Based on the above solution, the contents of the user knowledge base and the user intention rule base can be continuously customized or automatically updated.

[0079] Optionally, the method for generating prompt words also includes at least one of the following: extracting keywords based on historical user input content, according to the frequency of occurrence or the occurrence rule, and adding them to the user knowledge base; extracting user intention rules based on historical user input content and the rule template, and adding them to the user intention rule base; updating the user knowledge base and / or user intention rule base based on the keywords and / or user intention rules input by the user.

[0080] Specifically, a frequency threshold can be preset to identify historical user input content, and obtain at least one word and the corresponding frequency of occurrence of each word. The frequency of occurrence corresponding to each word is compared with the frequency threshold, and the word with an occurrence frequency greater than the frequency threshold is determined as a keyword. The historical user input content can also be matched with the occurrence rules to obtain a word that matches the occurrence rules, and the word can be determined as a keyword. According to the frequency of occurrence or the occurrence rules, keyword extraction is performed, and after obtaining at least one keyword, the keyword is added to the user knowledge base. For example, in a technical support knowledge base, if users' questions and related keywords about a specific function of a software appear multiple times, the system can prepare more accurate and detailed answers to the problem points involved in these keywords to avoid inaccurate answers due to misunderstandings.

[0081] Rule templates can be preset. Rule templates can be predefined text structures or formats that are used to guide the intent recognition model to generate specific types of text. Rule templates can contain slots. By reserving specific positions in the template, the corresponding slot information can be filled in according to the specific input, thereby generating more targeted and accurate text. For example, in a travel consultation template, there can be a question template such as "What are the famous attractions in [destination]?", where "[destination]" is a slot. The intent recognition model can fill the slot according to the specific destination entered by the user and generate specific questions such as "What are the famous attractions in Beijing?" According to the rule template, user intent rules are extracted and added to the user intent rule library.

[0082] By extracting keywords or user intent rules through historical user input content, updating the user knowledge base and / or user intent rule base, and analyzing historical input, we can more accurately grasp users' common problems, concerns, and questioning habits, so that when faced with new questions, we can more accurately understand user intent and give answers that better meet user needs.

[0083] Figure 4 This is a flow chart of a method for generating prompt words provided by another embodiment of the present disclosure. Based on the above embodiments, this embodiment further provides a specific solution for generating prompt words. Figure 4 As shown:

[0084] S410, obtaining user input content;

[0085] S420, based on the constraints of the user knowledge base and / or the user intention rule base, use the intention recognition model to perform prompt word intention recognition on the user input content, and output a prompt word reflecting the user intention;

[0086] The above operation S420 specifically includes the following:

[0087] S421, matching the user input content with the user intention rules in the user intention rule library;

[0088] S422: Determine the preliminary intention type of the user input content based on the matching results.

[0089] S430, forming a text feature vector according to the user input content and the preliminary intention type;

[0090] S440: Input the text feature vector into the intention recognition model to output a prompt word reflecting the user's intention.

[0091] S450: Input the prompt word into the cloud model to obtain an output result.

[0092] Specifically, the user input content is matched with the user intent rules in the user intent rule library. The matching method can be based on keyword matching to find out whether the user input content contains keywords that are completely consistent with the user intent rule library. For example, there is an intent rule of "query weather" in the user intent rule library. When the user enters "query Beijing weather", the rule can be accurately matched, thereby determining that the user's initial intent type is to query the weather; it can also be matched according to variant forms such as synonyms and near synonyms of keywords. For example, when the user enters "find weather conditions", although it is not exactly the same as the expression of "query weather", it can be matched with the intent rule of querying weather through fuzzy matching, because "find" and "query", "condition" and "weather" have similar semantics; it can also be matched according to regular expressions. For example, for input in date format, a regular expression pattern can be defined to match various common date representations, such as "\d{4}-\d{2}-\d{2}" can match a date in the year-month-day format such as "2024-12-05", thereby identifying that the user's initial intent type is to query the date. According to the user input content and preliminary intent type, a text feature vector is formed, and the semantic and grammatical information in the text is expressed in the form of a mathematical vector. The formation of a text feature vector can reduce the dimensionality of the data and map the high-dimensional text data to a low-dimensional vector space. While retaining key information, it reduces the storage space and computational complexity of the data, allowing the computer to quantify and analyze the text and better understand the text content. The text feature vector is input into the intent recognition model to output a prompt word that reflects the user's intent.

[0093] The technical solution of the disclosed embodiment obtains the user's preliminary intention type by matching the user input content with the user intention rules in the user intention rule library, and guides the intention recognition model to generate prompt words that meet the user's intention through the preliminary intention type constraints.

[0094] Based on the technical solutions of the above embodiments, after the prompt word is generated, it can be directly transmitted to the cloud model or submitted to the cloud model after confirmation by the user.

[0095] Optionally, a method for generating prompt words also includes: displaying the generated prompt words and / or output results to the user; obtaining user feedback on the prompt words and / or output results based on user operations; generating positive samples or negative samples based on the feedback, user input content and prompt words; and using positive samples or negative samples to train and update the intent recognition model.

[0096] Specifically, the generated prompt words and / or output results are displayed to the user; the user can analyze whether the prompt words and / or output results meet the user's needs and provide feedback through user operations. For example, the "Submit" and "Regenerate Prompt Words" controls are set. If the user clicks "Submit", it means that the content of the prompt words is recognized. If the user clicks "Regenerate Prompt Words", it means that the currently generated prompt words are not recognized. The user can also provide feedback for each prompt word separately. For example, the user can provide feedback by double-clicking the mouse to select the prompt word that meets the needs or by liking and collecting the prompt word. If the user double-clicks the mouse to select or likes the prompt word, it means that the word meets the user's needs; if the user does not do anything with the prompt word, it means that the prompt word does not meet the user's needs.

[0097] You can also design a concise and clear questionnaire and send it to users through website pop-up windows, etc., to ask users about their satisfaction, usefulness, and whether they meet their expectations with the prompt words and / or output results, and ask users to give specific scores for their satisfaction with the prompt words. You can also collect user behavior data related to the prompt words and output results, such as the time when the output results are viewed, whether the output results are modified or queried again, etc. For example, if it is found that users frequently modify the prompt words or re-query, it may mean that the output results fail to meet their expectations. Based on user operations, obtain user feedback on the prompt words and / or output results, generate positive samples or negative samples based on the feedback, as well as the user input content and prompt words, and use the positive samples or negative samples to retrain the intent recognition model.

[0098] The generated prompt words and / or output results are displayed to the user, and the user's feedback on the prompt words and / or output results, as well as the user input content and prompt words are obtained based on the user operation, to generate positive samples or negative samples, and train and update the intent recognition model. Different intent recognition models can be trained according to the feedback of different users, which helps the intent recognition model to have higher recognition accuracy and provide each user with a personalized intent recognition model.

[0099] Optionally, obtaining user feedback on the prompt word and / or output result based on the user operation includes at least one of the following: obtaining the score as feedback based on the user's satisfaction with the prompt word and / or output result; obtaining positive feedback based on the user's confirmation submission operation on the prompt word; obtaining negative feedback based on the user's negative submission operation on the prompt word.

[0100] Specifically, the user operation may be to score the prompt word and / or the output result, and a score threshold may be preset. If the user score is greater than or equal to the preset score threshold, it indicates that the user is satisfied with the prompt word and meets the user's expectations, and the prompt word and / or the output result are determined as positive samples; if the user score is less than the preset score threshold, it indicates that the prompt word does not meet the user's needs, and the prompt word and / or the output result are determined as negative samples. The set of samples corresponding to the prompt word and / or the output result may also be determined based on the user's feedback operation. For example, if the user clicks to regenerate the prompt word and / or the output result after receiving the prompt word and / or the output result, it indicates that the prompt word does not meet the user's needs, and the prompt word and / or the output result are determined as negative samples; if the user clicks to confirm the prompt word and / or the output result after receiving the prompt word and / or the output result, it indicates that the user is satisfied with the prompt word and that an answer or result that meets the expectations can be generated according to the prompt word, and the prompt word and / or the output result are determined as positive samples. We can also determine positive samples based on the prompt words corresponding to positive behaviors such as collecting or liking, and negative samples based on the prompt words corresponding to negative behaviors such as users clicking dislike, deleting or blocking. Based on the above method to determine the user's selection preferences, more targeted positive and negative samples can be generated to increase the accuracy of the model's customized prompt words for different users.

[0101] Through the user's satisfaction rating of the prompt word and / or the output result, the user's confirmation submission operation for the prompt word or the user's negative submission operation for the prompt word, and the user's feedback, the result that meets the user's expectations is determined. According to these feedbacks, the intent recognition model is adjusted and optimized to generate prompt words more accurately. The technical solution of the embodiment of the present disclosure can realize the user-level prompt word optimization rewriting model, that is, the intent recognition model, which can be optimized by self-iteration.

[0102] Figure 5 This is a flow chart of a method for generating prompt words provided in yet another embodiment of the present disclosure. This embodiment optimizes the method for generating prompt words based on the previous embodiments.

[0103] S510, obtaining user input content;

[0104] The above operation S510 specifically includes the following:

[0105] S511, obtaining at least one of text, image and / or voice input by the user, and converting the non-text content into text form;

[0106] S520, based on the constraints of the user knowledge base and / or the user intention rule base, use the intention recognition model to perform prompt word intention recognition on the user input content, and output a prompt word reflecting the user intention;

[0107] S530: Input the prompt word into the cloud model to obtain an output result.

[0108] Among them, images can intuitively present visual information such as the appearance, color, shape, etc. of an object, while text can more accurately express abstract concepts, logical relationships, and detailed descriptions. At least one of the text, picture, and / or voice input by the user is obtained. If the user input is text, for example, question text, such as "Why is the sky blue?", description text, such as "Describe the ecosystem of the tropical rainforest", and instruction text, such as "Help me correct the grammatical errors in this text". The user input content can also be a single or multiple keywords, allowing the intention recognition model to generate relevant prompt words around these keywords. For example, if "environmental protection" and "new energy vehicles" are input, the user's corresponding intention can be about the relationship between environmental protection and new energy vehicles, the significance of new energy vehicles to environmental protection, and the impact of environmental protection goals on the development of new energy vehicles. If the user input is voice, the voice is converted into text through a voice-to-text conversion algorithm; if the user input is a picture, the picture can be image recognized to obtain at least one description text; then the converted text is input into the intention recognition model to generate prompt words under constraints. For example, when the user inputs a picture, the picture is identified to determine its core theme, main elements, color or composition and other details. For example, a picture of a sunrise at the seaside, the theme is sunrise, the main elements are the sea, the sun and clouds, the color is mainly orange-red, and the sun is located in the upper center of the picture in the composition. Based on this information, prompt words such as "sunrise at the seaside" and "magnificent scenery" can be generated. The large model is not limited to the input form and can comprehensively understand multiple types of information, making human-computer interaction more natural and smooth. Different types of input data often contain information of different dimensions. Users can choose the most suitable input method according to their own situation and specific scenarios, give full play to their respective expression advantages, and convey information and intentions more accurately.

[0109] By obtaining at least one of the text, picture and / or voice input by the user and converting the non-text content into text form, different forms of input content can be converted to generate prompt words, without limiting the input form, making human-computer interaction more convenient. It can also use multi-dimensional data to more accurately understand user needs and improve the accuracy of prompt word generation.

[0110] Based on the technical solutions of the above-mentioned embodiments, when determining the user intention according to the constraints of the user knowledge base and the user intention rule base, the context content corresponding to the user input content can also be obtained, and the user intention can be determined according to the preceding content of the user input content and the constraints of the user knowledge base and / or the user intention rule base.

[0111] Optionally, based on the constraints of the user knowledge base and / or the user intention rule base, an intention recognition model is used to identify the intention of prompt words on the user input content, and outputting prompt words reflecting the user intention, including: obtaining at least one historical user input content preceding the current user input content; based on the constraints of the user knowledge base and / or the user intention rule base, an intention recognition model is used to identify the intention of prompt words on the current user input content and the historical user input content, and outputting prompt words reflecting the user intention.

[0112] Specifically, the user input content at the current time can be obtained, and according to the input time or input order identifier of the current input content, at least one previous historical user input content corresponding to the current user input content can be queried. At least one historical user input content is used as context and provided to the intent recognition model together with the current user input content. Based on the constraints of the user knowledge base and / or the user intent rule base, the intent recognition model is used to perform prompt word intent recognition on the current user input content and the historical user input content to obtain the intent of the current input, thereby generating prompt words more accurately.

[0113] Furthermore, if the multi-round input content contains not only text but also other modal information such as images or voice, a multimodal fusion method can be used to identify the intent. For example, the user may have entered a text question and uploaded related pictures or voice instructions. The intent recognition model can extract key information from the picture through image recognition technology, convert the voice into text through voice recognition technology, and then fuse these multimodal information with the original text input to more comprehensively understand the user's intent and generate the corresponding prompt words for the user.

[0114] By obtaining at least one historical user input content preceding the current user input content, based on the constraints of the user knowledge base and / or the user intention rule base, an intention recognition model is used to identify the prompt word intention. Combining the historical input content is conducive to obtaining more descriptive information of the intent, reducing ambiguity, and improving the accuracy of prompt word generation.

[0115] For example, Figure 6 The figure shows a flow chart of a prompt word generation method. The method comprises:

[0116] S601, the user can input an audio file;

[0117] S602, converting speech to text by calling speech_to_text function;

[0118] S603: If the text is empty, it indicates that the user has not input valid voice content, and the process ends without generating prompt words, and prompts that no valid text input has been obtained;

[0119] S604, if the text is not empty, call the preprocess_text function to preprocess the text;

[0120] S605, remove text noise and punctuation marks, call the generate_prompts function, start the intent recognition model, and generate prompt words (prompt);

[0121] S606, prompting the user to input a satisfaction score for each prompt;

[0122] S607, calling the update_model function of SelfLearningMechanism to perform self-learning update model and update the intent recognition model;

[0123] S608. Output each prompt.

[0124] According to an embodiment of the present disclosure, Figure 7 1 is a structural diagram of a prompt word generation device in an embodiment of the present disclosure, and the present disclosure embodiment is applicable to the generation of prompt words. The device is implemented by software and / or hardware, and is specifically configured in an electronic device with certain data computing capabilities.

[0125] like Figure 7 The device 700 for generating a prompt word shown in the figure comprises: a content acquisition module 701, an intention recognition module 702 and a result acquisition module 703.

[0126] Content acquisition module 701, used to acquire user input content;

[0127] The intention recognition module 702 is used to recognize the prompt word intention of the user input content based on the constraints of the user knowledge base and / or the user intention rule base using the intention recognition model, and output the prompt word reflecting the user intention;

[0128] The result acquisition module 703 is used to input the prompt word into the cloud model to obtain the output result.

[0129] According to the technical solution disclosed in the present invention, through the constraints of the user knowledge base and / or the user intention rule base, an intention recognition model is used to identify the prompt word intention of the user input content, and the prompt word reflecting the user's intention is obtained and input into the cloud model to obtain the output result. Data content that meets the user's personalized needs can be obtained, thereby improving the accuracy of the cloud model output content.

[0130] Optionally, the user knowledge base, user configuration rules and intent recognition model are configured locally on the client, and the cloud model is configured on the cloud.

[0131] Furthermore, the intention recognition module 702 is specifically used for:

[0132] Perform word segmentation on the user input content and identify similarities with keywords in the user knowledge base;

[0133] Based on the similarity recognition results, the original words in the user input content that meet the preset similarity conditions are marked, replaced and / or expanded;

[0134] Forming a text feature vector based on the words after the annotation, replacement and / or expansion operations;

[0135] The text feature vector is input into the intent recognition model to output prompt words that reflect the user's intent.

[0136] Furthermore, the intention recognition module 702 is specifically used for:

[0137] Match the user input content with the user intent rules in the user intent rule library;

[0138] Based on the matching results, determine the preliminary intention type of the user's input content;

[0139] Form a text feature vector based on the user input content and preliminary intention type;

[0140] The text feature vector is input into the intent recognition model to output prompt words that reflect the user's intent.

[0141] Furthermore, the content acquisition module 701 is specifically used for:

[0142] At least one of text, image and / or voice input by the user is obtained, and the non-text content is converted into text form.

[0143] Furthermore, the user knowledge base includes at least one of the following keywords: domain-specific vocabulary, brand and product names, hobby-related vocabulary, and location-related vocabulary.

[0144] Furthermore, the user intent rule is used to determine the intent type; the rule pattern of the user intent rule includes at least one of the following: determining the corresponding intent type based on at least one keyword; determining the corresponding intent type based on the appearance order and / or logical relationship of at least two keywords.

[0145] Furthermore, the prompt word generating device further includes at least one of the following:

[0146] The keyword extraction module is used to extract keywords based on the historical user input content, according to the frequency of occurrence or occurrence rules, and add them to the user knowledge base;

[0147] The rule extraction module is used to extract user intent rules based on historical user input content and rule templates, and add them to the user intent rule library;

[0148] The data updating module is used to update the user knowledge base and / or the user intention rule base according to the keywords and / or user intention rules input by the user.

[0149] Furthermore, the prompt word generating device further includes:

[0150] A result display module, used to display the generated prompt words and / or output results to the user;

[0151] An opinion acquisition module, used to acquire user feedback on prompt words and / or output results based on user operations;

[0152] The sample generation module is used to generate positive samples or negative samples based on feedback, user input content and prompt words;

[0153] The model training module is used to update the intent recognition model using positive or negative sample training.

[0154] Furthermore, the opinion acquisition module is specifically used for:

[0155] Based on the user's satisfaction rating of the prompt word and / or the output result, the score is obtained as feedback;

[0156] Based on the user's confirmation submission operation for the prompt word, obtaining feedback as positive feedback;

[0157] Based on the user's negative submission operation for the prompt word, a feedback opinion as negative feedback is obtained.

[0158] Furthermore, the intention recognition module 702 is specifically used for:

[0159] Based on the constraints of the user knowledge base and / or the user intention rule base, an intention recognition model is used to recognize the prompt word intention of the user input content;

[0160] Based on the intent recognition results, the user privacy data stored locally on the client is called to generate prompt words.

[0161] Furthermore, the intention recognition module 702 is specifically used for:

[0162] Obtain at least one historical user input content preceding the current user input content;

[0163] Based on the constraints of the user knowledge base and / or the user intention rule base, an intention recognition model is used to recognize the prompt word intention of the current user input content and the historical user input content, and a prompt word reflecting the user intention is output.

[0164] The above-mentioned prompt word generation device can execute the prompt word generation method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of executing the prompt word generation method.

[0165] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0166] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0167] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0168] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0169] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0170] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as the generation method of the prompt word. For example, in some embodiments, the generation method of the prompt word may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the generation method of the prompt word described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the generation method of the prompt word in any other appropriate manner (e.g., by means of firmware).

[0171] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0172] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0173] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0174] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0175] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0176] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services. The server may also be a server of a distributed system, or a server combined with a blockchain.

[0177] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.

[0178] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.

[0179] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution provided by this disclosure can be achieved, and this document does not limit this.

[0180] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for generating a prompt word, the method comprising: Get user input; Based on the constraints of the user knowledge base and / or the user intention rule base, an intention recognition model is used to perform prompt word intention recognition on the user input content, and a prompt word reflecting the user intention is output; The prompt word is input into the cloud model to obtain an output result.

2. The method according to claim 1, wherein: The user knowledge base, user configuration rules and intent recognition model are configured locally on the client, and the cloud model is configured on the cloud.

3. The method according to claim 1, wherein: Based on the constraints of the user knowledge base, the intention recognition model is used to perform prompt word intention recognition on the user input content, and the prompt word reflecting the user intention is output, including: Perform word segmentation on the user input content and identify similarities with keywords in the user knowledge base; According to the similarity recognition result, the original words in the user input content that meet the preset similarity condition are marked, replaced and / or expanded; Forming a text feature vector based on the words after the annotation, replacement and / or expansion operations; The text feature vector is input into the intention recognition model to output a prompt word reflecting the user's intention.

4. The method according to claim 1, wherein: Based on the constraints of the user intention rule library, the intention recognition model is used to perform prompt word intention recognition on the user input content, and the prompt word reflecting the user intention is output, including: Matching the user input content with the user intention rules in the user intention rule library; Determining the preliminary intention type of the user input content according to the matching result; Forming a text feature vector according to the user input content and the preliminary intention type; The text feature vector is input into the intention recognition model to output a prompt word reflecting the user's intention.

5. The method according to claim 1, wherein: The obtaining of user input content comprises: At least one of text, image and / or voice input by the user is obtained, and the non-text content is converted into text form.

6. The method according to claim 1, wherein: The user knowledge base includes at least one of the following keywords: domain-specific vocabulary, brand and product names, hobby-related vocabulary, and location-related vocabulary.

7. The method according to claim 1, wherein: The user intent rule is used to determine the intent type; the rule mode of the user intent rule includes at least one of the following: determining the corresponding intent type based on at least one keyword; The corresponding intent type is determined based on the appearance order and / or logical relationship of at least two keywords.

8. The method according to claim 1, further comprising at least one of the following: Based on historical user input content, keywords are extracted according to the frequency of occurrence or occurrence rules, and added to the user knowledge base; According to historical user input content and rule templates, user intent rules are extracted and added to the user intent rule library; The user knowledge base and / or user intention rule base is updated according to the keywords and / or user intention rules input by the user.

9. The method according to any one of claims 1 to 8, further comprising: Displaying the generated prompt word and / or the output result to the user; Obtaining user feedback on the prompt word and / or output result based on the user operation; Generate positive samples or negative samples according to the feedback, the user input content and the prompt word; The positive sample or negative sample is used to train and update the intent recognition model.

10. The method according to claim 9, wherein: Obtaining user feedback on the prompt word and / or output result based on the user operation includes at least one of the following: Based on the user's satisfaction rating of the prompt word and / or the output result, a score is obtained as the feedback; Based on the user's confirmation submission operation for the prompt word, obtaining feedback as positive feedback; Based on the user's negative submission operation for the prompt word, feedback opinion as negative feedback is obtained.

11. The method according to any one of claims 1 to 8, wherein: Based on the constraints of the user knowledge base and / or the user intention rule base, the intention recognition model is used to recognize the prompt word intention of the user input content, and the prompt word reflecting the user intention is output, including: Based on the constraints of the user knowledge base and / or the user intention rule base, using the intention recognition model to perform prompt word intention recognition on the user input content; Based on the intent recognition results, the user privacy data stored locally on the client is called to generate prompt words.

12. The method according to any one of claims 1 to 8, wherein: Based on the constraints of the user knowledge base and / or the user intention rule base, the intention recognition model is used to perform prompt word intention recognition on the user input content, and the prompt words reflecting the user intention are output, including: Obtain at least one historical user input content preceding the current user input content; Based on the constraints of the user knowledge base and / or the user intention rule base, an intention recognition model is used to perform prompt word intention recognition on the current user input content and the historical user input content, and a prompt word reflecting the user intention is output.

13. A device for generating a prompt word, comprising: Content acquisition module, used to acquire user input content; An intention recognition module, configured to recognize the prompt word intention of the user input content using an intention recognition model based on the constraints of a user knowledge base and / or a user intention rule base, and output a prompt word reflecting the user intention; The result acquisition module is used to input the prompt word into the cloud model to obtain the output result.

14. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for generating prompt words according to any one of claims 1 to 12.

15. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable the computer to execute the method for generating prompt words according to any one of claims 1-12.

16. A computer program product, comprising a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the method for generating a prompt word according to any one of claims 1 to 12.

Citation Information

Cited By

  • Tobacco enterprise customer classification and grading method and system based on sentiment analysis

    CN120144763A

  • A method and system for classifying and grading tobacco enterprise customers based on sentiment analysis

    CN120144763B

  • Intelligent menu generation method based on LLM large model and intelligent cooking utensil

    CN120373476A

  • An intelligent recipe generation method based on LLM large model and intelligent cooking kitchenware

    CN120373476B

  • Data query method and device based on cloud search service, equipment and medium

    CN120492482A