An intent recognition method, a large language model, an electronic device, and a medium
Patent Information
- Application Number
- CN202510363778.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2045-03-26
AI Technical Summary
但微调模型需要额外的计算资源和时间,特别是在处理大型语言模型时,增加了模型部署和更新的成本,并且该方式扩展性较差,针对不同领域需要重新对模型进行相应微调,进一步增加了模型训练成本
[0010]通过设计和优化与大语言模型交互的prompt(提示词)来调整模型输出,而无需进行大规模的计算密集型训练,降低了模型应用成本,减少了模型所需的计算资源。并且,开发人员可以根据具体应用场景、具体需求快速调整提示词,而无需重新训练模型,灵活度高,可扩展性强。
Smart Images

Figure CN120353891B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to an intent recognition method, a large language model, an electronic device, and a medium. Background Technology
[0002] In the fields of information retrieval (IR) and natural language processing (NLP), Retrievers are commonly used to find embeddings from the embedding space that are similar to the simulated intent of the user's input. This process typically involves transforming the user input (such as a query) into a point in a high-dimensional vector space, and then finding the closest vector in this space. These vectors usually correspond to pre-indexed documents, questions, or other forms of text data. By calculating similarity scores (such as cosine similarity, Euclidean distance, etc.) between these vectors, the model can evaluate and rank these candidates, ultimately returning the result that best matches the user's intent.
[0003] This method is computationally complex, time-consuming, and heavily reliant on the embedding model, making it unsuitable for small-scale scenarios. Some existing solutions involve pre-tuning large language models to adapt them to different specific scenarios. However, fine-tuning requires additional computational resources and time, especially when dealing with large language models, increasing the cost of model deployment and updates. Furthermore, this approach has poor scalability, requiring further fine-tuning for different domains, further increasing training costs. Summary of the Invention
[0004] This invention aims to address, to a certain extent, one of the technical problems in related technologies. To this end, this invention provides an intent recognition method, a large language model, an electronic device, and a medium, which have the advantages of high efficiency, strong intent understanding capability, high flexibility, strong scalability, and good noise reduction capability.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] An intent recognition method, comprising:
[0007] Obtain the natural language to be processed;
[0008] Based on the first prompt word, the natural language to be processed is subjected to intent classification processing to obtain the first intent recognition result and the processed language;
[0009] Based on the first intent recognition result and the processed language, target content corresponding to the natural language to be processed is generated.
[0010] By designing and optimizing prompts that interact with large language models, the model output can be adjusted without large-scale, computationally intensive training, reducing the cost of model application and the computational resources required. Furthermore, developers can quickly adjust prompts according to specific application scenarios and needs without retraining the model, offering high flexibility and scalability.
[0011] By performing intent classification processing on the natural language to be processed, different target content generation steps are executed according to different types of user intent. For easily identifiable intent types, the intent recognition steps are reduced and the corresponding target content is generated directly. For more difficult-to-identify intent types, more refined intent recognition steps are performed, thereby reducing unnecessary computing resources of the model. While speeding up the model response speed, it also improves the matching degree and accuracy between the model output and the user's true intent, thus enhancing the user experience.
[0012] Optionally, the first intent recognition result includes a knowledge-based question-answering intent and a simulation process intent. The step of generating target content corresponding to the natural language to be processed based on the first intent recognition result and the processed language includes:
[0013] If the first intent recognition result is a knowledge question answering intent, the information related to the processed language in the corpus is integrated to generate target content corresponding to the natural language to be processed.
[0014] If the first intent recognition result is the intent of the simulation process, the processed language is subjected to intent recognition processing according to the second prompt word to obtain at least one second intent recognition result.
[0015] Based on the second intent recognition result, target content corresponding to the natural language to be processed is generated.
[0016] Optionally, when the first intent recognition result is a simulation process intent, performing second intent recognition on the natural language to be processed based on the second prompt word to obtain a second intent recognition result includes:
[0017] If the first intent recognition result is a simulation process intent, at least one second intent recognition result is obtained sequentially based on the second prompt word and the preset process arrangement.
[0018] The step of generating target content corresponding to the natural language to be processed based on the second intent recognition result includes:
[0019] The information in the corpus corresponding to at least one of the second intent recognition results is integrated to generate target content corresponding to the natural language to be processed.
[0020] Optionally, if the preset process arrangement includes at least two intent confirmation processes, multiple second intent recognition results are fused to obtain a third intent recognition result;
[0021] The information in the corpus corresponding to the third intent recognition result is integrated to generate target content corresponding to the natural language to be processed.
[0022] Optionally, the preset process arrangement 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 report generation intent.
[0023] Optionally, the first prompt word may take the form of a few-sample prompt; the few-sample prompt may include an example question, reasoning steps, and an answer.
[0024] Optionally, the few-sample hints may also include a guiding question similar to the example question.
[0025] Furthermore, this invention also provides a large language model, including:
[0026] An intent recognition module is used to acquire the natural language to be processed and to perform intent classification processing on the natural language to be processed based on a first prompt word, so as to obtain a first intent recognition result and processed language;
[0027] The target content output module is used to generate target content corresponding to the natural language to be processed based on the first intent recognition result and the processed language.
[0028] The reasoning process for the beneficial effects of the large language model provided by this invention is similar to that of the aforementioned intent recognition method, and will not be repeated here.
[0029] Furthermore, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the intent recognition method described in any of the preceding claims.
[0030] In addition, the present invention also provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the intent recognition method described in any of the preceding claims.
[0031] These features and advantages of the present invention will be disclosed in detail in the following specific embodiments and accompanying drawings. The preferred embodiments or means of the present invention will be shown in detail in conjunction with the accompanying drawings, but are not intended to limit the technical solutions of the present invention. In addition, each of these features, elements and components appearing in the following text and drawings is a plurality of, and different symbols or numbers are used for convenience of representation, but all represent parts with the same or similar construction or function. Attached Figure Description
[0032] The present invention will be further described below with reference to the accompanying drawings:
[0033] Figure 1 This is a flowchart illustrating an embodiment of the intent recognition method of the present invention;
[0034] Figure 2 This is a flowchart illustrating an intent recognition method according to another embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram illustrating the specific process of an intent recognition method according to another embodiment of the present invention;
[0036] Figure 4 This is a schematic diagram of the modules of the electronic device in the above embodiments of the present invention;
[0037] Figure 5 This is a schematic diagram of a computer-readable medium in the above embodiments of the present invention. Detailed Implementation
[0038] Embodiments of the present invention are described in detail below, examples of which are illustrated 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. The embodiments described are intended to explain the present invention and should not be construed as limiting the invention.
[0039] The terms "an embodiment," "example," or "trademark" used in this specification refer to a particular feature, structure, or characteristic described in connection with the embodiment itself that may be included in at least one embodiment disclosed in this patent. The phrase "in an embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment.
[0040] As a first aspect of the present invention, an intent recognition method is provided, such as Figure 1 As shown, the method includes:
[0041] In step S110, the natural language to be processed is obtained;
[0042] In step S120, the natural language to be processed is subjected to intent classification processing based on the first prompt word to obtain the first intent recognition result and the processed language;
[0043] In step S130, target content corresponding to the natural language to be processed is generated based on the first intent recognition result and the processed language.
[0044] Using the first prompt word, the model parses out keywords, phrases, grammatical structures, and semantic relationships between these elements in the natural language to be processed. Based on the similarity between the parsed keywords and other elements and the first prompt word, the model determines the intent type of the natural language to be processed, i.e., the first intent recognition result. Then, based on different first intent recognition results and the processed language (i.e., the parsed elements), the model generates corresponding target content.
[0045] By designing and optimizing prompts that interact with large language models, the model output can be adjusted without large-scale, computationally intensive training, reducing the cost of model application and the computational resources required. Furthermore, developers can quickly adjust prompts according to specific application scenarios and needs without retraining the model, offering high flexibility and scalability.
[0046] By performing intent classification processing on the natural language to be processed, different target content generation steps are executed according to different types of user intent. For easily identifiable intent types, the intent recognition steps are reduced and the corresponding target content is generated directly. For more difficult-to-identify intent types, more refined intent recognition steps are performed, thereby reducing unnecessary computing resources of the model. While speeding up the model response speed, it also improves the matching degree and accuracy between the model output and the user's true intent, thus enhancing the user experience.
[0047] Optionally, the first intent recognition result includes knowledge-based question-answering intent and simulation process intent, such as... Figure 2 As shown, step S130 includes:
[0048] In step S131, if the first intent recognition result is a knowledge question answering intent, the information related to the processed language in the corpus is integrated to generate target content corresponding to the natural language to be processed.
[0049] In step S132, if the first intent recognition result is the intent of the simulation process, the processed language is subjected to intent recognition processing according to the second prompt word to obtain at least one second intent recognition result.
[0050] In step S133, target content corresponding to the natural language to be processed is generated based on the second intent recognition result.
[0051] By classifying user intents, when the primary intent is identified as a knowledge-based question-and-answer intent, the model can quickly locate relevant information in the corpus related to the processed language, integrate it, and generate the target content. For example, it can call the glm4-9b-chat large model to generate corresponding content. Through intent classification, for simple knowledge-based question-and-answer intents, relevant content can be generated directly using existing language models, reducing unnecessary intent type matching and content generation processes, and improving response speed and accuracy.
[0052] When the initial intent recognition result is the simulated process intent, further intent recognition processing allows the model to more accurately understand the user's intent, avoiding significant discrepancies with the user's true intent. This results in 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 one optional implementation, step S132 includes:
[0054] If the first intent recognition result is a simulation process intent, at least one second intent recognition result is obtained sequentially based on the second prompt word and the preset process arrangement.
[0055] The step of generating target content corresponding to the natural language to be processed based on the second intent recognition result includes:
[0056] The information in the corpus corresponding to at least one of the second intent recognition results is integrated to generate target content corresponding to the natural language to be processed.
[0057] By employing a pre-defined workflow, a structured framework is provided for parsing user intent. This ensures that the model processes the processed language according to a specific logical order and rules to obtain the second intent recognition result. This avoids a chaotic and disordered intent recognition process, enabling the model to quickly and accurately understand user intent and improving its recognition efficiency. The natural language to be processed includes user input and contextual content. By combining user input and contextual content, the comprehensiveness of the model's understanding of user intent is enhanced.
[0058] Optionally, if the preset process arrangement includes at least two intent confirmation processes, multiple second intent recognition results are fused to obtain a third intent recognition result;
[0059] The information in the corpus corresponding to the third intent recognition result is integrated to generate target content corresponding to the natural language to be processed.
[0060] By fusing multiple second intent recognition results, the user's intent is further refined and confirmed, so that the third intent recognition results are closer to the user's actual intent, thereby improving the accuracy of the target content output.
[0061] In one alternative implementation, such as Figure 3 As shown, the preset process arrangement includes at least one of the following: 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.
[0062] By employing sophisticated intent classification, the model can effectively, accurately, and efficiently achieve the intent recognition process, ensuring a high degree of matching with the user's true intent.
[0063] Optionally, the first prompt word may take the form of a few-sample prompt; the few-sample prompt may include an example question, reasoning steps, and an answer.
[0064] By using few-shot prompts, example questions and corresponding answers from relevant fields are input during model building, allowing the model to learn from them. This enables the model to quickly learn and adapt to new tasks with a small number of training samples, improving the model's flexibility and generalization ability.
[0065] In one alternative implementation, the few-sample prompt also includes a guiding question similar to the example question.
[0066] By setting guiding questions after example questions and answers, the model's reasoning ability is improved, thereby increasing the model's efficiency in recognizing user intent.
[0067] As a second aspect of the invention, the invention also provides a large language model, comprising:
[0068] An intent recognition module is used to acquire the natural language to be processed and to perform intent classification processing on the natural language to be processed based on a first prompt word, so as to obtain a first intent recognition result and processed language;
[0069] The target content output module is used to generate target content corresponding to the natural language to be processed based on the first intent recognition result and the processed language.
[0070] As a third aspect of the present invention, this embodiment also provides an electronic device, such as... Figure 4 As shown, it includes:
[0071] One or more processors 101;
[0072] The memory 102 stores one or more computer programs that, when executed by the one or more processors 101, cause the one or more processors 101 to implement the intent recognition method according to the first aspect of the invention.
[0073] The electronic device may also include one or more I / O interfaces 103 connected between the processor 101 and the memory 102, configured to enable information interaction between the processor 101 and the memory 102.
[0074] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface 103 (read-write interface) is connected between the processor 101 and the memory 102, enabling information exchange between the processor 101 and the memory 102, including but not limited to a data bus (Bus).
[0075] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.
[0076] As a fourth aspect of the present invention, a computer-readable medium, such as Figure 5 As shown, a computer program is stored thereon, which, when executed by a processor, implements the intent recognition method provided in the first aspect of this disclosure.
[0077] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can implement the methods of any of the above embodiments. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0078] The above are merely specific embodiments of the present invention, but the scope of protection 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 contents described in the accompanying drawings and the specific embodiments above. Any modifications that do not depart from the functional and structural principles of the present invention will be included within the scope of the claims.
Claims
1. An intent recognition method, characterized in that, include: Obtain the natural language to be processed; Based on the first prompt word, the natural language to be processed is subjected to intent classification processing to obtain the first intent recognition result and the processed language; Based on the first intent recognition result and the processed language, generate target content corresponding to the natural language to be processed; The first intent recognition result includes a knowledge-based question-and-answer intent and a simulation process intent. The step of generating target content corresponding to the natural language to be processed based on the first intent recognition result and the processed language includes: If the first intent recognition result is a knowledge question answering intent, the information related to the processed language in the corpus is integrated to generate target content corresponding to the natural language to be processed. If the first intent recognition result is the intent of the simulation process, the processed language is subjected to intent recognition processing according to the second prompt word to obtain at least one second intent recognition result. Based on the second intent recognition result, target content corresponding to the natural language to be processed is generated; When the first intent recognition result is a simulation process intent, the process of performing second intent recognition on the natural language to be processed based on the second prompt word to obtain at least one second intent recognition result includes: If the first intent recognition result is a simulation process intent, at least one second intent recognition result is obtained sequentially based on the second prompt word and the preset process arrangement. The step of generating target content corresponding to the natural language to be processed based on the second intent recognition result includes: The information in the corpus corresponding to at least one of the second intent recognition results is integrated to generate target content corresponding to the natural language to be processed; When the preset process arrangement includes at least two intent confirmation processes, multiple second intent recognition results are fused to obtain a third intent recognition result. The information in the corpus corresponding to the third intent recognition result is integrated to generate target content corresponding to the natural language to be processed; The preset process arrangement includes at least one of the following: 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. The first prompt word takes the form of a few-sample prompt; the few-sample prompt includes an example question, reasoning steps, and an answer; The few-sample hints also include guiding questions similar to the example question.
2. A large language model for implementing the intent recognition method of claim 1, characterized in that, include: An intent recognition module is used to acquire the natural language to be processed and to perform intent classification processing on the natural language to be processed based on a first prompt word, so as to obtain a first intent recognition result and processed language; The target content output module is used to generate target content corresponding to the natural language to be processed based on the first intent recognition result and the processed language; The first intent recognition result includes a knowledge-based question-and-answer intent and a simulation process intent. The step of generating target content corresponding to the natural language to be processed based on the first intent recognition result and the processed language includes: If the first intent recognition result is a knowledge question answering intent, the information related to the processed language in the corpus is integrated to generate target content corresponding to the natural language to be processed. If the first intent recognition result is the intent of the simulation process, the processed language is subjected to intent recognition processing according to the second prompt word to obtain at least one second intent recognition result. Based on the second intent recognition result, target content corresponding to the natural language to be processed is generated; When the first intent recognition result is a simulation process intent, the process of performing second intent recognition on the natural language to be processed based on the second prompt word to obtain at least one second intent recognition result includes: If the first intent recognition result is a simulation process intent, at least one second intent recognition result is obtained sequentially based on the second prompt word and the preset process arrangement. The step of generating target content corresponding to the natural language to be processed based on the second intent recognition result includes: The information in the corpus corresponding to at least one of the second intent recognition results is integrated to generate target content corresponding to the natural language to be processed; When the preset process arrangement includes at least two intent confirmation processes, multiple second intent recognition results are fused to obtain a third intent recognition result. The information in the corpus corresponding to the third intent recognition result is integrated to generate target content corresponding to the natural language to be processed; The preset process arrangement includes at least one of the following: 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. The first prompt word takes the form of a few-sample prompt; the few-sample prompt includes an example question, reasoning steps, and an answer; The few-sample hints also include guiding questions similar to the example question.
3. An electronic device, characterized in that, include: One or more processors; A memory having stored one or more computer programs that, when executed by one or more processors, cause the one or more processors to implement the intent recognition method according to claim 1.
4. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the intent recognition method of claim 1.
Citation Information
Patent Citations
Natural language query method and device
CN118277403A