Intention recognition method, large language model, electronic equipment and medium
By optimizing the propt and intent classification processing of large language models, the problems of high computational complexity and poor scalability in the existing technology are solved, efficient and flexible intent recognition are achieved, and the response speed and user experience of the model are improved.
Patent Information
- Application Number
- CN202510363778.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-03-26
AI Technical Summary
In information retrieval and natural language processing, the calculation complexity, long processing time, and poor scalability and flexibility in the use of large language models for intention recognition, resulting in high cost of model deployment and update, making it difficult to adapt to the needs of different fields.
By designing and optimizing the propt that interacts with the large language model, intent classification processing is carried out, and using few sample prompts and preset process arrangements can reduce computing resource requirements, quickly adjust model output, and adapt to different application scenarios.
It improves the response speed and intent matching of the model, reduces the computing resource requirements, enhances the flexibility and scalability of the model, and improves the user experience.
Smart Images

Figure CN120353891A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and particularly relates to an intention recognition method, a large language model, an electronic device, and a medium. Background Art
[0002] In the fields of information retrieval (IR) and natural language processing (NLP), a Retriever is usually used to find embeddings similar to the simulation intention input by the user from the embedding space. This process usually involves converting the user input (such as a query statement) into a point in a high-dimensional vector space, and then finding the closest vector to it in this space. These vectors usually correspond to pre-indexed documents, questions, or other forms of text data. By calculating the similarity scores (such as cosine similarity, Euclidean distance, etc.) between these vectors, the model can evaluate and rank these candidates, and finally return the result that best matches the user's intention.
[0003] This method has a high computational complexity, a long processing time, and a large dependence on the embedding model, and is not suitable for small scenarios. In some existing technical solutions, the large language model is pre-finetuned so that the model can meet different specific scenarios. However, finetuning the model requires additional computing resources and time, especially when dealing with large language models, which increases the cost of model deployment and update. Moreover, this method has poor scalability, and the model needs to be re-finetuned accordingly for different fields, further increasing the model training cost. Summary of the Invention
[0004] The present invention aims to solve one of the technical problems in the related art to a certain extent. For this purpose, the present invention provides an intention recognition method, a large language model, an electronic device, and a medium, which have the advantages of high efficiency, strong intention understanding ability, high flexibility, strong scalability, and good noise reduction ability.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] An intention recognition method, comprising:
[0007] Obtain the natural language to be processed;
[0008] Perform intention classification processing on the natural language to be processed according to the first prompt word, and obtain a first intention recognition result and the processed language;
[0009] Generate target content corresponding to the natural language to be processed according to the first intention recognition result and the processed language.
[0010] By designing and optimizing the prompts for interacting with large language models, the model output is adjusted without large-scale computationally intensive training, reducing the model application cost and the computational resources required by the model. Moreover, developers can quickly adjust the prompts according to specific application scenarios and specific requirements without retraining the model, with high flexibility and strong scalability.
[0011] By performing intent classification processing on the natural language to be processed and executing different target content generation steps according to different types of user intents, the steps of intent recognition are reduced for easily recognizable intent types, and the corresponding target content is directly generated. For more difficult-to-recognize intent types, more refined intent recognition steps are carried out, thereby reducing unnecessary computational resources of the model. While accelerating the model response speed, it also improves the matching degree and accuracy between the model output and the user's true intent, enhancing the user experience.
[0012] Optionally, the first intent recognition result includes a knowledge Q&A intent and a simulation process intent. The generating of the target content corresponding to the natural language to be processed according to the first intent recognition result and the processed language includes:
[0013] When the first intent recognition result is a knowledge Q&A intent, the information related to the processed language in the corpus is integrated to generate the target content corresponding to the natural language to be processed;
[0014] When the first intent recognition result is a simulation process intent, intent recognition processing is performed on the processed language according to a second prompt to obtain at least one second intent recognition result;
[0015] According to the second intent recognition result, the target content corresponding to the natural language to be processed is generated.
[0016] Optionally, the performing of the second intent recognition on the natural language to be processed according to the second prompt to obtain the second intent recognition result when the first intent recognition result is a simulation process intent includes:
[0017] When the first intent recognition result is a simulation process intent, at least one second intent recognition result is obtained in sequence according to the second prompt and a preset process arrangement;
[0018] The generating of the target content corresponding to the natural language to be processed according to the second intent recognition result includes:
[0019] The information corresponding to at least one of the second intent recognition results in the corpus is integrated to generate the target content corresponding to the natural language to be processed.
[0020] Optionally, when the preset process orchestration includes at least two intent confirmation processes, the multiple second intent recognition results are fused to obtain a third intent recognition result;
[0021] Integrate the information in the corpus corresponding to the third intent recognition result to generate the target content corresponding to the natural language to be processed.
[0022] Optionally, the preset process orchestration includes at least one of simulation type intent, simulation performance intent, simulation architecture intent, simulation model intent, simulation parameter intent, start simulation intent, confirmation template intent, and generate report intent.
[0023] Optionally, the form of the first prompt includes few-shot prompts; the few-shot prompts include example questions, reasoning steps, and answers.
[0024] Optionally, the few-shot prompts further include guiding questions similar to the example questions.
[0025] In addition, the present invention also provides a large language model, including:
[0026] An intent recognition module, configured to obtain the natural language to be processed, and to perform intent classification processing on the natural language to be processed according to the first prompt to obtain a first intent recognition result and the processed language;
[0027] A target content output module, configured to generate the target content corresponding to the natural language to be processed according to the first intent recognition result and the processed language.
[0028] The beneficial effect inference process of the large language model provided by the present invention is similar to that of the foregoing intent recognition method, and will not be elaborated here.
[0029] Moreover, the present invention also provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the intent recognition method described in any one of the above is implemented.
[0030] Meanwhile, the present invention also provides a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processor, the intent recognition method described in any one of the above is implemented.
[0031] These features and advantages of the present invention will be disclosed in detail in the following specific embodiments and the drawings. The best embodiments or means of the present invention will be shown in detail in combination with the drawings, but it is not a limitation to the technical solution of the present invention. In addition, these features, elements, and components appear multiple times in the following text and drawings, and are marked with different symbols or numbers for convenience of representation, but all represent components with the same or similar structures or functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The present invention will be further described below with reference to the accompanying drawings:
[0033] Figure 1 It is a schematic flowchart of an intention recognition method according to an embodiment of the present invention;
[0034] Figure 2 It is a schematic flowchart of an intention recognition method according to another embodiment of the present invention;
[0035] Figure 3 It is a specific schematic flowchart of an intention recognition method according to still another embodiment of the present invention;
[0036] Figure 4 It is a schematic diagram of modules of an electronic device in the above embodiments of the present invention;
[0037] Figure 5 It is a schematic diagram of a computer-readable medium in the above embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] The embodiments of the present invention will be described in detail below. The examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. Based on the embodiments in the embodiments, it is intended to explain the present invention and should not be construed as a limitation to the present invention.
[0039] As used in this specification, the phrase "in one embodiment" or "an example" or "an instance" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present patent disclosure. The appearances of the phrase "in one embodiment" in various places in the specification do not necessarily refer to the same embodiment.
[0040] As a first aspect of the present invention, there is provided an intention recognition method, as Figure 1 shown, the method comprising:
[0041] In step S110, obtain the natural language to be processed;
[0042] In step S120, according to the first prompt word, perform intention classification processing on the natural language to be processed to obtain a first intention recognition result and the processed language;
[0043] In step S130, according to the first intention recognition result and the processed language, generate a target content corresponding to the natural language to be processed.
[0044] Through the first prompt, the model analyzes the keywords, phrases, grammatical structures, and semantic relationships between these elements in the natural language to be processed. Based on the similarity relationships between the analyzed keywords and other elements and the first prompt, the intention type of the natural language to be processed is determined, that is, the first intention recognition result. Then, corresponding target content is generated according to different first intention recognition results and the processed language (i.e., the analyzed elements).
[0045] By designing and optimizing the prompt (hint word) for interacting with the large language model to adjust the model output, without the need for large-scale computationally intensive training, the model application cost is reduced, and the computing resources required by the model are reduced. Moreover, developers can quickly adjust the prompt according to specific application scenarios and specific requirements without retraining the model, with high flexibility and strong scalability.
[0046] By performing intention classification processing on the natural language to be processed, different target content generation steps are executed according to different types of user intentions. For easily recognizable intention types, the intention recognition steps are reduced, and the corresponding target content is directly generated. For more difficult-to-recognize intention types, more refined intention recognition steps are carried out, thereby reducing unnecessary computing resources of the model. While accelerating the model response speed, it also improves the matching degree and accuracy between the model output and the user's true intention, enhancing the user experience.
[0047] Optionally, the first intention recognition result includes a knowledge Q&A intention and a simulation process intention. As Figure 2 shown, the step S130 includes:
[0048] In step S131, when the first intention recognition result is a knowledge Q&A intention, the information related to the processed language in the corpus is integrated to generate the target content corresponding to the natural language to be processed;
[0049] In step S132, when the first intention recognition result is a simulation process intention, the processed language is subjected to intention recognition processing according to the second prompt to obtain at least one second intention recognition result;
[0050] In step S133, according to the second intention recognition result, the target content corresponding to the natural language to be processed is generated.
[0051] By classifying the user's intention, when the first intention recognition result is the knowledge Q&A intention, the model can quickly locate the information related to the processed language in the corpus, integrate it, and generate the target content. For example, it can call the glm4-9b-chat large model to generate the corresponding content. Through intention classification processing, for simple knowledge Q&A intentions, it directly uses the existing language model to generate relevant content, reducing unnecessary intention type matching processes and content generation processes, and improving the response speed and accuracy.
[0052] In the case where the first intention recognition result is the simulation process intention, through further intention recognition processing, the model can more accurately understand the user's intention, avoid a large deviation from the user's true intention, thereby generating target content that better meets the user's expectations, improving the matching degree of the output content, and enhancing the user experience.
[0053] In an alternative embodiment, step S132 includes:
[0054] In the case where the first intention recognition result is the simulation process intention, according to the second prompt word and the preset process arrangement, at least one second intention recognition result is obtained in sequence;
[0055] Generating the target content corresponding to the to-be-processed natural language according to the second intention recognition result includes:
[0056] Integrate the information in the corpus corresponding to at least one of the second intention recognition results to generate the target content corresponding to the to-be-processed natural language.
[0057] Through the preset process arrangement, a structured framework is provided for the parsing of the user's intention, ensuring that the model can process the processed language according to a certain logical order and rules to obtain the second intention recognition result, avoiding a chaotic and disorderly intention recognition process, enabling the model to quickly and accurately understand the user's intention, and improving the recognition efficiency of the model for the user's intention. Among them, the to-be-processed natural language includes the user input content and the context content. By combining the user input content and the context content, the comprehensiveness of the model's understanding of the user's intention is improved.
[0058] Optionally, in the case where the preset process arrangement includes at least two intention confirmation processes, fuse multiple second intention recognition results to obtain a third intention recognition result;
[0059] Integrate the information in the corpus corresponding to the third intention recognition result to generate the target content corresponding to the to-be-processed natural language.
[0060] By fusing multiple second intention recognition results, the user's intention is further refined and confirmed, so that the third intention recognition result is closer to the user's actual intention, improving the output accuracy of the target content.
[0061] In an alternative embodiment, as Figure 3 shown, the preset process orchestration includes at least one of simulation type intention, simulation performance intention, simulation architecture intention, simulation model intention, simulation parameter intention, start simulation intention, confirm template intention, and generate report intention.
[0062] Through fine-grained intention classification, it is ensured that the model can effectively, accurately, and efficiently implement the intention recognition process, ensuring a high degree of matching with the user's true intention.
[0063] Optionally, the form of the first prompt includes few-shot prompts; the few-shot prompts include example questions, reasoning steps, and answers.
[0064] Using few-shot prompts (Few Shot), when building the model, some example questions and corresponding answers in related fields are input for the model to refer to and learn, enabling the model to quickly learn and adapt to new tasks with a small number of training samples, improving the flexibility and generalization ability of the model.
[0065] In an alternative embodiment, the few-shot prompts further include guiding questions similar to the example questions.
[0066] By setting guiding questions after the example questions and question answers, the reasoning ability of the model is improved, thereby improving the efficiency of the model in recognizing the user's intention.
[0067] As the second aspect of the present invention, the present invention also provides a large language model, including:
[0068] An intention recognition module, configured to obtain the natural language to be processed, and perform intention classification processing on the natural language to be processed according to the first prompt, to obtain a first intention recognition result and the processed language;
[0069] A target content output module, configured to generate target content corresponding to the natural language to be processed according to the first intention recognition result and the processed language.
[0070] As the third aspect of the present invention, this embodiment also provides an electronic device, as Figure 4 shown, including:
[0071] One or more processors 101;
[0072] A memory 102 stores one or more computer programs. When the one or more computer programs are executed by the one or more processors 101, the one or more processors 101 implement the intention recognition method according to the first aspect of the present invention.
[0073] The electronic device may further include one or more I / O interfaces 103, connected between the processor 101 and the memory 102, configured to implement information interaction between the processor 101 and the memory 102.
[0074] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory 102 is a device with data storage capabilities, including but not limited to a random access memory (RAM, more specifically SDRAM, DDR, etc.), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory (FLASH); the I / O interface 103 (read / write interface) is connected between the processor 101 and the memory 102 and can implement information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus), etc.
[0075] In some embodiments, the processor 101, the memory 102, and the I / O interface 103 are interconnected through a bus 104 and further connected to other components of the computing device.
[0076] As a fourth aspect of the present invention, there is provided a computer-readable medium, as Figure 5 shown, on which a computer program is stored. When the computer program is executed by a processor, it implements the intention recognition method provided in the first aspect of the present disclosure.
[0077] Those of ordinary skill in the art can understand that to implement all or part of the processes in the above-described embodiment methods, it can be accomplished by instructing relevant hardware through a computer program. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and when the computer program is executed, it can implement the methods of any of the above embodiments. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0078] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes but is not limited to the content described in the drawings and the above specific implementation manner. Any modification that does not deviate from the functional and structural principles of the present invention will be included in the scope of the claims.
Claims
1. An intention recognition method, characterized in that, Including: Obtain the natural language to be processed; According to the first prompt word, perform intent classification processing on the natural language to be processed to obtain a first intent recognition result and processed language; Generate target content corresponding to the natural language to be processed according to the first intent recognition result and the processed language.
2. The intention recognition method according to claim 1, characterized in that, The first intent recognition result includes a knowledge Q&A intent and a simulation process intent. The generating of target content corresponding to the natural language to be processed according to the first intent recognition result and the processed language includes: When the first intent recognition result is a knowledge Q&A intent, integrate the information related to the processed language in the corpus to generate target content corresponding to the natural language to be processed; When the first intent recognition result is a simulation process intent, perform intent recognition processing on the processed language according to the second prompt word to obtain at least one second intent recognition result; Generate target content corresponding to the natural language to be processed according to the second intent recognition result.
3. The intention recognition method according to claim 2, characterized in that The performing of second intent recognition on the natural language to be processed according to the second prompt word to obtain at least one second intent recognition result when the first intent recognition result is a simulation process intent includes: When the first intent recognition result is a simulation process intent, obtain at least one second intent recognition result in sequence according to the second prompt word and a preset process arrangement; The generating of target content corresponding to the natural language to be processed according to the second intent recognition result includes: Integrate the information corresponding to at least one of the second intent recognition results in the corpus to generate target content corresponding to the natural language to be processed.
4. The intention recognition method according to claim 3, characterized in that, When the preset process arrangement includes at least two intent confirmation processes, fuse multiple second intent recognition results to obtain a third intent recognition result; Integrate the information corresponding to the third intent recognition result in the corpus to generate target content corresponding to the natural language to be processed.
5. The intention recognition method according to claim 3, wherein, The preset process arrangement includes at least one of a simulation type intent, a simulation performance intent, a simulation architecture intent, a simulation model intent, a simulation parameter intent, a start simulation intent, a confirmation template intent, and a generate report intent.
6. The intention recognition method according to claim 2, characterized in that, The form of the first prompt word includes few-shot prompts; the few-shot prompts include example questions, reasoning steps, and answers.
7. The intention recognition method according to claim 6, characterized in that The few-shot prompts further include guiding questions similar to the example questions.
8. A large language model, characterized in that, Including: An intent recognition module, configured to obtain the natural language to be processed, and configured to perform intent classification processing on the natural language to be processed according to the first prompt word to obtain a first intent recognition result and processed language; A target content output module, configured to generate target content corresponding to the natural language to be processed according to the first intent recognition result and the processed language.
9. An electronic device, characterized in that, Including: One or more processors; A memory, storing one or more computer programs thereon. When the one or more computer programs are executed by the one or more processors, the one or more processors implement the intent recognition method according to any one of claims 1 to 7.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the intention recognition method according to any one of claims 1 to 7.
Citation Information
Patent Citations
IEC61850 standard-based GOOSE communication simulation method
CN102075378A
Multi-dimensional working condition rolling identification method
CN110533262A
Intelligent question-answering method and device, computer equipment and storage medium
CN111708873A
Simulation method and device of power equipment and storage medium
CN112052571A
Dialogue system intention recognition method and tool based on large language model
CN116955618A