Search

CN-117932013-B - LLM-based intention recognition method, device, equipment and storage medium

CN117932013BCN 117932013 BCN117932013 BCN 117932013BCN-117932013-B

Abstract

The disclosure provides an intent recognition method, device, equipment and storage medium based on LLM, and relates to the technical field of artificial intelligence, in particular to the technical fields of intelligent office, cloud computing, large models and the like. The LLM-based intention recognition method comprises the steps of obtaining a current round of inquiry statement and inheritance information, wherein the inheritance information comprises inheritance intention, the inheritance intention is obtained after intention recognition is carried out on a previous round of inquiry statement, prompting information of the LLM is generated based on the current round of inquiry statement, initial intention of the current round of inquiry statement is determined based on the prompting information by adopting the LLM, and target intention of the current round of inquiry statement is determined based on the initial intention and the inheritance intention. The utility model can improve the universality of intention recognition.

Inventors

  • YANG ZHE
  • XIA ZHIQUN
  • GONG JIAN

Assignees

  • 百度智能云(成都)科技有限公司

Dates

Publication Date
20260505
Application Date
20231213

Claims (13)

  1. 1. An LLM-based intent recognition method comprising: the method comprises the steps of obtaining a current round of query sentences and inheritance information, wherein the inheritance information comprises inheritance intents, the inheritance intents are target intents obtained after intention recognition is carried out on a previous round of query sentences, and the target intents are intents finally determined after intention recognition is carried out on each round of query sentences; generating prompt information of LLM based on the current round of query sentences, and determining initial intention of the current round of query sentences based on the prompt information by adopting the LLM; determining a target intent of the current round of query statements based on the initial intent and the inheritance intent, comprising: Determining clarification intents based on the initial intents, wherein the number of the clarification intents is smaller than or equal to a preset number, wherein the initial intents comprise current father intents, and when the preset current son intents corresponding to the current father intents are smaller than or equal to the preset number, the current son intents are used as the clarification intents; -taking the inherited intent or the clarified intent as the target intent, comprising: The inheritance intent is taken as the target intent when the following condition is satisfied, otherwise the clarification intent is taken as the target intent: The initial intent also includes at least one alternative intent, if the clarification intent is different from the inheritance intent and the inheritance intent belongs to the alternative intent, regarding the inheritance intent as the target intent, or And if the clarification intention does not belong to the preset explicit intention and the inheritance intention is not null, taking the inheritance intention as the target intention.
  2. 2. The method of claim 1, wherein the generating the hint information of the LLM based on the current round of query statements comprises: Acquiring candidate intents associated with the current round of query sentences in a preset intent library; And generating prompt information of LLM based on a preset generation template, the candidate intention and the current round of query statement.
  3. 3. The method of claim 1, wherein, The determining a clarification intent based on the initial intent includes: if the current father intention is not contained in the corresponding relation between the preset pre-configured father intention and the preset pre-configured son intention, the current father intention is used as the clarification intention; Or alternatively If the corresponding relation between the pre-configured father intention and the pre-configured son intention contains the current father intention, acquiring a current son intention corresponding to the current father intention based on the corresponding relation between the pre-configured father intention and the pre-configured son intention; Or alternatively If the corresponding relation between the pre-configured father intention and the pre-configured son intention contains the current father intention, acquiring a current son intention corresponding to the current father intention based on the corresponding relation between the pre-configured father intention and the pre-configured son intention, and if the number of the current son intention is larger than the preset number, processing the current son intention to determine the clarification intention.
  4. 4. The method of claim 3, wherein the processing the current sub-intent to determine the clarification intent comprises: If the current sub-intention does not contain a named entity, executing intention clarification operation based on a preset first configuration file to determine the clarification intention, or And if the current sub-intention contains a named entity, acquiring a target named entity corresponding to the current round of query statement, and taking the current sub-intention containing the target named entity as the clarification intention.
  5. 5. The method of claim 4, wherein the obtaining the target named entity corresponding to the current round of query statements comprises at least one of: Carrying out named entity recognition on the current round of query sentences to obtain the target named entity; The inheritance information also comprises an inheritance naming entity, wherein the inheritance naming entity is used as the target naming entity; And executing named entity clarification operation based on a preset second configuration file to obtain the target named entity.
  6. 6. An LLM based intent recognition device comprising: The acquisition module is used for acquiring a current round of query sentences and inheritance information, wherein the inheritance information comprises inheritance intents, the inheritance intents are target intents obtained after intention recognition is carried out on a previous round of query sentences, and the target intents are intents finally determined after intention recognition is carried out on each round of query sentences; The first determining module is used for generating prompt information of the LLM according to the current round of query sentences and determining initial intention of the current round of query sentences by adopting the LLM based on the prompt information; the second determining module is used for determining the target intention of the current round of query statement according to the initial intention and the inheritance intention; The second determination module is further to: Determining clarification intents based on the initial intents, wherein the number of the clarification intents is smaller than or equal to a preset number, wherein the initial intents comprise current father intents, and when the preset current son intents corresponding to the current father intents are smaller than or equal to the preset number, the current son intents are used as the clarification intents; The inherited intent or the clarified intent is treated as the target intent.
  7. 7. The apparatus of claim 6, wherein the first determination module is further to: Acquiring candidate intents associated with the current round of query sentences in a preset intent library; And generating prompt information of LLM based on a preset generation template, the candidate intention and the current round of query statement.
  8. 8. The apparatus of claim 6, wherein, The second determination module is further to: if the current father intention is not contained in the corresponding relation between the preset pre-configured father intention and the preset pre-configured son intention, the current father intention is used as the clarification intention; Or alternatively If the corresponding relation between the pre-configured father intention and the pre-configured son intention contains the current father intention, acquiring a current son intention corresponding to the current father intention based on the corresponding relation between the pre-configured father intention and the pre-configured son intention; Or alternatively If the corresponding relation between the pre-configured father intention and the pre-configured son intention contains the current father intention, acquiring a current son intention corresponding to the current father intention based on the corresponding relation between the pre-configured father intention and the pre-configured son intention, and if the number of the current son intention is larger than the preset number, processing the current son intention to determine the clarification intention.
  9. 9. The apparatus of claim 8, wherein the second determination module is further to: If the current sub-intention does not contain a named entity, executing intention clarification operation based on a preset first configuration file to determine the clarification intention, or And if the current sub-intention contains a named entity, acquiring a target named entity corresponding to the current round of query statement, and taking the current sub-intention containing the target named entity as the clarification intention.
  10. 10. The apparatus of claim 9, wherein the second determination module is further to: Carrying out named entity recognition on the current round of query sentences to obtain the target named entity; The inheritance information also comprises an inheritance naming entity, wherein the inheritance naming entity is used as the target naming entity; And executing named entity clarification operation based on a preset second configuration file to obtain the target named entity.
  11. 11. An electronic device, comprising: at least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
  12. 12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
  13. 13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-5.

Description

LLM-based intention recognition method, device, equipment and storage medium Technical Field The disclosure relates to the technical field of artificial intelligence, in particular to the technical fields of intelligent office, cloud computing, large models and the like, and particularly relates to an intent recognition method, device, equipment and storage medium based on LLM. Background The intention recognition component is a key component in the government assistant, can recognize the intention of a query statement (query) input by a user, and further obtains a query result corresponding to the query statement based on the intention. In the related art, intention recognition may be performed based on an intention recognition model of a specific field. Disclosure of Invention The present disclosure provides a LLM-based intent recognition method, apparatus, device, and medium. According to one aspect of the disclosure, an intention recognition method based on LLM is provided, and the intention recognition method comprises the steps of obtaining a current round of query sentences and inheritance information, wherein the inheritance information comprises inheritance intention, the inheritance intention is obtained after intention recognition is carried out on a previous round of query sentences, generating prompt information of LLM based on the current round of query sentences, determining initial intention of the current round of query sentences by adopting the LLM based on the prompt information, and determining target intention of the current round of query sentences based on the initial intention and the inheritance intention. According to another aspect of the disclosure, an intention recognition device based on LLM is provided, and the intention recognition device comprises an acquisition module and a first determination module, wherein the acquisition module is used for acquiring a current round of inquiry statement and inheritance information, the inheritance information comprises inheritance intention, the inheritance intention is acquired after intention recognition is carried out on a previous round of inquiry statement, the first determination module is used for generating prompt information of LLM according to the current round of inquiry statement and determining initial intention of the current round of inquiry statement by adopting the LLM based on the prompt information, and the second determination module is used for determining target intention of the current round of inquiry statement according to the initial intention and the inheritance intention. According to another aspect of the present disclosure there is provided an electronic device comprising at least one processor and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the above aspects. According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method according to any one of the above aspects. According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method according to any of the above aspects. According to the technical scheme, the universality of intention recognition can be improved. It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification. Drawings The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein: FIG. 1 is a schematic diagram according to a first embodiment of the present disclosure; FIG. 2 is a schematic diagram of an application scenario for implementing an embodiment of the present disclosure; FIG. 3 is a schematic diagram of an overall flow of intent recognition provided in accordance with an embodiment of the present disclosure; FIG. 4 is a schematic diagram according to a second embodiment of the present disclosure; FIG. 5 is a schematic diagram according to a third embodiment of the present disclosure; Fig. 6 is a schematic diagram of an electronic device for implementing LLM-based intent recognition methods in accordance with embodiments of the present disclosure. Detailed Description Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly,