WO2024217469A1 - 基于目标生成式预训练gpt模型的交互语句的处理方法 - Google Patents

基于目标生成式预训练gpt模型的交互语句的处理方法 Download PDF

Info

Publication number
WO2024217469A1
WO2024217469A1 PCT/CN2024/088406 CN2024088406W WO2024217469A1 WO 2024217469 A1 WO2024217469 A1 WO 2024217469A1 CN 2024088406 W CN2024088406 W CN 2024088406W WO 2024217469 A1 WO2024217469 A1 WO 2024217469A1
Authority
WO
WIPO (PCT)
Prior art keywords
interaction
sentence
domain
statement
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2024/088406
Other languages
English (en)
French (fr)
Inventor
赵培
邓邱伟
田云龙
王淼
王迪
牛丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Publication of WO2024217469A1 publication Critical patent/WO2024217469A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Definitions

  • the present disclosure relates to the field of smart home technology, and more specifically, to a method and device for processing interactive sentences based on a target-generative pre-trained GPT model, a system, a storage medium, and an electronic device.
  • the interactive system interacts directly based on the interactive statements input by the user.
  • the interactive system cannot correctly identify the user's interactive statements, and thus cannot make a correct response to the user's interactive statements.
  • the disclosed embodiments provide a method and device for processing interactive sentences based on a target-generative pre-trained GPT model, a storage medium, and an electronic device, so as to at least solve the problem that the interactive system directly performs interactive processing according to the interactive sentences, resulting in poor interactive effects.
  • a method for processing an interaction sentence based on a target-generated pre-trained GPT model comprising: determining a domain classification result of an input original interaction sentence through a domain classification model, and determining whether the original interaction sentence belongs to a preset domain based on the domain classification result; When it is determined that the original interaction sentence does not belong to the preset domain, the intention information of the original interaction sentence in the preset domain is parsed through the target generation pre-trained GPT model, and a transformed interaction sentence is generated according to the intention information; and interaction processing is performed according to the transformed interaction sentence.
  • a device for processing interaction sentences based on a target-generative pre-trained GPT model including: a determination module, configured to determine a domain classification result of an input original interaction sentence through a domain classification model, and determine whether the original interaction sentence belongs to a preset domain based on the domain classification result; a generation module, configured to, when determining that the original interaction sentence does not belong to the preset domain, parse the intention information of the original interaction sentence on the preset domain through the target-generative pre-trained GPT model, and generate a transformed interaction sentence according to the intention information; an interaction module, configured to perform interaction processing according to the transformed interaction sentence.
  • a system for processing interaction sentences based on a target-generative pre-trained GPT model including: a domain classification model, configured to perform domain classification on an input original interaction sentence, and determine whether the original interaction sentence belongs to a preset domain; a target-generative pre-trained GPT model, configured to parse the intent information of the original interaction sentence in the preset domain when the original interaction sentence does not belong to the preset domain, and generate a transformed interaction sentence based on the intent information; and a dialogue engine, configured to perform interaction processing based on the transformed interaction sentence.
  • a computer-readable storage medium in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for processing interactive statements based on the target generative pre-trained GPT model at runtime.
  • an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for processing interactive sentences based on the target generative pre-trained GPT model through the computer program.
  • a computer program product including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and the computer program is configured to execute the above-mentioned method for processing interactive statements based on the target generative pre-trained GPT model when running.
  • the present disclosure when it is determined through the domain classification model that the original interactive sentence does not belong to the preset domain, parses the intention information of the original interactive sentence in the preset domain through the target generation type pre-training GPT model, and generates a transformed interactive sentence according to the intention information, and then performs interactive processing according to the transformed interactive sentence.
  • the above technical scheme is adopted, so that the interactive system can mine the implicit intention of the user, improve the understanding ability of the interactive system to the input interactive sentence, and then the interactive system can accurately respond accordingly, improve the interactive effect, and solve the problem that the interactive system directly performs interactive processing according to the interactive sentence, resulting in poor interactive effect.
  • the interactive system can mine the implicit intention of the user and has a stronger understanding ability of the interactive sentence, the interactive system can realize a more natural and intimate interactive method according to the user's intention and improve the intelligence of the interactive system; and because the interactive system more accurately identifies the implicit intention of the user, the interactive system can actively continue or guide a new topic, and then the interactive system has the ability to conduct continuous dialogue like between people, which makes the interactive experience in the field of human-computer interaction have a qualitative leap.
  • FIG1 is a schematic diagram of a hardware environment of a method for processing interactive sentences based on a target-generated pre-trained GPT model according to an embodiment of the present disclosure
  • FIG2 is a flowchart of a method for processing interactive sentences based on a target-generated pre-trained GPT model according to an embodiment of the present disclosure
  • FIG3 is an overall framework diagram (I) of a method for processing interactive sentences based on a target-generated pre-trained GPT model according to an embodiment of the present disclosure
  • FIG4( a ) is a schematic diagram of a preset domain according to an embodiment of the present disclosure
  • FIG4( b ) is a schematic diagram of another preset area according to an embodiment of the present disclosure.
  • FIG5 is a schematic diagram of a process of generating a transformation interaction statement according to an embodiment of the present disclosure
  • FIG6 is a schematic diagram of another process of generating a transformation interaction statement according to an embodiment of the present disclosure.
  • FIG7 is an overall framework diagram (II) of a method for processing interactive sentences based on a target-generated pre-trained GPT model according to an embodiment of the present disclosure
  • FIG8 is a framework diagram of reinforcement learning according to an embodiment of the present disclosure.
  • FIG9 is a structural block diagram of a device for processing interactive sentences based on a target-generated pre-trained GPT model according to an embodiment of the present disclosure
  • FIG10 is a structural block diagram of a system for processing interactive sentences based on a target-generated pre-trained GPT model according to an embodiment of the present disclosure
  • FIG. 11 is a structural block diagram of an optional electronic device according to an embodiment of the present disclosure.
  • a method for processing interactive sentences based on a target-generated pre-trained GPT model is provided.
  • the method for processing interactive sentences based on the target-generated pre-trained GPT model should be widely set to smart home (Smart Home), smart home, smart home device ecology, smart house (Intelligence House) ecology and other whole-house intelligent digital control application scenarios.
  • the above-mentioned method for processing interactive sentences based on the target-generated pre-trained GPT model can be set in a hardware environment composed of a terminal device 102 and a server 104 as shown in Figure 1.
  • the server 104 is connected to the terminal device 102 through a network, and can be set to provide services (such as application services, etc.) for the terminal or a client installed on the terminal, a database can be set on the server or independently of the server, and it is set to provide data storage services for the server 104, cloud computing and/or edge computing services can be configured on the server or independently of the server, and it is set to provide data computing services for the server 104.
  • services such as application services, etc.
  • a database can be set on the server or independently of the server, and it is set to provide data storage services for the server 104
  • cloud computing and/or edge computing services can be configured on the server or independently of the server, and it is set to provide data computing services for the server 104.
  • the above network may include but is not limited to at least one of the following: wired network, wireless network.
  • the above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth.
  • WIFI Wireless Fidelity
  • the terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing equipment, a smart dishwasher, a smart projection equipment, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart speaker, a smart fresh air equipment, a smart kitchen and bathroom equipment, a smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification equipment, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
  • FIG. 2 is a flowchart of a method for processing interactive sentences based on a target-generated pre-trained GPT model according to an embodiment of the present disclosure, and the process includes the following steps:
  • Step S202 determining a domain classification result of the input original interaction sentence through a domain classification model, and determining whether the original interaction sentence belongs to a preset domain based on the domain classification result;
  • the domain classification model is set to determine whether the original interaction sentence belongs to the pre- Assume a domain, that is, the domain classification model implements a binary classification, and the domain classification result is that the original interaction sentence belongs to the preset domain or the original interaction sentence does not belong to the preset domain.
  • the preset domain is the domain in which the interactive system is located (for example, smart home domain, smart car system domain, etc.).
  • the interactive system is a processing system for interactive statements based on a target-generated pre-trained GPT model, and the interactive system includes a dialogue engine.
  • the method further includes: in a case where it is determined based on the field classification result that the original interaction sentence belongs to the preset field, using the original interaction sentence to perform interaction processing.
  • the interactive system can accurately determine the user's intention and can accurately respond based on the original interaction sentence without inputting the original interaction sentence into the target GPT model.
  • Step S204 when it is determined that the original interaction sentence does not belong to the preset domain, the intention information of the original interaction sentence in the preset domain is parsed by the target generation pre-trained GPT model, and a transformed interaction sentence is generated according to the intention information;
  • the above-mentioned target-generative pre-trained GPT model is a GPT model corresponding to a preset domain, and then the target GPT model corresponding to the preset domain is used to parse the intent information of the original interaction sentence in the preset domain, and a transformed interaction sentence is generated according to the intent information, which can improve the interactive system's ability to understand the original interaction sentence.
  • the existing general GPT model including but not limited to the GPT4 model provided by Microsoft Azure Open AI, the Text-to-Text Transfer Transformer (T5) model and other conversational general large-scale text pre-training models
  • the manufacturer's independently developed quasi-large-scale text pre-training model a model trained using a large amount of data collected by the manufacturer's R&D personnel
  • the target generative pre-training GPT Geneative Pre-Training
  • the target generative pre-training GPT Geneative Pre-Training
  • step S202 after the above step S202, it also includes: when it is determined based on the domain classification result that the original interaction sentence belongs to the preset domain, the intention information of the original interaction sentence in the preset domain is parsed through the target generative pre-trained GPT model, and a transformed interaction sentence is generated according to the intention information.
  • the target-generative pre-trained GPT model can be used to parse the intent information of the original interactive sentences in the preset field, and a transformed interactive sentence can be generated based on the intent information.
  • Step S206 performing interaction processing according to the transformed interaction statement.
  • step S206 may be implemented in the following manner: when it is determined that the transformed interaction statement does not belong to the preset domain, the original interaction statement is used for interaction processing.
  • the interaction system directly uses the original interaction statement for interaction processing.
  • step S206 may also be implemented in the following manner: when it is determined that the transformed interaction statement belongs to the preset domain, the transformed interaction statement is used to perform interaction processing.
  • the transformed interaction sentence belongs to the preset domain, it means that the target GPT model has identified the intention of the original interaction sentence in the preset domain, and in order to improve the interaction effect, the interaction system uses the transformed interaction sentence for interaction processing.
  • the domain classification model for determining whether the original interaction sentence belongs to the preset domain and the domain classification model for determining whether the transformed interaction sentence belongs to the preset domain can be, for example, the same domain classification model.
  • the original interaction sentence is classified by a domain classifier (equivalent to the above-mentioned domain classification model) to obtain a domain classification model. Classification result, and determine whether the original interaction sentence belongs to the preset domain according to the domain classification result.
  • the original interaction sentence When it is determined that the original interaction sentence belongs to the preset domain, the original interaction sentence is directly input into the dialogue engine (the dialogue engine is located in the interactive system); when it is determined that the original interaction sentence does not belong to the preset domain, the original interaction sentence is input into the target GPT model to obtain the transformed interaction sentence output by the target GPT model, and continue to use the domain classifier to perform domain classification on the transformed interaction sentence; if the transformed interaction sentence belongs to the preset domain, the transformed interaction sentence is input into the dialogue engine; if the transformed interaction sentence does not belong to the preset domain, the original interaction sentence is input into the dialogue engine.
  • the interactive system in the related art directly performs interactive processing based on the user's original interactive statements, which mainly has the following problems:
  • the embodiment of the present disclosure uses the target generative pre-trained GPT model to parse the intent information of the original interaction sentence in the preset domain, and generates a transformed interaction sentence based on the intent information, and then performs interaction processing based on the transformed interaction sentence.
  • the above technical solution enables the interaction system to mine the user's implicit intention, improves the interaction system's ability to understand the input interaction sentence, and then the interaction system can accurately respond accordingly, solving the problem that the interaction system directly performs interaction processing based on the interaction sentence, resulting in poor interaction effect.
  • the interaction system can mine the user's implicit intention and has a stronger ability to understand the interaction sentence, the interaction system can achieve a more natural and considerate interaction method based on the user's intention, improving the intelligence of the interaction system; and because the interaction system more accurately identifies the user's implicit intention, the interaction system can actively continue or lead to new topics, and then the interaction system has the ability to interact like The ability to have continuous conversations like people do has brought a qualitative leap in the interactive experience in the field of human-computer interaction.
  • the preset domain includes N layers of sub-domains having a hierarchical relationship.
  • the N-layer sub-fields are: smart home field (first layer), air conditioning field (second layer), temperature control field (third layer). It should be noted that one sub-field corresponds to one GPT model, and the next layer field is the sub-field of the corresponding previous layer field.
  • the domain classification model corresponding to each layer of sub-domain is used to determine whether the interaction statement belongs to each layer of sub-domain.
  • the domain classification model corresponding to the air-conditioning domain is used to determine whether the interaction statement belongs to the air-conditioning domain
  • the domain classification model corresponding to the temperature adjustment domain is used to determine whether the interaction statement belongs to the temperature adjustment domain.
  • the N layers of sub-fields are: smart home field (first layer), air conditioning field (second layer), refrigerator field (second layer), temperature control field (third layer)...freezing field (third layer)...
  • the domain classification model corresponding to each sub-domain in each layer of sub-domains is used to determine whether the interaction statement belongs to each sub-domain.
  • the domain classification model corresponding to the air-conditioning domain is used to determine whether the interaction statement belongs to the air-conditioning domain
  • the domain classification model corresponding to the refrigerator domain is used to determine whether the interaction statement belongs to the refrigerator domain.
  • the domain classification model corresponding to the air-conditioning field is different from the domain classification model corresponding to the refrigerator field.
  • the domain classification model corresponding to the air-conditioning field is only set to determine whether the interaction sentence belongs to the air-conditioning field
  • the domain classification model corresponding to the refrigerator field is only set to determine whether the interaction sentence belongs to the refrigerator field.
  • the preset field includes N layers of sub-fields with a hierarchical relationship, and each layer of the N layers of sub-fields corresponds to at least one GPT model, N is a positive integer, and the above step S204 is implemented by the following steps S11-S12:
  • Step S11 Processing the interaction sentence output by the preset layer or the original interaction sentence according to the GPT model corresponding to the sub-domain of the current layer to obtain the interaction sentence output by the current layer, wherein, when the current layer is the first layer, the interaction sentence output by the preset layer is the original interaction sentence;
  • the original interaction sentence is processed according to the GPT model corresponding to the sub-domain of the first layer to obtain the interaction sentence output by the current layer.
  • the interaction sentence output by the preset layer is processed according to the GPT model corresponding to the sub-domain of the current layer to obtain the interaction sentence output by the current layer.
  • the preset layer is the previous layer of the current branch, or any layer of other branches (including previous layers and subsequent layers).
  • each subsequent layer of sub-fields is a sub-field of any previous layer of sub-fields.
  • the smart home field (first layer), air conditioning field (second layer), and temperature control field (third layer) are one branch; the smart home field (first layer), refrigerator field (second layer), and freezing field (third layer) are another branch.
  • Step S12 Determine the transformed interaction statement according to the interaction statement output by the current layer and the level corresponding to the current layer.
  • more refined and targeted corpus generalization is performed for the smart home field and its subcategories, so that after the interactive system obtains the user's interactive sentences, it can generalize layer by layer, thereby understanding the user's intentions at a deeper level, and then providing users with personalized recommendations and services, thereby improving the naturalness, convenience, and accuracy of user language interactions in the home field.
  • step S12 includes step S121 and step S122:
  • Step S121 when the interaction sentence output by the current layer does not belong to the sub-domain of the current layer and the current layer is not the first layer, determining the interaction sentence output by the preset layer as the transformed interaction sentence, wherein the interaction sentence output by the preset layer belongs to the sub-domain of the preset layer;
  • the interactive sentence output by the GPT model corresponding to the current layer does not belong to the corresponding sub-domain of the current layer, it means that the GPT model corresponding to the current layer has failed to generalize the interactive sentence output by the GPT model corresponding to the preset layer (generalization failure means that the intention of the interactive sentence output by the preset layer in the sub-domain of the current layer has not been recognized), and the next layer of generalization will not be continued. Since the current layer is not the first layer, it means that the preset layer has failed to generalize the interactive sentence output by the GPT model corresponding to the preset layer. The interactive sentence output by the layer belongs to the preset layer sub-domain, and then the interactive sentence output by the preset layer is determined as the transformed interactive sentence.
  • the interaction statement output by the GPT model corresponding to the current layer sub-domain does not belong to the air-conditioning domain
  • the interaction statement output by the GPT model corresponding to the preset layer sub-domain is determined as the transformed interaction statement, wherein the interaction statement output by the GPT model corresponding to the preset layer (the GPT model corresponding to the smart home domain) belongs to the smart home domain.
  • Step S122 When the interaction sentence output by the current layer belongs to the sub-domain of the current layer and the current layer is not the Nth layer, the next layer is obtained as the current layer, and the operation of processing the interaction sentence output by the preset layer or the original interaction sentence according to the GPT model corresponding to the sub-domain of the current layer to obtain the interaction sentence output by the current layer is continued until the transformed interaction sentence is obtained.
  • interaction sentence output by the current layer belongs to the sub-domain of the current layer, it means that the GPT model corresponding to the current layer has successfully generalized the interaction sentence output by the GPT model corresponding to the preset layer or the original interaction sentence (generalization failure means that the intention of the interaction sentence output by the preset layer or the original interaction sentence in the sub-domain of the current layer is not identified).
  • the current layer is not the Nth layer, it is necessary to continue to generalize the interaction sentence output by the current layer, obtain the next layer as the current layer, and continue to process the interaction sentence output by the preset layer or the original interaction sentence according to the GPT model corresponding to the sub-domain of the current layer to obtain the operation of the interaction sentence output by the current layer until the transformed interaction sentence is obtained.
  • the interaction sentence output by the GPT model corresponding to the current layer sub-domain belongs to the smart home domain
  • the interaction sentence output by the GPT model corresponding to the current layer sub-domain is input into the GPT model corresponding to the next layer sub-domain (the GPT model corresponding to the air conditioning domain)
  • the GPT model corresponding to the next layer sub-domain is continued to be used to process the interaction sentence output by the preset layer (the interaction sentence output by the GPT model corresponding to the smart home domain) until the transformed interaction sentence is obtained.
  • step S12 further includes step S123 and step S124:
  • Step S123 when the interaction sentence output by the current layer does not belong to the sub-domain of the current layer and the current layer is the first layer, determining the interaction sentence output by the current layer as the transformed interaction sentence;
  • the interaction sentence output by the GPT model corresponding to the current layer does not belong to the corresponding sub-domain of the current layer, it means that the GPT model corresponding to the current layer has failed to generalize the original interaction sentence (generalization failure means that the intention of the original interaction sentence in the sub-domain of the current layer has not been identified), and the next layer of generalization will not be continued. Since the current layer is the first layer, the interaction sentence output by the current layer is determined to be the transformed interaction sentence.
  • the interaction statement output by the GPT model corresponding to the current layer does not belong to the smart home domain
  • the interaction statement output by the GPT model corresponding to the preset layer is determined as the transformed interaction statement.
  • Step S124 when the interaction sentence output by the current layer belongs to the sub-domain of the current layer and the current layer is the Nth layer, the interaction sentence output by the current layer is determined as the transformed interaction sentence.
  • the interaction sentence output by the current layer belongs to the sub-domain of the current layer, it means that the GPT model corresponding to the current layer has successfully generalized the interaction sentence output by the GPT model corresponding to the preset layer or the original interaction sentence (generalization failure indicates that the intention of the interaction sentence output by the preset layer or the original interaction sentence in the sub-domain of the current layer is not identified), and since the current layer is already the Nth layer, there is no next layer to continue generalization, and the interaction sentence output by the current layer is determined to be a transformed interaction sentence.
  • steps S121-S124 are for determining how to transform the interactive statements in different situations, and there is no execution order between the above steps S121-S124.
  • the method further includes: determining whether the interactive sentence output by the current layer belongs to the sub-domain of the current layer through a domain classification model corresponding to the current layer.
  • the domain classification model corresponding to the current layer sub-domain is used to determine whether the interactive statement output by the GPT model corresponding to the current layer sub-domain belongs to the current layer sub-domain.
  • the domain classification model corresponding to each current layer sub-domain is used to determine whether the interactive sentence output by the GPT model corresponding to each current layer sub-domain itself belongs to each current layer sub-domain.
  • the current layer when the current layer is the second layer, the current layer includes at least the parallel air-conditioning domain and refrigerator domain. Then, the domain classification model corresponding to the air-conditioning domain is used to determine whether the interactive sentence output by the GPT model corresponding to the air-conditioning domain belongs to the air-conditioning domain, and the domain classification model corresponding to the refrigerator domain is used to determine whether the interactive sentence output by the GPT model corresponding to the refrigerator domain belongs to the refrigerator domain.
  • the above step S11 includes step S111: when the N-layer sub-fields include N sub-fields, and the i-th sub-field in the N sub-fields is a sub-field of the i-1-th sub-field, the i-th interaction statement or the original interaction statement in the i-th sub-field is parsed by the i-th GPT model corresponding to the i-th sub-field to generate the i-th interaction statement, wherein the i-1-th interaction statement is obtained according to the i-1-th GPT model corresponding to the i-1-th sub-field.
  • i is a positive integer less than or equal to N.
  • the first GPT model corresponding to the first sub-field is used to parse the intention information of the original interaction sentence in the first sub-field to generate the first interaction sentence;
  • the i-th GPT model corresponding to the i-th sub-field is used to parse the intention information of the i-1th interaction sentence output by the i-1th GPT model corresponding to the i-1th sub-field in the i-1th sub-field to generate the i-th interaction sentence, wherein the current layer is the i-th layer and the preset layer is the i-1th layer.
  • the second GPT model corresponding to the second subfield is used to parse the intent information of the first interaction statement in the second subfield to generate the second interaction statement.
  • the first interaction statement does not belong to the first subfield, the first interaction statement is directly determined as a transformed interaction statement.
  • the i-1th interaction sentence is parsed by the i-1th GPT model corresponding to the i-1th sub-field to generate the i-1th interaction sentence.
  • Interaction sentence and determine whether the i-th interaction sentence belongs to the i-th sub-field through the domain classification model corresponding to the i-th sub-field.
  • the i-th interaction sentence does not belong to the i-th sub-field, determine the i-1-th interaction sentence as a transformed interaction sentence; when the i-th interaction sentence belongs to the interaction sentence of the i-th field and i is equal to N, determine the i-th interaction sentence as a transformed interaction sentence, when the i-th interaction sentence belongs to the interaction sentence of the i-th field and i is less than N, add 1 to the value of i, and continue to execute the operation of parsing the intent information of the i-1-th interaction sentence in the i-th sub-field through the i-th GPT model corresponding to the i-th sub-field to generate the i-th interaction sentence until a transformed interaction sentence is obtained.
  • the N-layer sub-domains include domain 1, domain 2, domain 3, domain 4... in Figure 3, the original interaction sentence is processed by the GPT model GPT1 corresponding to domain 1 to obtain the first interaction sentence.
  • the first interaction sentence is determined as a transformed interaction sentence.
  • the first interaction sentence belongs to domain 1
  • the first interaction sentence is processed by the GPT model GPT2 corresponding to domain 2 to obtain the second interaction sentence.
  • the second interaction sentence does not belong to domain 2
  • the first interaction sentence is determined as a transformed interaction sentence.
  • the sentence i.e., the previous interaction sentence of the second interaction sentence
  • the second interaction sentence belongs to domain 2
  • the second interaction sentence is processed by the GPT model GPT3 corresponding to domain 3 to obtain the third interaction sentence.
  • the second interaction sentence i.e., the previous interaction sentence of the third interaction sentence
  • the third interaction sentence is processed by the GPT model GPT4 corresponding to domain 4 to obtain the fourth interaction sentence, and so on, until a transformed interaction sentence is obtained.
  • the first GPT model corresponding to the first sub-field is used to parse the intent information of the original interaction statement in the first sub-field to generate the first interaction statement;
  • the original interaction statement is processed by the GPT model GPT1 corresponding to domain 1 to obtain the first interaction statement; when the first interaction statement does not belong to domain 1, the first interaction statement is determined as a transformed interaction statement; when the first interaction statement belongs to domain 1 and does not belong to domain 2, the first interaction statement is processed by the GPT model GPT2 corresponding to domain 2 to obtain the second interaction statement; when the first interaction statement belongs to domain 1 and belongs to domain 2, it is necessary to find domain P from the N-layer domain (the first interaction statement belongs to domain P-1 and does not belong to domain P, P is a positive integer greater than or equal to 2 and less than or equal to N), and the first interaction statement is processed by the GPT model GPTP corresponding to domain P to obtain the second interaction statement, and so on until the transformed interaction statement is obtained.
  • the GPT model corresponding to the sub-domain of the current layer is used to process the interaction sentence output by the previous layer.
  • the above-mentioned step S12 when the above-mentioned step S11 includes step S111, the above-mentioned step S12 also includes: when the i-th interaction statement belongs to the interaction statement of the i-th sub-field, the i-th interaction statement belongs to the interaction statement of the i+k-th sub-field, and the i-th interaction statement does not belong to the interaction statement of the i+k+1-th sub-field, the i-th interaction statement is obtained as the interaction statement output by the preset layer, the i+k+1-th layer is obtained as the current layer, and the operation of processing the interaction statement output by the preset layer or the original interaction statement according to the GPT model corresponding to the sub-field of the current layer to obtain the interaction statement output by the current layer is continued until the transformed interaction statement is obtained, wherein k is a natural number, i+k ⁇ N.
  • the i-th interaction statement already belongs to the interaction statement of the i+1-th sub-field, there is no need to process the i-th interaction statement through the GPT model corresponding to the i+1-th sub-field, and it is necessary to find the i+k+1-th sub-field (the i-th interaction statement belongs to the interaction statement of the i+k-th sub-field, but does not belong to the interaction statement of the i+k+1-th sub-field) from the N sub-fields with a hierarchical relationship, determine the i+k+1-th layer as the current layer, and process the i-th interaction statement through the GPT model corresponding to the i+k+1-th sub-field to obtain the i+1-th interaction statement, and determine whether a transformed interaction statement is obtained. If no transformed interaction statement is obtained, continue to perform the corresponding operations based on the same logic until a transformed interaction statement is obtained. Change the interactive statement.
  • step S11 includes steps S112-S113:
  • Step S112 When the N-layer sub-domains include N groups of domains, the i-th group of domains in the N groups of domains is a sub-domain of the i-1th group of domains, each domain in the same group of domains belongs to the same level, and each group of domains corresponds to a group of GPT models, the intention information of the i-1th interaction statement or the original interaction statement in the sub-domain corresponding to the i-th sub-group domain is parsed by each GPT model in the i-th sub-group GPT model corresponding to the i-th sub-group domain to obtain the i-th group of interaction statements, wherein the i-1th interaction statement is an interaction statement generated by the i-1th current GPT model in the i-1th sub-group GPT model, the i-1th current GPT model is a GPT model corresponding to the i-1th current domain in the i-1th group of domains, and the i-th sub-group domain is a sub-domain of the
  • Step S113 Select the i-th interaction statement from the i-th group of interaction statements, wherein the i-th interaction statement is an interaction statement generated by the i-th current GPT model in the i-th sub-group GPT model, the i-th current GPT model is the GPT model corresponding to the i-th current field in the i-th sub-group field, the current layer is the i-th layer, and the preset layer is the i-1-th layer.
  • the i-th interaction statement is an interaction statement generated by the i-th current GPT model in the i-th sub-group GPT model
  • the i-th current GPT model is the GPT model corresponding to the i-th current field in the i-th sub-group field
  • the current layer is the i-th layer
  • the preset layer is the i-1-th layer.
  • each of the N layers has a set of domains
  • the N-layer sub-domains include N groups of domains, each domain in each group of domains corresponds to a GPT model, and each group of domains in the N groups of domains corresponds to a group of GPT models.
  • i is equal to 1
  • the i-1th interaction statement is the original interaction statement, and there is no i-1th sub-group GPT model, i-1th current GPT model, i-1th group of domains, and i-1th current domain.
  • the above step S12 includes: when the i-th interaction statement does not belong to the interaction statement of the i-th current domain, and i is equal to 1, determining the i-th interaction statement as the transformed interaction statement; when the i-th interaction statement does not belong to the interaction statement of the i-th current domain, and i is not equal to 1, determining the i-1-th interaction statement as the transformed interaction statement; when the i-th interaction statement belongs to the interaction statement of the i-th current domain, and i is less than N, adding 1 to the value of i, and continuing to perform the operation of processing the interaction statement output by the preset layer or the original interaction statement according to the GPT model corresponding to the sub-domain of the current layer to obtain the interaction statement output by the current layer, until the interaction statement output by the current layer is obtained. Transform the interaction statement; when the i-th interaction statement belongs to the interaction statement of the i-th current domain and i is equal to
  • whether the ith interaction statement belongs to the ith current domain is determined by using the ith current domain classification model corresponding to the ith current domain.
  • the N-layer sub-fields include: the first group of fields (fields corresponding to GPT1), the second group of fields (fields corresponding to GPT2-1, fields corresponding to GPT2-2...), the third group of fields (fields corresponding to GPT3-1, fields corresponding to GPT3-2, fields corresponding to GPT3-3, fields corresponding to GPT3-4...), the fourth group of fields (fields corresponding to GPT4-1, fields corresponding to GPT4-2, fields corresponding to GPT4-3, fields corresponding to GPT4-4)...
  • the first group of interaction sentences is obtained by parsing the intention information of the original interaction sentence in the first subgroup field (the field corresponding to GPT1) through the first subgroup GPT model (GPT1) corresponding to the first subgroup field (the field corresponding to GPT1), and the first interaction sentence is selected from the first group of interaction sentences.
  • the first current GPT model is GPT1
  • the field corresponding to GPT1 is the first current field
  • the second subgroup field is the subfield of the first current field (the field corresponding to GPT1) in the second group of fields (the field corresponding to GPT2-1, the field corresponding to GPT2-2).
  • the first interactive sentence When the first interactive sentence does not belong to the first current domain, the first interactive sentence is determined as a transformed interactive sentence.
  • the intent information of the first interaction statement in the sub-domain corresponding to the second sub-group domain is parsed by each GPT model in the second sub-group GPT model (GPT2-1, GPT2-2...) corresponding to the second sub-group domain (the domain corresponding to GPT2-1, the domain corresponding to GPT2-2...), to obtain the second group of interaction statements.
  • the intent information of the first interaction statement in the domain corresponding to GPT2-1 is parsed by GPT2-1 to obtain the interaction statement output by GPT2-1
  • the intent information of the first interaction statement in the domain corresponding to GPT2-2 is parsed by GPT2-2 to obtain the interaction statement output by GPT2-2...
  • the second group of interaction statements is obtained, and the second interaction statement is selected from the second group of interaction statements.
  • the second interaction statement is the interaction statement output by GPT2-1 after GPT2-1 parses the intent information of the first interaction statement in the domain corresponding to GPT2-1
  • the second current GPT model is GPT2-1
  • the domain corresponding to GPT2-1 is The domain is the second current domain
  • the third sub-group domain is the sub-domain of the second current domain (the domain corresponding to GPT2-1) in the third group of domains (the domain corresponding to GPT3-1, the domain corresponding to GPT3-2).
  • the first interactive sentence is determined as a transformed interactive sentence.
  • the third group of interaction statements is obtained by parsing the intent information of the second interaction statement in the sub-domain corresponding to the third sub-group domain (the domain corresponding to GPT3-1, the domain corresponding to GPT3-2%) through each GPT model in the third sub-group GPT model (GPT3-1, GPT3-2).
  • the intent information of the second interaction statement in the domain corresponding to GPT3-1 is parsed by GPT3-1 to obtain the interaction statement output by GPT3-1
  • the intent information of the second interaction statement in the domain corresponding to GPT3-2 is parsed by GPT3-2 to obtain the interaction statement output by GPT3-2...
  • the third group of interaction statements is obtained, and the third interaction statement is selected from the third group of interaction statements.
  • the third interaction sentence is the interaction sentence output by GPT3-1 after parsing the intention information of the second interaction sentence in the field corresponding to GPT3-1
  • the third current GPT model is GPT3-1
  • the field corresponding to GPT3-1 is the third current field
  • the fourth sub-group field is the sub-field of the third current field (the field corresponding to GPT3-1) in the fourth group of fields (the field corresponding to GPT4-1, the field corresponding to GPT4-2).
  • the second interactive statement is determined as a transformed interactive statement.
  • the third interactive statement belongs to the third current domain, the third interactive statement is processed by the above principle.
  • the above-mentioned selecting the i-th interaction statement from the i-th group of interaction statements includes: selecting the interaction statement with the highest confidence from the i-th group of interaction statements to obtain the i-th interaction statement, wherein the confidence of each interaction statement in the i-th group of interaction statements is the confidence generated by the corresponding GPT model in the i-th sub-group GPT model based on the intention information of the parsed i-1-th interaction statement on the corresponding field in the i-th sub-group field.
  • the method before parsing the intention information of the original interaction sentence in the preset domain through the target generative pre-trained GPT model and determining the transformation of the interaction sentence according to the intention information, the method further includes steps S21-S22:
  • Step S21 obtaining M GPT models corresponding to the N-layer sub-domains, wherein M is a positive integer greater than or equal to N;
  • N-layer sub-domain includes N sub-domains
  • M N
  • N groups of domains M>N.
  • step S21 can be implemented in the following manner:
  • the j-th GPT model among the M GPT models is obtained by the following method 1 or method 2, wherein j is a positive integer greater than or equal to 1 and less than or equal to M:
  • Method 1 Obtain a first general GPT model, wherein the first general GPT model is a model trained using first predetermined data; train the first general GPT model using a j-th group of training data corresponding to a j-th field to obtain a j-th GPT model corresponding to the j-th field;
  • the first general GPT model is a general GPT model trained using a large amount of data acquired by itself.
  • Method 2 Send the jth group of training data corresponding to the jth field to the designated platform by calling the designated interface of the designated platform; obtain the jth GPT model corresponding to the jth field obtained by training the second general GPT model using the jth group of training data on the designated platform, wherein the second general GPT model is a model trained by the designated platform using second predetermined data.
  • the second general GPT model is a general GPT model obtained by a third-party platform through a large amount of data training.
  • the GPT model corresponding to the preset domain can be obtained in two ways, namely, the first general GPT model can be trained using the data labeled with the preset domain to obtain the GPT model corresponding to the preset domain, or the data labeled with the preset domain can be sent to a third-party platform, and the third-party platform can train the second general GPT model based on the data labeled with the preset domain.
  • the GPT model corresponding to the preset domain trained by the third-party platform can be used by calling the relevant interface of the third-party platform.
  • Step S22 deploy the M GPT models in a distributed manner in corresponding servers.
  • the GPT model obtained by method one among the M GPT models can be deployed on any server, and the GPT model obtained by method two among the M GPT models needs to be deployed on a server corresponding to a third-party platform, such as an Azure server.
  • a third-party platform such as an Azure server.
  • the general GPT model can be trained using sample data of non-preset domains with preset domain annotations to obtain a target generative pre-trained GPT model.
  • a supervised learning algorithm may be used to train the general GPT model, wherein the general GPT model is trained for the i-th round through the following steps S31-S36:
  • Step S31 inputting the i-th sample interaction sentence of the non-preset domain in the training sample set into the general GPT model obtained by the i-1th round of training, wherein the i-th sample interaction sentence corresponds to the preset i-th first type annotated interaction sentence and the i-th second type annotated interaction sentence;
  • the i-th sample interaction sentence may be “I want to turn on the control”
  • the first type of labeled interaction sentence may be “I want to turn on the air conditioner”
  • the second type of labeled interaction sentence may be “I want to turn on the fan”.
  • the context information corresponding to the i-th sample interaction statement may also be input into the general GPT model obtained by the i-1th round of training.
  • Step S32 performing grammatical error correction processing on the i-th sample interaction sentence by using the general GPT model obtained by the i-1th round of training to obtain the i-th group of first-type candidate interaction sentences, and determining the i-th first-type candidate interaction sentence in the i-th group of first-type candidate interaction sentences;
  • the i-th group of first type candidate interaction sentences includes multiple first type candidate interaction sentences obtained by performing grammatical correction processing on the i-th sample interaction sentence.
  • grammatical correction includes but is not limited to: synonym replacement, near-synonym replacement, word order adjustment, etc.
  • the grammatical error correction process is performed on the i-th sample interaction sentence by the general GPT model obtained by the i-1th round of training to obtain the i-th group of first-type candidate interaction sentences, including: the grammatical error correction process is performed on the i-th sample interaction sentence by the general GPT model obtained by the i-1th round of training to obtain the i-th group of first-type candidate interaction sentences and the corresponding i group confidence;
  • Determining the i-th first type candidate interaction statement in the i-th group of first type candidate interaction statements includes: selecting the first type candidate interaction statement with the highest confidence in the i-th group of first type candidate interaction statements to obtain the i-th first type candidate interaction statement.
  • Step S33 performing semantic expansion processing on the i-th sample interaction sentence through the general GPT model obtained by the i-1th round of training to obtain the i-th group of second-type candidate interaction sentences, and determining the i-th second-type candidate interaction sentence in the i-th group of second-type candidate interaction sentences;
  • the i-th group of second-type candidate interaction sentences includes a plurality of second-type candidate interaction sentences obtained by performing semantic expansion processing on the i-th sample interaction sentence.
  • Step S34 determining a target loss value for the i-th round of training according to the i-th first-type labeled interaction sentence, the i-th first-type candidate interaction sentence, the i-th second-type labeled interaction sentence, and the i-th second-type candidate interaction sentence;
  • the first loss value of the i-th first-type labeled interaction statement and the i-th first-type candidate interaction statement can be calculated, and the second loss value of the i-th second-type labeled interaction statement and the i-th second-type candidate interaction statement can be calculated, and then the target loss value of the i-th round of training can be determined based on the first loss value and the second loss value.
  • Step S35 When the target loss value of the i-th round of training does not meet the preset training cutoff condition, the parameters of the general GPT model obtained by the i-1-th round of training are adjusted to determine the general GPT model obtained by the i-th round of training;
  • Step S36 When the target loss value of the i-th round of training meets the preset training cutoff condition, the training is terminated.
  • the general GPT model at the end of the training is determined as the target GPT model.
  • feature design can be performed to guide the training of the general GPT model, and then the general GPT model can be trained using sample data of non-preset domains with preset domain annotations.
  • the model is fine-tuned to obtain a target generative pre-trained GPT model, wherein the algorithms used in the fine-tuning process include but are not limited to a sorting algorithm model and a PPO criterion.
  • Feature design can be understood as when training the general GPT model, its input includes: sample interaction sentences and context information corresponding to the sample interaction sentences, and its output includes: transformed interaction sentences and label information corresponding to the transformed interaction sentences, wherein the label information is used to indicate whether the transformed interaction sentence is a first type of transformed interaction sentence or a second type of transformed interaction sentence, wherein the first type of transformed interaction sentence is a sentence obtained by performing grammatical correction processing on the sample interaction sentence (weakly generalized sentence), and the second type of transformed interaction sentence is a sentence obtained by performing semantic expansion processing on the sample interaction sentence (strongly generalized sentence).
  • the general domain classification model and the general GPT model can also be jointly trained by supervised learning to obtain a domain classification model corresponding to the preset domain and a target generative pre-trained GPT model.
  • the general domain classification model and the general GPT model can be jointly trained for the i-th round by following the steps S41-S49:
  • Step S41 inputting the i-th sample interaction sentence of the non-preset domain in the training sample set into the general GPT model obtained by the i-1th round of training, wherein the i-th sample interaction sentence corresponds to the preset i-th first type annotated interaction sentence, the i-th second type annotated interaction sentence, and the i-th actual domain;
  • Step S42 performing the grammatical error correction process on the i-th sample interaction sentence through the general GPT model obtained by the i-1th round of training to obtain the i-th group of first-type candidate interaction sentences, and determining the i-th first-type candidate interaction sentence in the i-th group of first-type candidate interaction sentences;
  • Step S43 performing the semantic expansion process on the i-th sample interaction sentence through the general GPT model obtained by the i-1th round of training to obtain the i-th group of second-type candidate interaction sentences, and determining the i-th second-type candidate interaction sentence in the i-th group of second-type candidate interaction sentences;
  • Step S44 determining a first target loss value of the i-th round of training according to the i-th first type labeled interaction sentence, the i-th first type candidate interaction sentence, the i-th second type labeled interaction sentence, and the i-th second type candidate interaction sentence;
  • Step S45 Input the ith sample interaction sentence into the general domain classification model obtained by the i-1th round of training, and use the general domain classification model obtained by the i-1th round of training to classify the ith sample
  • the interactive sentences are processed by domain classification to obtain the i-th predicted domain;
  • Step S46 determining a second target loss value of the i-th round of training according to the i-th predicted domain and the i-th actual domain;
  • Step S47 determining a target loss value for the i-th round of training according to the first target loss value for the i-th round of training and the second target loss value for the i-th round of training;
  • Step S48 When the target loss value of the i-th round of training does not meet the preset training cutoff condition, the parameters in the general GPT model obtained by the i-1-th round of training and the parameters in the general domain classification model obtained by the i-1-th round of training are adjusted to determine the general GPT model obtained by the i-th round of training and the general domain classification model obtained by the i-th round of training;
  • the preset training end condition includes at least one of the following: the target loss value converges or the target loss value is less than a first preset threshold.
  • the preset training end condition can also be determined according to the training round, for example, the preset training end condition is satisfied when the training round is greater than a second preset threshold.
  • Step S49 When the target loss value of the i-th round of training meets the preset training cutoff condition, the training is terminated.
  • the general domain classification model can be trained using interactive statements of the preset domain to obtain a domain classification model corresponding to the preset domain.
  • the general domain classification model can be trained using interactive statements corresponding to the air-conditioning domain to obtain a domain classification model corresponding to the air-conditioning domain; the general domain classification model can be trained using interactive statements corresponding to the refrigerator domain to obtain a domain classification model corresponding to the refrigerator domain.
  • step S204 includes the following steps S51-S53:
  • Step S51 using the target GPT model, performing grammatical error correction processing on the original interaction sentence according to the intention information to obtain a group of first type candidate interaction sentences;
  • a set of first-type candidate interaction sentences is the result of weak generalization of the original interaction sentences by the target GPT model.
  • Step S52 performing semantic expansion processing on the original interaction sentence according to the intention information through the target GPT model to obtain a set of second type candidate interaction sentences;
  • a set of second-type candidate interaction sentences is the result of the target GPT model's strong generalization of the original interaction sentence. For example, if the original interaction sentence is "I'm sweating all over", the target GPT model in the smart home field can perform strong generalization processing on the original interaction sentence to generate a transformed interaction sentence "I'm hot, turn on the air conditioner” or “I'm hot, turn on the fan” or “Turn on the water heater” and so on.
  • Step S53 determining a transformed interaction statement from the group of first-type candidate interaction statements and the group of second-type candidate interaction statements.
  • the above-mentioned step S206 also includes: when the transformed interaction statement belongs to the preset domain and the transformed interaction statement is determined to be an interaction statement in the group of first type candidate interaction statements through the label information of the transformed interaction statement, executing the operation corresponding to the transformed interaction statement; when the transformed interaction statement belongs to the preset domain and the transformed interaction statement is determined to be an interaction statement in the group of second type candidate interaction statements through the label information of the transformed interaction statement, entering the inquiry process.
  • the interactive system can directly perform the operation corresponding to the transformed interaction sentence; if the transformed interaction sentence generated by the target GPT model is a second-type transformed interaction sentence (i.e., a strongly generalized sentence), and the second-type transformed interaction sentence is a sentence obtained by semantically expanding the original interaction sentence, then in order to avoid semantic expansion errors, it is necessary to enter the fuzzy intent inquiry process and ask the user to generate The transformed interactive statement is correct, and then corresponding processing is performed according to the user's reply statement.
  • a first-type transformed interaction sentence i.e., a weakly generalized sentence
  • the interactive system can directly perform the operation corresponding to the transformed interaction sentence
  • the transformed interaction sentence generated by the target GPT model is a second-type transformed interaction sentence (i.e., a strongly generalized sentence)
  • the second-type transformed interaction sentence is a sentence obtained by semantically expanding the original interaction sentence
  • a large amount of prior knowledge is often required to establish a language model.
  • a generative pre-training (GPT) model as a system's prior knowledge language model, a language model capability with more corpus generalization characteristics can often be obtained.
  • GPT generative pre-training
  • the present disclosure generates a characteristic GPT model in the smart home field through supervised learning of smart home field labeled data based on the general GPT model, calls the model in the form of domain logic allocation, and applies it to the existing smart home interaction system, thereby improving the system's generalization ability to understand user language.
  • the present disclosure constructs an intelligent interaction system and reinforcement learning mechanism based on the GPT generalization model.
  • the characteristic GPT model is generated by coupling the general GPT model with fine-tuning data, and is coupled with the original interaction engine in the form of domain classifier coupling.
  • the user's original input and domain classifier results, as well as the characteristic GPT generalization results can also be used as self-learning training data to perform a reinforcement learning mechanism.
  • the data for reinforcement learning is accumulated to achieve the purpose of model self-learning.
  • the GPT3 playground provided by Microsoft Azure Open AI can be used to fine-tune the homeGPT with smart home characteristics (i.e., the target GPT model in the smart home field) through the in-context learning model self-learning training method.
  • the query with unified intent of existing generalized data can be used as "prompt” and “completion” to generate a characteristic GPT and deploy it on the Azure server.
  • the characteristic GPT (such as homeGPT) is generated and deployed on the Azure server
  • the characteristic GPT model can be used.
  • the following is a specific description in conjunction with Figure 7.
  • the user's original query query request, that is, the original interaction statement in the previous text
  • the user is first classified by domain.
  • the domain classification result is smart home domain
  • the user's original query is directly input into the dialogue engine, and the dialogue engine directly parses and interacts with the user's original query
  • a generalized query that is, the transformed interaction statement in the previous article
  • the generalized query is reclassified by domain
  • the secondary classification result is in the smart home domain
  • the generalized query is input into the dialogue engine, and the dialogue engine parses and interacts with the generalized query
  • the secondary classification result is not in the smart home domain
  • the user's original query is input into the dialogue engine, and the dialogue engine parses and interacts with the user's original query.
  • a smart home user queries: "I am sweating" (the query is the user's description of his or her own situation in an ordinary life scenario)
  • the interactive system recognizes through homeGPT that the user may want to turn on the water heater.
  • the interactive system then converts the user's intention into user intention analysis in the intelligent interactive dialogue system, and asks the user based on the product design, such as replying "Do you need help turning on the water heater?" If the user replies "yes", the device control command is issued to turn on the water heater bound to the user's home account.
  • the user's original query, generalized query, and domain classification results can be used as self-learning training data to perform a reinforcement learning mechanism.
  • reinforcement learning data is accumulated to achieve the purpose of model self-learning.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method.
  • the technical solution of the present disclosure, or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present disclosure.
  • a storage medium such as ROM/RAM, a disk, or an optical disk
  • a processing device for interactive sentences based on a target-generated pre-trained GPT model is also provided, and the device is configured to implement the above-mentioned embodiments and preferred implementations, and the descriptions that have been made are not repeated.
  • the term "module” may be software and/or hardware that implements a predetermined function.
  • the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
  • FIG9 is a structural block diagram of a device for processing interactive sentences based on a target-generated pre-trained GPT model according to an embodiment of the present disclosure, the device comprising:
  • a determination module 92 is configured to determine a domain classification result of an input original interaction sentence through a domain classification model, and determine whether the original interaction sentence belongs to a preset domain based on the domain classification result;
  • the generating module 94 is configured to, when it is determined that the original interaction sentence does not belong to the preset domain, parse the intention information of the original interaction sentence in the preset domain through the target generative pre-trained GPT model, and generate a transformed interaction sentence according to the intention information;
  • the interaction module 96 is configured to perform interaction processing according to the transformed interaction statement.
  • the above-mentioned device when it is determined through the domain classification model that the original interactive sentence does not belong to the preset domain, parses the intention information of the original interactive sentence in the preset domain through the target generation pre-trained GPT model, and generates a transformed interactive sentence according to the intention information, and then performs interactive processing according to the transformed interactive sentence.
  • the above-mentioned technical scheme enables the interactive system to mine the user's implicit intention, improves the interactive system's ability to understand the input interactive sentence, and then the interactive system can accurately respond accordingly, solving the problem that the interactive system directly performs interactive processing according to the interactive sentence, resulting in poor interactive effect.
  • the interactive system can mine the user's implicit intention and has a stronger ability to understand the interactive sentence, the interactive system can achieve a more natural and intimate interactive method according to the user's intention, and improve the intelligence of the interactive system; and because the interactive system more accurately identifies the user's implicit intention, the interactive system can actively continue or guide new topics, and then the interactive system has the ability to conduct continuous dialogue like between people, which makes the interactive experience in the field of human-computer interaction have a qualitative leap.
  • the interaction module 96 is further configured to use the original interaction sentence to perform interaction processing when it is determined based on the field classification result that the original interaction sentence belongs to the preset field.
  • the interaction module 96 is further configured to use the original interaction sentence to perform interaction processing when it is determined that the transformed interaction sentence does not belong to the preset domain.
  • the interaction module 96 is further configured to use the transformed interaction statement to perform interaction processing when it is determined that the transformed interaction statement belongs to the preset domain.
  • the generation module 94 is further configured to include N layers of sub-domains with a hierarchical relationship in the preset domain, each layer of the N layers of sub-domains corresponds to at least one GPT model, and when N is a positive integer, the interaction sentence output by the preset layer or the original interaction sentence is processed according to the GPT model corresponding to the current layer of sub-domain to obtain the interaction sentence output by the current layer, wherein when the current layer is the first layer, the interaction sentence output by the preset layer is the original interaction sentence; the transformed interaction sentence is determined according to the interaction sentence output by the current layer and the hierarchy corresponding to the current layer.
  • the generation module 94 is also configured to, when the interaction sentence output by the current layer does not belong to the sub-domain of the current layer and the current layer is not the first layer, determine the interaction sentence output by the preset layer as the transformed interaction sentence, wherein the interaction sentence output by the preset layer belongs to the sub-domain of the preset layer; when the interaction sentence output by the current layer belongs to the sub-domain of the current layer and the current layer is not the Nth layer, obtain the next layer as the current layer, and continue to execute the operation of processing the interaction sentence output by the preset layer or the original interaction sentence according to the GPT model corresponding to the sub-domain of the current layer to obtain the interaction sentence output by the current layer, until the transformed interaction sentence is obtained.
  • the generation module 94 is further configured to, when the interaction statement output by the current layer does not belong to the sub-domain of the current layer and the current layer is the first layer, determine the interaction statement output by the current layer as the transformed interaction statement; and when the interaction statement output by the current layer belongs to the sub-domain of the current layer and the current layer is the Nth layer, determine the interaction statement output by the current layer as the transformed interaction statement.
  • the determination module 92 is further configured to determine whether the interactive sentence output by the current layer belongs to the sub-domain of the current layer through a domain classification model corresponding to the current layer.
  • the generating module 94 is further configured to, when the N-layer sub-fields include N sub-fields and the i-th sub-field in the N sub-fields is a sub-field of the i-1-th sub-field, parse the intention information of the i-1-th interaction sentence or the original interaction sentence in the i-th sub-field through the i-th GPT model corresponding to the i-th sub-field to generate the i-th interaction sentence.
  • Sentence wherein the i-1th interaction sentence is obtained according to the i-1th GPT model corresponding to the i-1th sub-field, the current layer is the i-th layer, and the preset layer is the i-1th layer.
  • the generation module 94 is also configured to obtain the i-th interaction statement as the interaction statement output by the preset layer, obtain the i+k+1 layer as the current layer, and continue to perform the operation of processing the interaction statement output by the preset layer or the original interaction statement according to the GPT model corresponding to the sub-field of the current layer to obtain the interaction statement output by the current layer, when the i-th interaction statement belongs to the interaction statement of the i-th sub-field, the i-th interaction statement belongs to the interaction statement of the i+k sub-field, and the i-th interaction statement does not belong to the interaction statement of the i+k+1 sub-field, until the transformed interaction statement is obtained, wherein k is a natural number, i+k ⁇ N.
  • the generation module 94 is further configured to parse the intention information of the i-1th interaction statement or the original interaction statement in the sub-statement corresponding to the i-1th sub-statement through each GPT model in the i-1th sub-group GPT model corresponding to the i-1th sub-statement, to obtain the i-1th group of interaction statements, when the N-layer sub-statements include N groups of domains, the i-th group of domains in the N groups of domains is a sub-statement of the i-1th group of domains, each domain in the same group of domains belongs to the same level, and each group of domains corresponds to a group of GPT models.
  • an interaction sentence generated by an i-1th current GPT model is the GPT model corresponding to the i-1th current field in the i-1th group of fields, and the i-th sub-group field is the sub-field of the i-1th current field in the i-th group of fields; an i-th interaction sentence is selected from the i-th group of interaction sentences, wherein the i-th interaction sentence is the interaction sentence generated by the i-th current GPT model in the i-th sub-group GPT model, the i-th current GPT model is the GPT model corresponding to the i-th current field in the i-th sub-group field, the current layer is the i-th layer, and the preset layer is the i-1-th layer.
  • the generation module 94 is further configured to, when the i-th interaction statement does not belong to the interaction statement of the i-th current domain, determine the i-1-th interaction statement as the transformed interaction statement; when the i-th interaction statement belongs to the interaction statement of the i-th current domain and i is less than N, add 1 to the value of i, and continue to perform the operation of processing the interaction statement output by the preset layer or the original interaction statement according to the GPT model corresponding to the sub-domain of the current layer to obtain the interaction statement output by the current layer, until the transformed interaction statement is obtained; in the i-th interaction statement, When a sentence belongs to the interaction sentence of the i-th current domain and i is equal to N, the i-th interaction sentence is determined as the transformed interaction sentence.
  • the generation module 94 is also configured to select the interaction statement with the highest confidence in the i-th group of interaction statements to obtain the i-th interaction statement, wherein the confidence of each interaction statement in the i-th group of interaction statements is the confidence generated by the corresponding GPT model in the i-th sub-group GPT model based on the intention information of the i-1-th interaction statement parsed in the corresponding field in the i-th sub-group field.
  • the determination module 92 is further configured to determine whether the i-th interaction statement belongs to the i-th current domain by using the i-th current domain classification model corresponding to the i-th current domain.
  • the above-mentioned device also includes: a deployment module, which is configured to obtain M GPT models corresponding to the N-layer sub-domains before parsing the intent information of the original interaction statement in the preset domain through the target generative pre-trained GPT model and determining the transformed interaction statement according to the intent information, wherein M is a positive integer greater than or equal to N; and distribute the M GPT models in the corresponding servers.
  • a deployment module which is configured to obtain M GPT models corresponding to the N-layer sub-domains before parsing the intent information of the original interaction statement in the preset domain through the target generative pre-trained GPT model and determining the transformed interaction statement according to the intent information, wherein M is a positive integer greater than or equal to N; and distribute the M GPT models in the corresponding servers.
  • the above-mentioned device also includes: a deployment module, which is configured to obtain M GPT models corresponding to the N-layer sub-domains in the following manner: obtaining the j-th GPT model among the M GPT models in one of the following manners, wherein j is a positive integer greater than or equal to 1 and less than or equal to M: obtaining a first general GPT model, wherein the first general GPT model is a model trained using first predetermined data; training the first general GPT model using the j-th group of training data corresponding to the j-th domain to obtain the j-th GPT model corresponding to the j-th domain; sending the j-th group of training data corresponding to the j-th domain to the designated platform by calling a designated interface of the designated platform; obtaining the j-th GPT model corresponding to the j-th domain obtained by training the second general GPT model using the j-th group of training data by the designated platform, wherein the second general GPT model is
  • the apparatus further includes: a first training module configured to analyze the intention of the original interactive sentence in the preset domain through a target-generated pre-trained GPT model.
  • the general GPT model is trained for the i-th round through the following steps: the i-th sample interaction sentence of the non-preset domain in the training sample set is input into the general GPT model obtained through the i-1-th round of training, wherein the i-th sample interaction sentence corresponds to the preset i-th first-type labeled interaction sentence and the i-th second-type labeled interaction sentence; the general GPT model obtained through the i-1-th round of training performs grammatical error correction on the i-th sample interaction sentence to obtain the i-th group of first-type candidate interaction sentences, and determines the i-th first-type candidate interaction sentence in the i-th group of first-type candidate interaction sentences; the general GPT model obtained through the i-1-th round of training
  • the first training module is also configured to perform the grammatical correction processing on the i-th sample interaction sentence through the general GPT model obtained by the i-1th round of training to obtain the i-th group of first-type candidate interaction sentences in the following manner: perform the grammatical correction processing on the i-th sample interaction sentence through the general GPT model obtained by the i-1th round of training to obtain the i-th group of first-type candidate interaction sentences and the corresponding i-th group of confidences; determine the i-th first-type candidate interaction sentence in the i-th group of first-type candidate interaction sentences in the following manner: select the first-type candidate interaction sentence with the highest confidence in the i-th group of first-type candidate interaction sentences to obtain the i-th first-type candidate interaction sentence.
  • the above-mentioned device also includes: a second training module, which is configured to perform the i-th round of joint training on the general domain classification model and the general GPT model by the following steps before parsing the intention information of the original interaction sentence in the preset domain through the target generative pre-trained GPT model and generating the transformed interaction sentence according to the intention information: inputting the i-th sample interaction sentence of the non-preset domain in the training sample set into the general GPT model obtained by the i-1-th round of training, wherein the i-th i sample interaction sentences correspond to the preset i-th first type annotated interaction sentence, i-th second type annotated interaction sentence, and i-th actual field; the i-th sample interaction sentence is subjected to the grammatical error correction processing by the general GPT model obtained by the i-1-th round of training to obtain the i-th group of first type candidate interaction sentences, and the i-th first type candidate interaction sentence is determined in the i-
  • the generation module 94 is also configured to perform grammatical error correction processing on the original interaction sentences according to the intention information through the target GPT model to obtain a group of first type candidate interaction sentences; perform semantic expansion processing on the original interaction sentences according to the intention information through the target GPT model to obtain a group of second type candidate interaction sentences; and determine the transformed interaction sentences from the group of first type candidate interaction sentences and the group of second type candidate interaction sentences.
  • the interaction module 96 is further configured to execute an operation corresponding to the transformed interaction statement when the transformed interaction statement belongs to the preset domain and the transformed interaction statement is determined to be an interaction statement in the set of first type candidate interaction statements through the label information of the transformed interaction statement; and when the transformed interaction statement belongs to the preset domain and the transformed interaction statement is determined to be an interaction statement in the set of first type candidate interaction statements through the label information of the transformed interaction statement.
  • the inquiry process is entered.
  • FIG10 is a structural block diagram of a system for processing interactive sentences based on a target-generated pre-trained GPT model according to an embodiment of the present disclosure, the system comprising:
  • the domain classification model 102 is configured to perform domain classification on the input original interaction sentence to determine whether the original interaction sentence belongs to a preset domain;
  • the target-generated pre-trained GPT model 104 is configured to parse the intention information of the original interaction sentence in the preset domain when the original interaction sentence does not belong to the preset domain, and generate a transformed interaction sentence according to the intention information;
  • the dialogue engine 106 is configured to perform interaction processing according to the transformed interaction sentences.
  • the above system when it is determined through the domain classification model that the original interaction sentence does not belong to the preset domain, parses the intention information of the original interaction sentence in the preset domain through the target generation pre-trained GPT model, and generates a transformed interaction sentence according to the intention information, and then performs interaction processing according to the transformed interaction sentence.
  • the above technical solution enables the interaction system to mine the user's implicit intention, improves the interaction system's ability to understand the input interaction sentence, and then the interaction system can accurately respond accordingly, solving the problem that the interaction system directly performs interaction processing according to the interaction sentence, resulting in poor interaction effect.
  • the interaction system can mine the user's implicit intention and has a stronger ability to understand the interaction sentence, the interaction system can achieve a more natural and intimate interaction method according to the user's intention, and improve the intelligence of the interaction system; and because the interaction system more accurately identifies the user's implicit intention, the interaction system can actively continue or guide new topics, and then the interaction system has the ability to conduct continuous dialogue like between people, which makes the interaction experience in the field of human-computer interaction have a qualitative leap.
  • An embodiment of the present disclosure further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
  • the storage medium may be configured to store a computer program configured to perform the following steps:
  • the above-mentioned computer-readable storage medium may include, but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
  • An embodiment of the present disclosure further provides an electronic device, as shown in FIG11 , the electronic device includes a memory 1102 and a processor 1104 , the memory 1102 stores a computer program, and the processor 1104 is configured to execute the steps in any of the above method embodiments through the computer program.
  • the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
  • the processor 1104 may be configured to perform the following steps through a computer program:
  • FIG. 11 is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices.
  • FIG. 11 does not limit the structure of the above-mentioned electronic device.
  • the electronic device may also include more or fewer components (such as a network interface, etc.) than those shown in FIG. 11, or have a configuration different from that shown in FIG. 11.
  • the memory 1102 can be used to store software programs and modules, such as the program instructions/modules corresponding to the processing method and device of the interactive sentence based on the target generative pre-trained GPT model in the embodiment of the present invention, and the processor 1104 executes various functional applications and data processing by running the software programs and modules stored in the memory 1102, that is, the processing method of the interactive sentence based on the target generative pre-trained GPT model is realized.
  • the memory 1102 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 1102 may further include a memory remotely arranged relative to the processor 1104, and these remote memories may be connected to the terminal via a network.
  • Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
  • the above-mentioned memory 1102 may include, but is not limited to, the determination module 92, the generation module 94, and the interaction module 96 in the processing device for the interactive sentence based on the target generative pre-trained GPT model.
  • other module units in the above-mentioned semantic conversion device may also be included but not limited to, which will not be described in detail in this example.
  • the transmission device 1106 is used to receive or send data via a network.
  • the above-mentioned network may include a wired network and a wireless network.
  • the transmission device 1106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network.
  • the transmission device 1106 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
  • RF Radio Frequency
  • the electronic device further includes: a display 1108 and a connection bus 1110 for connecting various module components in the electronic device.
  • the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
  • modules or steps of the present disclosure can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation.
  • the present disclosure is not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Human Computer Interaction (AREA)
  • Computational Linguistics (AREA)
  • Machine Translation (AREA)

Abstract

一种基于目标生成式预训练GPT模型的交互语句的处理方法及装置、系统、存储介质及电子装置,涉及智慧家庭技术领域,该方法包括:通过领域分类模型确定输入的原始交互语句的领域分类结果,并基于所述领域分类结果确定所述原始交互语句是否属于预设领域(S202);在确定所述原始交互语句不属于所述预设领域的情况下,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句(S204);根据所述变换交互语句进行交互处理(S206)。

Description

基于目标生成式预训练GPT模型的交互语句的处理方法
本公开要求于2023年4月20日提交中国专利局、申请号为202310428886.9、发明名称“基于目标生成式预训练GPT模型的交互语句的处理方法”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
技术领域
本公开涉及智慧家庭技术领域,具体而言,涉及一种基于目标生成式预训练GPT模型的交互语句的处理方法及装置、系统、存储介质及电子装置。
背景技术
随着智慧生活的到来,越来越多的用户喜欢使用交互语句的方式同交互系统进行交互,但现有方式中,交互系统是直接基于用户输入的交互语句进行交互,但在一些情况下,由于交互系统无法正确识别用户的交互语句,进而导致无法对用户的交互语句做出正确的响应。
针对相关技术中,交互系统直接根据交互语句进行交互处理,导致交互效果较差的问题,目前尚未提出有效的解决方案。
因此,有必要对相关技术予以改良以克服相关技术中的所述缺陷。
发明内容
本公开实施例提供了一种基于目标生成式预训练GPT模型的交互语句的处理方法及装置、存储介质及电子装置,以至少解决交互系统直接根据交互语句进行交互处理,导致交互效果较差的问题。
根据本公开实施例的一方面,提供一种基于目标生成式预训练GPT模型的交互语句的处理方法,包括:通过领域分类模型确定输入的原始交互语句的领域分类结果,并基于所述领域分类结果确定所述原始交互语句是否属于预设领域; 在确定所述原始交互语句不属于所述预设领域的情况下,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;根据所述变换交互语句进行交互处理。
根据本公开实施例的另一方面,还提供了一种基于目标生成式预训练GPT模型的交互语句的处理装置,包括:确定模块,被设置为通过领域分类模型确定输入的原始交互语句的领域分类结果,并基于所述领域分类结果确定所述原始交互语句是否属于预设领域;生成模块,被设置为在确定所述原始交互语句不属于所述预设领域的情况下,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;交互模块,被设置为根据所述变换交互语句进行交互处理。
根据本公开实施例的又一方面,还提供了一种基于目标生成式预训练GPT模型的交互语句的处理系统,包括:领域分类模型,被设置为对输入的原始交互语句进行领域分类,确定所述原始交互语句是否属于预设领域;目标生成式预训练GPT模型,被设置为在所述原始交互语句不属于所述预设领域的情况下,解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;对话引擎,被设置为根据所述变换交互语句进行交互处理。
根据本公开实施例的又一方面,还提供了一种计算机可读的存储介质,该计算机可读的存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述基于目标生成式预训练GPT模型的交互语句的处理方法。
根据本公开实施例的又一方面,还提供了一种电子装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,上述处理器通过计算机程序执行上述基于目标生成式预训练GPT模型的交互语句的处理方法。
根据本公开实施例的又一方面,还提供了一种计算机程序产品,包括非易失性计算机可读存储介质,所述非易失性计算机可读存储介质存储计算机程序,所述计算机程序被设置为运行时执行上述基于目标生成式预训练GPT模型的交互语句的处理方法。
本公开,在通过领域分类模型确定原始交互语句不属于预设领域的情况下,通过目标生成式预训练GPT模型解析原始交互语句在预设领域上的意图信息,并根据意图信息生成变换交互语句,进而根据变换交互语句进行交互处理,采用上述技术方案,使得交互系统可以挖掘用户的隐含意图,提高了交互系统对输入的交互语句的理解能力,进而交互系统可以准确地进行相应的响应,提高了交互效果,解决了交互系统直接根据交互语句进行交互处理,导致交互效果较差的问题。此外,由于交互系统可以挖掘用户的隐含意图,对交互语句的理解能力更强,使得交互系统可以根据用户意图实现更加自然贴心的交互方式、提高了交互系统的智能度;并且由于交互系统更加准确的识别了用户的隐含意图,使得交互系统可以主动地延续或者引导出新的话题,进而交互系统具备像人与人之间那样进行连续对话的能力,使得人机交互领域的交互体验有了质的飞跃。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起被设置为解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是根据本公开实施例的一种基于目标生成式预训练GPT模型的交互语句的处理方法的硬件环境示意图;
图2是根据本公开实施例的基于目标生成式预训练GPT模型的交互语句的处理方法的流程图;
图3是根据本公开实施例的基于目标生成式预训练GPT模型的交互语句的处理方法的整体框架图(一);
图4(a)是根据本公开实施例的一种预设领域的示意图;
图4(b)是根据本公开实施例的另一种预设领域的示意图;
图5是根据本公开实施例的一种生成变换交互语句的流程示意图;
图6是根据本公开实施例的另一种生成变换交互语句的流程示意图;
图7是根据本公开实施例的基于目标生成式预训练GPT模型的交互语句的处理方法的整体框架图(二);
图8是根据本公开实施例的强化学习的框架图;
图9是根据本公开实施例的基于目标生成式预训练GPT模型的交互语句的处理装置的结构框图;
图10是根据本公开实施例的基于目标生成式预训练GPT模型的交互语句的处理系统的结构框图;
图11是根据本公开实施例的一种可选的电子装置的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本公开方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分的实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本公开保护的范围。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是被设置为区别类似的对象,而不必被设置为描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有 的其它步骤或单元。
根据本公开实施例的一个方面,提供了一种基于目标生成式预训练GPT模型的交互语句的处理方法。该基于目标生成式预训练GPT模型的交互语句的处理方法广泛应被设置为智慧家庭(Smart Home)、智能家居、智能家用设备生态、智慧住宅(IntelligenceHouse)生态等全屋智能数字化控制应用场景。可选地,在本实施例中,上述基于目标生成式预训练GPT模型的交互语句的处理方法可以应被设置为如图1所示的由终端设备102和服务器104所构成的硬件环境中。如图1所示,服务器104通过网络与终端设备102进行连接,可被设置为为终端或终端上安装的客户端提供服务(如应用服务等),可在服务器上或独立于服务器设置数据库,被设置为为服务器104提供数据存储服务,可在服务器上或独立于服务器配置云计算和/或边缘计算服务,被设置为为服务器104提供数据运算服务。
上述网络可以包括但不限于以下至少之一:有线网络,无线网络。上述有线网络可以包括但不限于以下至少之一:广域网,城域网,局域网,上述无线网络可以包括但不限于以下至少之一:WIFI(Wireless Fidelity,无线保真),蓝牙。终端设备102可以并不限定于为PC、手机、平板电脑、智能空调、智能烟机、智能冰箱、智能烤箱、智能炉灶、智能洗衣机、智能热水器、智能洗涤设备、智能洗碗机、智能投影设备、智能电视、智能晾衣架、智能窗帘、智能影音、智能插座、智能音响、智能音箱、智能新风设备、智能厨卫设备、智能卫浴设备、智能扫地机器人、智能擦窗机器人、智能拖地机器人、智能空气净化设备、智能蒸箱、智能微波炉、智能厨宝、智能净化器、智能饮水机、智能门锁等。
为了解决上述问题,在本实施例中提供了一种基于目标生成式预训练GPT模型的交互语句的处理方法,包括但不限于应用在交互系统(交互系统包括但不限于部署在上述终端设备102)中,图2是根据本公开实施例的基于目标生成式预训练GPT模型的交互语句的处理方法的流程图,该流程包括如下步骤:
步骤S202:通过领域分类模型确定输入的原始交互语句的领域分类结果,并基于所述领域分类结果确定所述原始交互语句是否属于预设领域;
作为一种可选的示例,领域分类模型被设置为确定原始交互语句是否属于预 设领域,即领域分类模型实现一种二分类,领域分类结果为原始交互语句属于预设领域或者原始交互语句不属于预设领域。
作为一种可选的示例,所述预设领域为交互系统所处的领域(例如:智慧家庭领域、智能车载系统领域等)。在一些实施例中,交互系统为基于目标生成式预训练GPT模型的交互语句的处理系统,该交互系统包括对话引擎。
在一个示例性的实施例中,在上述步骤S202之后,还包括:在基于所述领域分类结果确定所述原始交互语句属于所述预设领域的情况下,使用所述原始交互语句进行交互处理。
需要说明的是,如果原始交互语句本身就属于预设领域,进而交互系统是可以准确地确定用户的意图,可以准确地基于原始交互语句进行相应的响应,无需将原始交互语句输入至目标GPT模型中。
步骤S204:在确定所述原始交互语句不属于所述预设领域的情况下,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;
作为一种可选的示例,上述目标生成式预训练GPT模型为与预设领域相对应的GPT模型,进而通过预设领域对应的目标GPT模型解析原始交互语句在预设领域上的意图信息,并根据意图信息生成变换交互语句,可以提高交互系统对原始交互语句的理解能力。
作为一种可选的示例,可以对现有的通用GPT模型(包括但不限于微软Azure Open AI提供的GPT4模型、Text-to-Text Transfer Transformer(T5)模型等对话式通用大规模文本预训练模型)、或者厂商自主研发的类大规模文本预训练模型(使用厂商的研发人员收集到大量的数据训练得到的模型)进行微调处理,得到预设领域对应的目标GPT模型。
作为一种可选的示例,目标生成式预训练GPT(Generative Pre-Training,生成式预训练)模型可以对原始交互语句在预设领域上进行语法纠错处理,得到弱泛化语句,也可以对原始交互语句在预设领域上进行语义扩展处理,得到强泛化 语句。
在一个示例性的实施例中,在上述步骤S202之后,还包括:在基于所述领域分类结果确定所述原始交互语句属于所述预设领域的情况下,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句。
需要说明的是,为了进一步的提高交互系统对原始交互语句的理解能力,可以在原始交互语句属于预设领域的情况下,也通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据意图信息生成变换交互语句。
步骤S206:根据所述变换交互语句进行交互处理。
在一个示例性的实施例中,上述步骤S206可以通过以下方式实现:在确定所述变换交互语句不属于所述预设领域的情况下,使用所述原始交互语句进行交互处理。
需要说明的是,如果变换交互语句不属于预设领域,则说明交互系统通过目标GPT模型也无法识别出原始交互语句在预设领域的意图,进而基于用户的原始表达,交互系统直接使用原始交互语句进行交互处理。
在一个示例性的实施例中,上述步骤S206还可以通过以下方式实现:在确定所述变换交互语句属于所述预设领域的情况下,使用所述变换交互语句进行交互处理。
需要说明的是,如果变换交互语句属于预设领域,则说明通过目标GPT模型已经识别出了原始交互语句在预设领域的意图,进而为了提高交互效果,则交互系统使用变换交互语句进行交互处理。
需要说明的是,本公开实施例中,确定原始交互语句是否属于预设领域的领域分类模型与确定变换交互语句是否属于预设领域的领域分类模型例如可以是同一个领域分类模型。为了更好的进行理解,以下结合图3进行具体说明,通过领域分类器(相当于上述领域分类模型)对原始交互语句进行分类,得到领域分 类结果,并根据领域分类结果确定原始交互语句是否属于预设领域,在确定原始交互语句属于预设领域的情况下,将原始交互语句直接输入至对话引擎(对话引擎位于交互系统),在确定原始交互语句不属于预设领域的情况下,将原始交互语句输入至目标GPT模型中,得到目标GPT模型输出的变换交互语句,并继续使用领域分类器对变换交互语句进行领域分类,如果变换交互语句属于预设领域,则将变换交互语句输入至对话引擎中,如果变换交互语句不属于预设领域,则将原始交互语句输入至对话引擎中。
需要说明的是,在相关技术中的交互系统直接根据用户的原始交互语句进行交互处理主要存在以下问题:
1、不够拟人化:当前人机交互系统仅仅只是基于现有知识库进行搜索,简单的理解用户所要表达意图,进而在面对复杂、实时、与用户主观观点相关的深度交互语句时,难以从深层次的理解用户的意图,进而难以针对用户的交互语句做出有效理解和回答;
2、缺乏持续交互能力:当前人机交互系统无法主动地延续或者引导出新的话题,使得当前人机交互系统无法像人与人之间那样进行持续地交互;
3、准确度不高,智能化程度较低:当前人机交互系统无法挖掘用户的隐含意图,进而无法准确的理解用户的交互语句,无法实现自然贴心的交互方式。
针对上述问题,本公开实施例通过上述步骤,在通过领域分类模型确定原始交互语句不属于预设领域的情况下,通过目标生成式预训练GPT模型解析原始交互语句在预设领域上的意图信息,并根据意图信息生成变换交互语句,进而根据变换交互语句进行交互处理,采用上述技术方案,使得交互系统可以挖掘用户的隐含意图,提高了交互系统对输入的交互语句的理解能力,进而交互系统可以准确地进行相应的响应,解决了交互系统直接根据交互语句进行交互处理,导致交互效果较差的问题。此外,由于交互系统可以挖掘用户的隐含意图,对交互语句的理解能力更强,使得交互系统可以根据用户意图实现更加自然贴心的交互方式、提高了交互系统的智能度;并且由于交互系统更加准确的识别了用户的隐含意图,使得交互系统可以主动地延续或者引导出新的话题,进而交互系统具备像 人与人之间那样进行连续对话的能力,使得人机交互领域的交互体验有了质的飞跃。
在一个示例性的实施例中,预设领域包括具有层级关系的N层子领域。
为了更好的理解,作为一种可选的示例,如图4(a)所示,在N为3、且每层中不存在并列的子领域的情况下,N层子领域为:智慧家庭领域(第一层),空调领域(第二层)、温度调节领域(第三层)。需要说明的是,一个子领域对应一个GPT模型,下一层领域为相对应的上一层领域的子领域。
作为一种可选的示例,在预设领域包括具有层级关系的N层子领域、且每层中不存在并列的子领域的情况下,通过每一层子领域对应的领域分类模型确定交互语句是否属于每一层子领域。例如,通过空调领域对应的领域分类模型确定交互语句是否属于空调领域,通过温度调节领域对应的领域分类模型确定交互语句是否属于温度调节领域。
作为一种可选的示例,如图4(b)所示,在N为3、且每层中存在并列的子领域的情况下,则N层子领域为:智慧家庭领域(第一层),空调领域(第二层)、冰箱领域(第二层)、温度调节领域(第三层)...冷冻领域(第三层)...。
作为一种可选的示例,在预设领域包括具有层级关系的N层子领域、且每层中存在并列的子领域的情况下,通过每一层子领域中每个子领域对应的领域分类模型确定交互语句是否属于所述每个子领域。例如,通过空调领域对应的领域分类模型确定交互语句是否属于空调领域,通过冰箱领域对应的领域分类模型确定交互语句是否属于冰箱领域。
在一些实施例中,空调领域对应的领域分类模型与冰箱领域对应的领域分类模型不同,空调领域对应的领域分类模型仅被设置为确定交互语句是否属于空调领域,冰箱领域对应的领域分类模型仅被设置为确定交互语句是否属于冰箱领域。在一个示例性的实施例中,在预设领域包括具有层级关系的N层子领域,所述N层子领域中的每层子领域分别对应至少一个GPT模型,N为正整数,上述步骤S204通过以下步骤S11-S12实现:
步骤S11:根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句,其中,在所述当前层是第一层的情况下,所述预设层输出的交互语句是所述原始交互语句;
作为一种可选的示例,在当前层为第一层的情况下,根据第一层子领域对应的GPT模型对原始交互语句进行处理,得到当前层输出的交互语句。在当前层不是第一层的情况下,根据当前层子领域对应的GPT模型对预设层输出的交互语句进行处理,得到当前层输出的交互语句。
作为一种可选的示例,预设层为当前分支的先前层,或者其他分支的任一层(包括先前层、后续层)。在一个分支上,后续每一层子领域均为先前任一层子领域的子领域。例如,智慧家庭领域(第一层),空调领域(第二层)、温度调节领域(第三层)为一个分支;智慧家庭领域(第一层)、冰箱领域(第二层)、冷冻领域(第三层)为另一个分支。
步骤S12:根据所述当前层输出的交互语句和所述当前层对应的层级,确定所述变换交互语句。
在本实施例中,针对智慧家庭领域及智慧家庭领域下的子类,进行更精细化、针对性的语料泛化,使得交互系统在获取到用户的交互语句以后,可以逐层进行泛化,从而更深层次的理解用户的意图,进而可以给用户提供个性化的推荐和服务,提升家庭领域用户语言交互的自然度、便利性、准确性等。
在一个示例性的实施例中,上述步骤S12包括步骤S121与步骤S122:
步骤S121:在所述当前层输出的交互语句不属于所述当前层子领域、且所述当前层不是第一层的情况下,将所述预设层输出的交互语句确定为所述变换交互语句,其中,所述预设层输出的交互语句属于所述预设层子领域;
需要说明的是,如果当前层对应的GPT模型输出的交互语句不属于对应的当前层子领域,则说明当前层对应的GPT模型对预设层对应的GPT模型输出的交互语句泛化失败(泛化失败即表明未识别出预设层输出的交互语句在当前层子领域的意图),则不继续进行下一层泛化,由于当前层不是第一层,则说明预设 层输出的交互语句属于所述预设层子领域,进而将预设层输出的交互语句确定为所述变换交互语句。
为了更好的理解,作为一种可选的示例,如图4(a)所示,假设当前层子领域为空调领域,则如果当前层子领域对应的GPT模型输出的交互语句不属于空调领域,则将预设层子领域对应的GPT模型(智慧家庭领域对应的GPT模型)输出的交互语句确定为变换交互语句,其中,预设层对应的GPT模型(智慧家庭领域对应的GPT模型)输出的交互语句属于智慧家庭领域。
步骤S122:在所述当前层输出的交互语句属于所述当前层子领域、且所述当前层不是第N层的情况下,将下一层获取为所述当前层,并继续执行所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句的操作,直至得到所述变换交互语句。
需要说明的是,如果当前层输出的交互语句属于所述当前层子领域、则说明当前层对应的GPT模型对预设层对应的GPT模型输出的交互语句或者原始交互语句泛化成功(泛化失败即表明未识别出预设层输出的交互语句或者原始交互语句在当前层子领域的意图),而由于当前层不是第N层,进而需要继续对当前层输出的交互语句进行泛化,将下一层获取为当前层,并继续执行根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句的操作,直至得到变换交互语句。
为了更好的进行理解,作为一种可选的示例,如图4(a)所示,假设当前层子领域为智慧家庭领域,则如果当前层子领域对应的GPT模型输出的交互语句属于智慧家庭领域,则将当前层子领域对应的GPT模型(智慧家庭领域对应的GPT模型)输出的交互语句输入至下一层子领域对应的GPT模型(空调领域对应的GPT模型),继续使用下一层子领域对应的GPT模型对预设层输出的交互语句(智慧家庭领域对应的GPT模型输出的交互语句)进行处理,直至得到变换交互语句。
在一个示例性的实施例中,上述步骤S12还包括步骤S123与步骤S124:
步骤S123:在所述当前层输出的交互语句不属于所述当前层子领域、且所述当前层是第一层的情况下,将所述当前层输出的交互语句确定为所述变换交互语句;
需要说明的是,如果当前层对应的GPT模型输出的交互语句不属于对应的当前层子领域,则说明当前层对应的GPT模型对原始交互语句泛化失败(泛化失败即表明未识别出原始交互语句在当前层子领域的意图),则不继续进行下一层泛化,由于当前层是第一层,进而将当前层输出的交互语句确定为所述变换交互语句。
作为一种可选的示例,如图4(a)所示,假设当前层子领域为智慧家庭领域,则如果当前层对应的GPT模型输出的交互语句不属于智慧家庭领域,则将预设层对应的GPT模型(智慧家庭领域对应的GPT模型)输出的交互语句确定为变换交互语句。
步骤S124:在所述当前层输出的交互语句属于所述当前层子领域、且所述当前层是第N层的情况下,将所述当前层输出的交互语句确定为所述变换交互语句。
需要说明的是,如果当前层输出的交互语句属于所述当前层子领域、则说明当前层对应的GPT模型对预设层对应的GPT模型输出的交互语句或者原始交互语句泛化成功(泛化失败即表明未识别出预设层输出的交互语句或者原始交互语句在当前层子领域的意图),而由于当前层已经是第N层,即已经不存在下一层继续进行泛化,进而将当前层输出的交互语句确定为变换交互语句。
需要说明的是,上述步骤S121-S124为在不同的情况下,如何确定变换交互语句,上述步骤S121-S124之间并不存在执行的先后顺序。
在一个示例性的实施例中,所述方法还包括:通过所述当前层对应的领域分类模型确定所述当前层输出的交互语句是否属于所述当前层子领域。
作为一种可选的示例,在当前层中仅有一个当前层子领域的情况下,通过当前层子领域对应的领域分类模型确定当前层子领域对应的GPT模型输出的交互语句是否属于所述当前层子领域。
作为一种可选的示例,在当前层中有多个并列的当前层子领域的情况下,通过每个当前层子领域对应的领域分类模型确定所述每个当前层子领域自身对应的GPT模型输出的交互语句是否属于所述每个当前层子领域。例如,如图4(b)所示,在当前层为第二层的情况下,当前层至少包括并列的空调领域和冰箱领域,则通过空调领域对应的领域分类模型确定空调领域对应的GPT模型输出的交互语句是否属于空调领域,通过冰箱领域对应的领域分类模型确定冰箱领域对应的GPT模型输出的交互语句是否属于冰箱领域。
在一个示例性的实施例中,上述步骤S11包括步骤S111:在所述N层子领域包括N个子领域、且所述N个子领域中的第i个子领域为第i-1个子领域的子领域的情况下,通过所述第i个子领域对应的第i个GPT模型解析所述第i-1个交互语句或所述原始交互语句在所述第i个子领域上的意图信息,生成第i个交互语句,其中,所述第i-1个交互语句根据第i-1个子领域对应的第i-1个GPT模型得到。需要说明的是,i为小于或等于N的正整数。
作为一种可选的示例,在当前层为第i层,且i为1的情况下,通过第1个子领域对应的第1个GPT模型解析原始交互语句在所述第1个子领域上的意图信息,生成第1交互语句,在当前层为第i层,且i不为1的情况下,通过第i个子领域对应的第i个GPT模型解析第i-1个子领域对应的第i-1个GPT模型输出的第i-1个交互语句在所述第i个子领域上的意图信息,生成第i个交互语句,其中,所述当前层为第i层,所述预设层为第i-1层。
需要说明的是,在第1个子领域对应的第1个GPT模型输出的第1个交互语句属于所述第1个子领域的情况下,才通过第2个子领域对应的第2个GPT模型解析第1个交互语句在第2个子领域上的意图信息,生成第2个交互语句。在所述第1个交互语句不属于所述第1个子领域的情况下,直接将第1个交互语句确定为变换交互语句。
需要说明的是,在i不为1、第i-1个子领域对应的第i-1个GPT模型输出的第i-1个交互语句属于所述第i个子领域的情况下,才通过第i个子领域对应的第i个GPT模型解析第i-1个交互语句在第i个子领域上的意图信息,生成第i个交 互语句,并通过第i个子领域对应的领域分类模型确定第i个交互语句是否属于第i个子领域,在第i个交互语句不属于所述第i个子领域的情况下,将第i-1个交互语句确定为变换交互语句;在所述第i个交互语句属于第i个领域的交互语句、且i等于N的情况下,将第i个交互语句确定为变换交互语句,在第i个交互语句属于第i个领域的交互语句、且i小于N的情况下,将i的取值加1,继续执行通过第i个子领域对应的第i个GPT模型解析第i-1个交互语句在第i个子领域上的意图信息,生成第i个交互语句的操作,直至得到变换交互语句。
为了更好的理解,以下结合图3进行具体说明,在N层子领域包括图3中的领域1、领域2、领域3、领域4...的情况下,通过领域1对应的GPT模型GPT1对原始交互语句进行处理,得到第1个交互语句,在第1个交互语句不属于领域1的情况下,将第1个交互语句确定为变换交互语句,在第1个交互语句属于领域1的情况下,通过领域2对应的GPT模型GPT2对第1个交互语句进行处理,得到第2个交互语句,在第2个交互语句不属于领域2的情况下,将第1个交互语句(即第2个交互语句的上一个交互语句)确定为变换交互语句,在第2个交互语句属于领域2的情况下,通过领域3对应的GPT模型GPT3对第2个交互语句进行处理,得到第3个交互语句,在第3个交互语句不属于领域3的情况下,将第2个交互语句(即第3个交互语句的上一个交互语句)确定为变换交互语句,在第3个交互语句属于领域3的情况下,通过领域4对应的GPT模型GPT4对第3个交互语句进行处理,得到第4个交互语句,以此类推,直至得到变换交互语句。
作为一种可选的示例,在当前层为第i层,且i为1的情况下,通过第1个子领域对应的第1个GPT模型解析原始交互语句在所述第1个子领域上的意图信息,生成第1交互语句,在当前层为第i+k层,且i不为1的情况下,通过第i+k个子领域对应的第i+k个GPT模型解析第i-1个子领域对应的第i-1个GPT模型输出的第i-1个交互语句在所述第i+k个子领域上的意图信息,生成第i个交互语句,其中,第i-1个交互语句属于所述第i-1个子领域、所述第i-1个交互语句属于第i+k-1个子领域、且第i-1个交互语句不属于第i+k个子领域,k为大于或等于0的正整数,i+k<=N,所述当前层为第i+k层,所述预设层为第i-1层。
为了更好的进行理解,以下结合图5进行具体说明,在N层子领域包括图5中的领域1、领域2、领域3、领域P...的情况下,通过领域1对应的GPT模型GPT1对原始交互语句进行处理,得到第1个交互语句;在第1个交互语句不属于领域1的情况下,将第1个交互语句确定为变换交互语句;在第1个交互语句属于领域1、且不属于领域2的情况下,通过领域2对应的GPT模型GPT2对第1个交互语句进行处理,得到第2个交互语句;在第1个交互语句属于领域1、且属于领域2的情况下,则需要从N层领域中找到领域P(第1个交互语句属于领域P-1、且不属于领域P、P为大于或等于2、小于或等于N正整数),并通过领域P对应的GPT模型GPTP对第1个交互语句进行处理,得到第2个交互语句,以此类推,直至得到变换交互语句。
也就是说,只有在先前层输出的交互语句不属于当前层子领域的情况下,才使用当前层子领域对应的GPT模型对先前层输出的交互语句进行处理。
在一个示例性的实施例中,在上述步骤S11包括步骤S111的情况下,上述步骤S12还包括:在所述第i个交互语句属于所述第i个子领域的交互语句、所述第i个交互语句属于第i+k个子领域的交互语句、且所述第i个交互语句不属于第i+k+1个子领域的交互语句的情况下,将所述第i个交互语句获取为所述预设层输出的交互语句,将所述第i+k+1层获取为所述当前层,并继续执行所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句的操作,直至得到所述变换交互语句,其中,所述k为自然数,i+k<N。
需要说明的是,如果第i个交互语句已经属于所述第i+1个子领域的交互语句,则无需通过第i+1个子领域对应的GPT模型来对第i个交互语句进行处理,需要从具有层级关系的N个子领域中找到第i+k+1个子领域(第i个交互语句属于第i+k个子领域的交互语句、但不属于第i+k+1个子领域的交互语句),将所述第i+k+1层确定为当前层,通过第i+k+1个子领域对应的GPT模型来对第i个交互语句进行处理,得到第i+1个交互语句,并确定是否得到变换交互语句,如果没有得到变换交互语句,则基于相同的逻辑继续进行相应的操作,直至得到变 换交互语句。
在一个示例性的实施例中,上述步骤S11包括步骤S112-S113:
步骤S112:在所述N层子领域包括N组领域、所述N组领域中的第i组领域为第i-1组领域的子领域、同一组领域中的各个领域属于同一层级、且各组领域对应一组GPT模型的情况下,通过第i子组领域对应的第i子组GPT模型中的各个GPT模型解析第i-1个交互语句或所述原始交互语句在所述第i子组领域中对应的子领域上的意图信息,得到第i组交互语句,其中,所述第i-1个交互语句是第i-1子组GPT模型中的第i-1个当前GPT模型生成的交互语句,所述第i-1个当前GPT模型是第i-1组领域中的第i-1个当前领域对应的GPT模型,所述第i子组领域是所述第i-1个当前领域在第i组领域中的子领域;
步骤S113:在所述第i组交互语句中选择第i个交互语句,其中,所述第i个交互语句是所述第i子组GPT模型中的第i个当前GPT模型生成的交互语句,所述第i个当前GPT模型是所述第i子组领域中的第i个当前领域对应的GPT模型,所述当前层为第i层,所述预设层为第i-1层。
需要说明的是,N层中的每一层具有一组领域,进而N层子领域包括N组领域,每一组领域中的每一个领域都对应一个GPT模型,进而N组领域中的每一组领域对应一组GPT模型。需要说明的是,在i等于1的时候,第i-1个交互语句为原始交互语句,并且不存在第i-1子组GPT模型、第i-1个当前GPT模型i-1组领域、以及第i-1个当前领域。
在一个示例性的实施例中,在上述步骤S11包括步骤S112-S113的情况下,上述步骤S12包括:在所述第i个交互语句不属于所述第i个当前领域的交互语句、且i等于1的情况下,将所述第i个交互语句确定为所述变换交互语句;在所述第i个交互语句不属于所述第i个当前领域的交互语句、且i不等于1的情况下,将所述第i-1个交互语句确定为所述变换交互语句;在所述第i个交互语句属于所述第i个当前领域的交互语句、且i小于N的情况下,将i的取值加1,并继续执行所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句的操作,直至得到所述 变换交互语句;在所述第i个交互语句属于所述第i个当前领域的交互语句、且i等于N的情况下,将所述第i个交互语句确定为所述变换交互语句。
在一个示例性的实施例中,通过所述第i个当前领域对应的第i个当前领域分类模型确定所述第i个交互语句是否属于所述第i个当前领域。
为了更好的理解上述N层子领域包括N组领域的情况,以下结合图6进行具体说明,如图6所示,N层子领域包括:第一组领域(GPT1对应的领域)、第二组领域(GPT2-1对应的领域、GPT2-2对应的领域...)、第三组领域(GPT3-1对应的领域、GPT3-2对应的领域、GPT3-3对应的领域、GPT3-4对应的领域...)、第四组领域(GPT4-1对应的领域、GPT4-2对应的领域、GPT4-3对应的领域、GPT4-4对应的领域...)...。
通过第1子组领域(GPT1对应的领域)对应第1子组GPT模型(GPT1)解析原始交互语句在第1子组领域(GPT1对应的领域)上的意图信息,得到第1组交互语句,并从第1组交互语句中选择第1个交互语句。其中,第1个当前GPT模型为GPT1,GPT1对应的领域为第1个当前领域,第2子组领域是第1个当前领域(GPT1对应的领域)在第2组领域中的子领域(GPT2-1对应的领域、GPT2-2对应的领域...)。
在第1个交互语句不属于第1个当前领域的情况下,将第1个交互语句确定为变换交互语句。
在第1个交互语句属于第1个当前领域的情况下,通过第2子组领域(GPT2-1对应的领域、GPT2-2对应的领域...)对应的第2子组GPT模型(GPT2-1、GPT2-2...)中的各个GPT模型解析第1个交互语句在第2子组领域中对应的子领域上的意图信息,得到第2组交互语句。具体的,通过GPT2-1解析第1个交互语句在GPT2-1对应的领域的意图信息,得到GPT2-1输出的交互语句,通过GPT2-2解析第1个交互语句在GPT2-2对应的领域的意图信息,得到GPT2-2输出的交互语句....进而得到第2组交互语句,并从第2组交互语句中选择第2个交互语句。如果第2个交互语句是GPT2-1解析第1个交互语句在GPT2-1对应的领域的意图信息后输出的交互语句,第2个当前GPT模型为GPT2-1,GPT2-1对应的领 域为第2个当前领域,第3子组领域是第2个当前领域(GPT2-1对应的领域)在第3组领域中的子领域(GPT3-1对应的领域、GPT3-2对应的领域...)。
在第2个交互语句不属于第2个当前领域的情况下,将第1个交互语句确定为变换交互语句。
在第2个交互语句属于第2个当前领域的情况下,通过第3子组领域(GPT3-1对应的领域、GPT3-2对应的领域...)对应的第3子组GPT模型(GPT3-1、GPT3-2...)中的各个GPT模型解析第2个交互语句在第3子组领域中对应的子领域上的意图信息,得到第3组交互语句。具体的,通过GPT3-1解析第2个交互语句在GPT3-1对应的领域的意图信息,得到GPT3-1输出的交互语句,通过GPT3-2解析第2个交互语句在GPT3-2对应的领域的意图信息,得到GPT3-2输出的交互语句....进而得到第3组交互语句,并从第3组交互语句中选择第3个交互语句。如果第3个交互语句是GPT3-1解析第2个交互语句在GPT3-1对应的领域的意图信息后输出的交互语句,第3个当前GPT模型为GPT3-1,GPT3-1对应的领域为第3个当前领域,第4子组领域是第3个当前领域(GPT3-1对应的领域)在第4组领域中的子领域(GPT4-1对应的领域、GPT4-2对应的领域...)。
在第3个交互语句不属于第3个当前领域的情况下,将第2个交互语句确定为变换交互语句。在第3个交互语句属于第3个当前领域的情况下,继续采用上述原理对第3个交互语句进行处理。
在一个示例性的实施例中,上述在所述第i组交互语句中选择第i个交互语句,包括:在所述第i组交互语句中选择置信度最高的交互语句,得到所述第i个交互语句,其中,所述第i组交互语句中的各个交互语句的置信度是所述第i子组GPT模型中对应的GPT模型根据解析到的所述第i-1个交互语句在所述第i子组领域中对应的领域上的意图信息生成的置信度。
在一个示例性的实施例中,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息确定变换交互语句之前,所述方法还包括步骤S21-S22:
步骤S21:获取所述N层子领域对应的M个GPT模型,其中,所述M为大于或等于N的正整数;
作为一种可选的示例,在N层子领域包括N个子领域的情况下,M=N;在N层子领域包括N组领域的情况下,M>N。
在一个示例性的实施例中,上述步骤S21可以通过以下方式实现:
通过以下方式一或者方式二获取所述M个GPT模型中的第j个GPT模型,其中,所述j为大于或等于1,小于或等于M的正整数:
方式一:获取第一通用GPT模型,其中,所述第一通用GPT模型为使用第一预定数据训练得到的模型;使用第j个领域对应的第j组训练数据对所述第一通用GPT模型进行训练,得到所述第j个领域对应的第j个GPT模型;
需要说明的是,第一通用GPT模型是使用自身获取到的大量数据训练得到的一种通用GPT模型。
方式二:通过调用指定平台的指定接口将所述第j个领域对应的第j组训练数据发送至所述指定平台;获取所述指定平台使用所述第j组训练数据对第二通用GPT模型进行训练得到的所述第j个领域对应的第j个GPT模型,其中,所述第二通用GPT模型为所述指定平台使用第二预定数据训练得到的模型。
需要说明的是,第二通用GPT模型是第三方平台通过大量的数据训练得到的一种通用GPT模型。
需要说明的是,如图3所示,预设领域对应的GPT模型可以通过两种方式得到,即可以使用带有预设领域的标注的数据对第一通用GPT模型进行训练,进而得到预设领域对应的GPT模型,也可以将带有预设领域的标注的数据发送至第三方平台,进而第三方平台根据带有预设领域的标注的数据对第二通用GPT模型进行训练,通过调用第三方平台的相关接口就可以使用第三方平台训练得到的预设领域对应的GPT模型。
步骤S22:将所述M个GPT模型分布式部署在对应的服务器中。
在一个示例性的实施例中,M个GPT模型中通过方式一得到的GPT模型可以部署在任意服务器上,M个GPT模型中通过方式二得到的GPT模型需要部署与第三方平台相对应的服务器上,例如Azure服务器。
需要说明的是,在上述步骤S204之前,需要预先训练得到目标生成式预训练GPT模型,具体的,可以使用带有预设领域标注的非预设领域的样本数据对通用GPT模型进行训练,进而得到目标生成式预训练GPT模型。
在一个示例性的实施例中,在上述步骤S204之前,可以使用监督学习算法来对通用GPT模型进行训练,其中,通过以下步骤S31-S36对通用GPT模型进行第i轮训练:
步骤S31:将训练样本集合中的非预设领域的第i个样本交互语句输入到第i-1轮训练得到的通用GPT模型中,其中,所述第i个样本交互语句对应预设的第i个第一类型标注交互语句和第i个第二类型标注交互语句;
作为一种可选的示例,第i个样本交互语句可以为“我要开控调”,第一类型标注交互语句为“我要开空调”,第二类型标注交互语句为“我要开风扇”。
作为一种可选的示例,还可以将第i个样本交互语句对应的上下文信息输入至输入到第i-1轮训练得到的通用GPT模型。
步骤S32:通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行语法纠错处理,得到第i组第一类型候选交互语句,并在所述第i组第一类型候选交互语句中确定第i个第一类型候选交互语句;
需要说明的是,第i组第一类型候选交互语句包括对第i个样本交互语句进行语法纠错处理得到的多个第一类型候选交互语句。需要说明的是,语法纠错包括但不限于:同义词替换,近义词替换,语序调整等等。
在一个示例性的实施例中,通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行所述语法纠错处理,得到第i组第一类型候选交互语句,包括:通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行所述语法纠错处理,得到所述第i组第一类型候选交互语句以及对应的第 i组置信度;
在所述第i组第一类型候选交互语句中确定第i个第一类型候选交互语句,包括:在所述第i组第一类型候选交互语句中选择置信度最高的第一类型候选交互语句,得到所述第i个第一类型候选交互语句。
步骤S33:通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行语义扩展处理,得到第i组第二类型候选交互语句,并在所述第i组第二类型候选交互语句中确定第i个第二类型候选交互语句;
需要说明的是,第i组第二类型候选交互语句包括对第i个样本交互语句进行语义扩展处理得到的多个第二类型候选交互语句。
步骤S34:根据所述第i个第一类型标注交互语句、所述第i个第一类型候选交互语句、所述第i个第二类型标注交互语句和所述第i个第二类型候选交互语句,确定第i轮训练的目标损失值;
作为一种可选的示例,可以计算第i个第一类型标注交互语句和第i个第一类型候选交互语句的第一损失值,计算第i个第二类型标注交互语句和第i个第二类型候选交互语句的第二损失值,进而根据第一损失值和第二损失值确定第i轮训练的目标损失值。
步骤S35:在所述第i轮训练的目标损失值不满足预设训练截止条件的情况下,对所述第i-1轮训练得到的通用GPT模型中的参数进行调整,确定出第i轮训练得到的通用GPT模型;
步骤S36:在所述第i轮训练的目标损失值满足预设训练截止条件的情况下,结束训练。
需要说明的是,在结束训练时,将结束训练时的通用GPT模型确定为目标GPT模型。
在一个示例性的实施例中,可以进行特征设计以对通用GPT模型的训练进行引导,进而再使用带有预设领域标注的非预设领域的样本数据对通用GPT模 型进行微调处理,进而得到目标生成式预训练GPT模型,其中,微调处理中使用的算法包括但不限于排序算法模型以及PPO准则。
特征设计可以理解为在对通用GPT模型进行训练的时候,其输入包括:样本交互语句以及样本交互语句对应的上下文信息,其输出包括:变换交互语句以及变换交互语句对应的标签信息,其中,标签信息用于指示变换交互语句是第一类型变换交互语句还是第二类型变换交互语句,其中,第一类型变换交互语句是对样本交互语句进行语法纠错处理得到的语句(弱泛化语句),第二类型变换交互语句是对样本交互语句进行语义扩展处理得到的语句(强泛化语句)。
在一个示例性的实施例中,在上述步骤S204之前,还可以使用监督学习的方式对通用领域分类模型和通用GPT模型进行联合训练,进而得到预设领域对应领域分类模型和目标生成式预训练GPT模型,可选的,可以通过以下步骤S41-S49对通用领域分类模型和通用GPT模型进行第i轮联合训练:
步骤S41:将训练样本集合中的非预设领域的第i个样本交互语句输入到第i-1轮训练得到的通用GPT模型中,其中,所述第i个样本交互语句对应预设的第i个第一类型标注交互语句、第i个第二类型标注交互语句、第i个实际领域;
步骤S42:通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行所述语法纠错处理,得到第i组第一类型候选交互语句,并在所述第i组第一类型候选交互语句中确定第i个第一类型候选交互语句;
步骤S43:通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行所述语义扩展处理,得到第i组第二类型候选交互语句,并在所述第i组第二类型候选交互语句中确定第i个第二类型候选交互语句;
步骤S44:根据所述第i个第一类型标注交互语句、所述第i个第一类型候选交互语句、所述第i个第二类型标注交互语句和所述第i个第二类型候选交互语句,确定第i轮训练的第一目标损失值;
步骤S45:将所述第i个样本交互语句输入到第i-1轮训练得到的通用领域分类模型中,并通过所述第i-1轮训练得到的通用领域分类模型对所述第i个样本 交互语句进行领域分类处理,得到第i个预测领域;
步骤S46:根据所述第i个预测领域和所述第i个实际领域,确定第i轮训练的第二目标损失值;
步骤S47:根据所述第i轮训练的第一目标损失值和所述第i轮训练的第二目标损失值,确定第i轮训练的目标损失值;
步骤S48:在所述第i轮训练的目标损失值不满足预设训练截止条件的情况下,对所述第i-1轮训练得到的通用GPT模型中的参数和所述第i-1轮训练得到的通用领域分类模型中的参数进行调整,确定出第i轮训练得到的通用GPT模型和第i轮训练得到的通用领域分类模型;
作为一种可选的示例,预设训练结束条件包括以下至少之一:目标损失值收敛或者目标损失值小于第一预设阈值。在另一些实施例中,还可以根据训练轮次确定预设训练截止条件,例如训练轮次大于第二预设阈值时满足预设训练截至条件。
步骤S49:在所述第i轮训练的目标损失值满足预设训练截止条件的情况下,结束训练。
需要说明的是,可以使用预设领域的交互语句对通用领域分类模型进行训练,得到预设领域对应的领域分类模型,例如,使用空调领域对应的交互语句对通用领域分类模型进行训练,得到空调领域对应的领域分类模型;使用冰箱领域对应的交互语句对通用领域分类模型进行训练,得到冰箱领域对应的领域分类模型。
在一个示例性的实施例中,上述步骤S204包括以下步骤S51-S53:
步骤S51:通过所述目标GPT模型,根据所述意图信息对所述原始交互语句进行语法纠错处理,得到一组第一类型候选交互语句;
需要说明的是,一组第一类型候选交互语句即目标GPT模型对原始交互语句进行弱泛化的结果。
需要说明的是,由于在进行语音识别的时候,往往会出现识别错误,比如用 户说的是“我要打开空调”,而在进行语音识别得到原始交互语句的时候,识别成了“我要打开控调”,进而智慧家庭领域的目标GPT模型可以对原始交互语句进行弱泛化处理,生成变换交互语句“我要打开空调”。
步骤S52:通过所述目标GPT模型,根据所述意图信息对所述原始交互语句进行语义扩展处理,得到一组第二类型候选交互语句;
需要说明的是,一组第二类型候选交互语句即目标GPT模型对原始交互语句进行强泛化的结果。例如,如果原始交互语句为“我出了一身汗”,则智慧家庭领域的目标GPT模型可以对原始交互语句进行强泛化处理,生成变换交互语句“我很热,打开空调”或者“我很热,打开风扇”或者“打开热水器”等等。
步骤S53:从所述一组第一类型的候选交互语句和所述一组第二类型候选交互语句中确定变换交互语句。
作为一种可选的示例,如果使用目标GPT模型对原始交互语句进行泛化处理以后,既存在一组第一类型的候选交互语句(即弱泛化语句),又存在一组第二类型的候选交互语句(即强泛化语句),则需要从一组第一类型的候选交互语句中确定置信度最高的一条交互语句确定为变换交互语句。
在一个示例性的实施例中,上述步骤S206还包括:在所述变换交互语句属于所述预设领域、且通过所述变换交互语句的标签信息确定所述变换交互语句为所述一组第一类型候选交互语句中的交互语句的情况下,执行所述变换交互语句对应的操作;在所述变换交互语句属于所述预设领域、且通过所述变换交互语句的标签信息确定所述变换交互语句为所述一组第二类型候选交互语句中的交互语句的情况下,进入询问流程。
需要说明的是,如果目标GPT模型生成的变换交互语句为第一类型变换交互语句(即弱泛化语句),则交互系统可以直接执行变换交互语句对应的操作;如果目标GPT模型生成的变换交互语句为第二类型变换交互语句(即强泛化语句),而第二类型变换交互语句又是对原始交互语句进行语义扩展处理得到的语句,则为了避免语义扩展错误,则需要进入模糊意图询问流程,向用户询问生成 的变换交互语句是否正确,进而再根据用户的回复语句进行相应的处理。
在本实施例中,采用上述技术方案,可以进一步的提高交互系统的交互效果。
显然,上述所描述的实施例仅仅是本公开一部分的实施例,而不是全部的实施例。为了更好的理解上述方法,以下结合实施例对上述过程进行说明,但不用于限定本公开实施例的技术方案,具体地:
在一个可选的实施例,在智能交互系统中,为准确理解用户意图,往往需要大量的先验知识,建立语言模型。在利用生成式预训练(Generative Pre-Training,GPT)模型作为系统的先验知识语言模型时,往往能获得更具有语料泛化特性的语言模型能力。但是通用GPT模型通常不具有特定领域的适用性。
因此,本公开通过基于通用GPT模型的智慧家庭领域标注数据的有监督学习,生成智慧家庭领域的特性化GPT模型,将该模型以领域逻辑分配的方式进行调用,应用于已有的智能家居交互系统中,从而提升系统对用户语言理解的泛化能力。本公开构建基于GPT泛化模型的智能交互系统及强化学习机制。通过通用GPT模型与微调数据耦合的方式,生成特性化GPT模型,并以领域分类器耦合的方式,与原交互引擎进行耦合。同时,还可以利用用户原始输入与领域分类器结果,以及特性化GPT泛化结果,作为自学习的训练数据,进行增强学习机制,在交互过程中,积累增强学习的数据,达到模型自学习的目的。
在一个示例性的实施例中,可以利用微软Azure Open AI提供的GPT3操场,通过In-context learning的模型自学习训练方式,微调出具有智慧家庭特色的homeGPT(即智慧家庭领域的目标GPT模型)。可选的,可以将已有泛化数据统一意图的query作为“prompt”和“completion”,生成特性化GPT,部署于Azure服务器。
需要说明的是,在特性化GPT(如homeGPT)生成和Azure服务器部署以后,可以使用特性化GPT模型,可选的,为了更好的理解如果使用特性化GPT模型,以下结合图7进行具体说明,如图7所示,先对用户输入的用户原始Query(查询请求,也即前文的原始交互语句)进行领域分类,如果领域分类结果为智慧家庭 领域,则直接将用户原始Query输入至对话引擎中,对话引擎直接对用户原始Query进行解析和交互;如分类结果为非智慧家庭领域,则通过智能家居GPT泛化生成泛化Query(也即前文的变换交互语句),并对该泛化Query再次进行领域分类;如果二次分类结果为智慧家庭领域,则将该泛化Query输入至对话引擎中,对话引擎对泛化Query进行解析和交互,如二次分类结果为非智慧家庭领域,则将用户原始Query输入至对话引擎中,对话引擎对用户原始Query进行解析和交互。
为了更好的理解,以下结合场景进行具体说明,如果智慧家庭用户Query:“我出了一身汗”(该Query为普通生活场景中用户对自身情况的描述),则交互系统通过homeGPT辨识出用户有想要打开热水器的可能,随后交互系统将该用户意图的可能转换为智能交互对话系统中的用户意图解析,并对根据产品设计,对用户进行询问,如回复“需要帮您打开热水器吗”,如果用户回复“是”,则下发设备控制指令,打开该用户家庭账号下绑定的热水器。
在一个示例性的实施例中,如图8所示,可以利用用户原始Query、泛化Query以及领域分类结果(领域分类结果包括原始Query的领域分类结果和泛化Query的领域分类结果)作为自学习的训练数据,进行增强学习机制,在交互过程中,积累增强学习的数据,达到模型自学习的目的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例的方法。
在本实施例中还提供了一种基于目标生成式预训练GPT模型的交互语句的处理装置,该装置被设置为实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的 组合。尽管以下实施例所描述的设备较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图9是根据本公开实施例的基于目标生成式预训练GPT模型的交互语句的处理装置的结构框图,该装置包括:
确定模块92,被设置为通过领域分类模型确定输入的原始交互语句的领域分类结果,并基于所述领域分类结果确定所述原始交互语句是否属于预设领域;
生成模块94,被设置为在确定所述原始交互语句不属于所述预设领域的情况下,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;
交互模块96,被设置为根据所述变换交互语句进行交互处理。
上述装置,在通过领域分类模型确定原始交互语句不属于预设领域的情况下,通过目标生成式预训练GPT模型解析原始交互语句在预设领域上的意图信息,并根据意图信息生成变换交互语句,进而根据变换交互语句进行交互处理,采用上述技术方案,使得交互系统可以挖掘用户的隐含意图,提高了交互系统对输入的交互语句的理解能力,进而交互系统可以准确地进行相应的响应,解决了交互系统直接根据交互语句进行交互处理,导致交互效果较差的问题。此外,由于交互系统可以挖掘用户的隐含意图,对交互语句的理解能力更强,使得交互系统可以根据用户意图实现更加自然贴心的交互方式、提高了交互系统的智能度;并且由于交互系统更加准确的识别了用户的隐含意图,使得交互系统可以主动地延续或者引导出新的话题,进而交互系统具备像人与人之间那样进行连续对话的能力,使得人机交互领域的交互体验有了质的飞跃。
在一个示例性的实施例中,交互模块96,还被设置为在基于所述领域分类结果确定所述原始交互语句属于所述预设领域的情况下,使用所述原始交互语句进行交互处理。
在一个示例性的实施例中,交互模块96,还被设置为在确定所述变换交互语句不属于所述预设领域的情况下,使用所述原始交互语句进行交互处理。
在一个示例性的实施例中,交互模块96,还被设置为在确定所述变换交互语句属于所述预设领域的情况下,使用所述变换交互语句进行交互处理。
在一个示例性的实施例中,生成模块94,还被设置为在所述预设领域包括具有层级关系的N层子领域,所述N层子领域中的每层子领域分别对应至少一个GPT模型,N为正整数的情况下,根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句,其中,在所述当前层是第一层的情况下,所述预设层输出的交互语句是所述原始交互语句;根据所述当前层输出的交互语句和所述当前层对应的层级,确定所述变换交互语句。
在一个示例性的实施例中,生成模块94,还被设置为在所述当前层输出的交互语句不属于所述当前层子领域、且所述当前层不是第一层的情况下,将所述预设层输出的交互语句确定为所述变换交互语句,其中,所述预设层输出的交互语句属于所述预设层子领域;在所述当前层输出的交互语句属于所述当前层子领域、且所述当前层不是第N层的情况下,将下一层获取为所述当前层,并继续执行所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句的操作,直至得到所述变换交互语句。
在一个示例性的实施例中,生成模块94,还被设置为在所述当前层输出的交互语句不属于所述当前层子领域、且所述当前层是第一层的情况下,将所述当前层输出的交互语句确定为所述变换交互语句;在所述当前层输出的交互语句属于所述当前层子领域、且所述当前层是第N层的情况下,将所述当前层输出的交互语句确定为所述变换交互语句。
在一个示例性的实施例中,确定模块92,还被设置为通过所述当前层对应的领域分类模型确定所述当前层输出的交互语句是否属于所述当前层子领域。
在一个示例性的实施例中,生成模块94,还被设置为在所述N层子领域包括N个子领域、且所述N个子领域中的第i个子领域为第i-1个子领域的子领域的情况下,通过所述第i个子领域对应的第i个GPT模型解析所述第i-1个交互语句或所述原始交互语句在所述第i个子领域上的意图信息,生成第i个交互语 句,其中,所述第i-1个交互语句根据第i-1个子领域对应的第i-1个GPT模型得到,所述当前层为第i层,所述预设层为第i-1层。
在一个示例性的实施例中,生成模块94,还被设置为在所述第i个交互语句属于所述第i个子领域的交互语句、所述第i个交互语句属于第i+k个子领域的交互语句、且所述第i个交互语句不属于第i+k+1个子领域的交互语句的情况下,将所述第i个交互语句获取为所述预设层输出的交互语句,将所述第i+k+1层获取为所述当前层,并继续执行所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句的操作,直至得到所述变换交互语句,其中,所述k为自然数,i+k<N。
在一个示例性的实施例中,生成模块94,还被设置为在所述N层子领域包括N组领域、所述N组领域中的第i组领域为第i-1组领域的子领域、同一组领域中的各个领域属于同一层级、且各组领域对应一组GPT模型的情况下,通过第i子组领域对应的第i子组GPT模型中的各个GPT模型解析第i-1个交互语句或所述原始交互语句在所述第i子组领域中对应的子领域上的意图信息,得到第i组交互语句,其中,所述第i-1个交互语句是第i-1子组GPT模型中的第i-1个当前GPT模型生成的交互语句,所述第i-1个当前GPT模型是第i-1组领域中的第i-1个当前领域对应的GPT模型,所述第i子组领域是所述第i-1个当前领域在第i组领域中的子领域;在所述第i组交互语句中选择第i个交互语句,其中,所述第i个交互语句是所述第i子组GPT模型中的第i个当前GPT模型生成的交互语句,所述第i个当前GPT模型是所述第i子组领域中的第i个当前领域对应的GPT模型,所述当前层为第i层,所述预设层为第i-1层。
在一个示例性的实施例中,生成模块94,还被设置为在所述第i个交互语句不属于所述第i个当前领域的交互语句的情况下,将所述第i-1个交互语句确定为所述变换交互语句;在所述第i个交互语句属于所述第i个当前领域的交互语句、且i小于N的情况下,将i的取值加1,并继续执行所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句的操作,直至得到所述变换交互语句;在所述第i个交互 语句属于所述第i个当前领域的交互语句、且i等于N的情况下,将所述第i个交互语句确定为所述变换交互语句。
在一个示例性的实施例中,生成模块94,还被设置为在所述第i组交互语句中选择置信度最高的交互语句,得到所述第i个交互语句,其中,所述第i组交互语句中的各个交互语句的置信度是所述第i子组GPT模型中对应的GPT模型根据解析到的所述第i-1个交互语句在所述第i子组领域中对应的领域上的意图信息生成的置信度。
在一个示例性的实施例中,确定模块92,还被设置为通过所述第i个当前领域对应的第i个当前领域分类模型确定所述第i个交互语句是否属于所述第i个当前领域。
在一个示例性的实施例中,上述装置还包括:部署模块,被设置为在通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息确定变换交互语句之前,获取所述N层子领域对应的M个GPT模型,其中,所述M为大于或等于N的正整数;将所述M个GPT模型分布式部署在对应的服务器中。
在一个示例性的实施例中,上述装置还包括:部署模块,被设置为通过以下方式获取所述N层子领域对应的M个GPT模型:通过以下方式之一获取所述M个GPT模型中的第j个GPT模型,其中,所述j为大于或等于1,小于或等于M的正整数:获取第一通用GPT模型,其中,所述第一通用GPT模型为使用第一预定数据训练得到的模型;使用第j个领域对应的第j组训练数据对所述第一通用GPT模型进行训练,得到所述第j个领域对应的第j个GPT模型;通过调用指定平台的指定接口将所述第j个领域对应的第j组训练数据发送至所述指定平台;获取所述指定平台使用所述第j组训练数据对第二通用GPT模型进行训练得到的所述第j个领域对应的第j个GPT模型,其中,所述第二通用GPT模型为所述指定平台使用第二预定数据训练得到的模型。
在一个示例性的实施例中,上述装置还包括:第一训练模块,被设置为在通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图 信息,并根据所述意图信息生成变换交互语句之前,通过以下步骤对通用GPT模型进行第i轮训练:将训练样本集合中的非预设领域的第i个样本交互语句输入到第i-1轮训练得到的通用GPT模型中,其中,所述第i个样本交互语句对应预设的第i个第一类型标注交互语句和第i个第二类型标注交互语句;通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行语法纠错处理,得到第i组第一类型候选交互语句,并在所述第i组第一类型候选交互语句中确定第i个第一类型候选交互语句;通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行语义扩展处理,得到第i组第二类型候选交互语句,并在所述第i组第二类型候选交互语句中确定第i个第二类型候选交互语句;根据所述第i个第一类型标注交互语句、所述第i个第一类型候选交互语句、所述第i个第二类型标注交互语句和所述第i个第二类型候选交互语句,确定第i轮训练的目标损失值;在所述第i轮训练的目标损失值不满足预设训练截止条件的情况下,对所述第i-1轮训练得到的通用GPT模型中的参数进行调整,确定出第i轮训练得到的通用GPT模型;在所述第i轮训练的目标损失值满足预设训练截止条件的情况下,结束训练。
在一个示例性的实施例中,第一训练模块,还被设置为通过以下方式通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行所述语法纠错处理,得到第i组第一类型候选交互语句:通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行所述语法纠错处理,得到所述第i组第一类型候选交互语句以及对应的第i组置信度;通过以下方式在所述第i组第一类型候选交互语句中确定第i个第一类型候选交互语句:在所述第i组第一类型候选交互语句中选择置信度最高的第一类型候选交互语句,得到所述第i个第一类型候选交互语句。
在一个示例性的实施例中,上述装置还包括:第二训练模块,被设置为在通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句之前:通过以下步骤对通用领域分类模型和通用GPT模型进行第i轮联合训练:将训练样本集合中的非预设领域的第i个样本交互语句输入到第i-1轮训练得到的通用GPT模型中,其中,所述第 i个样本交互语句对应预设的第i个第一类型标注交互语句、第i个第二类型标注交互语句、第i个实际领域;通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行所述语法纠错处理,得到第i组第一类型候选交互语句,并在所述第i组第一类型候选交互语句中确定第i个第一类型候选交互语句;通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行所述语义扩展处理,得到第i组第二类型候选交互语句,并在所述第i组第二类型候选交互语句中确定第i个第二类型候选交互语句;根据所述第i个第一类型标注交互语句、所述第i个第一类型候选交互语句、所述第i个第二类型标注交互语句和所述第i个第二类型候选交互语句,确定第i轮训练的第一目标损失值;将所述第i个样本交互语句输入到第i-1轮训练得到的通用领域分类模型中,并通过所述第i-1轮训练得到的通用领域分类模型对所述第i个样本交互语句进行领域分类处理,得到第i个预测领域;根据所述第i个预测领域和所述第i个实际领域,确定第i轮训练的第二目标损失值;根据所述第i轮训练的第一目标损失值和所述第i轮训练的第二目标损失值,确定第i轮训练的目标损失值;在所述第i轮训练的目标损失值不满足预设训练截止条件的情况下,对所述第i-1轮训练得到的通用GPT模型中的参数和所述第i-1轮训练得到的通用领域分类模型中的参数进行调整,确定出第i轮训练得到的通用GPT模型和第i轮训练得到的通用领域分类模型;在所述第i轮训练的目标损失值满足预设训练截止条件的情况下,结束训练。
在一个示例性的实施例中,生成模块94,还被设置为通过所述目标GPT模型,根据所述意图信息对所述原始交互语句进行语法纠错处理,得到一组第一类型候选交互语句;通过所述目标GPT模型,根据所述意图信息对所述原始交互语句进行语义扩展处理,得到一组第二类型候选交互语句;从所述一组第一类型的候选交互语句和所述一组第二类型候选交互语句中确定变换交互语句。
在一个示例性的实施例中,交互模块96,还被设置为在所述变换交互语句属于所述预设领域、且通过所述变换交互语句的标签信息确定所述变换交互语句为所述一组第一类型候选交互语句中的交互语句的情况下,执行所述变换交互语句对应的操作;在所述变换交互语句属于所述预设领域、且通过所述变换交互语句 的标签信息确定所述变换交互语句为所述一组第二类型候选交互语句中的交互语句的情况下,进入询问流程。
图10是根据本公开实施例的基于目标生成式预训练GPT模型的交互语句的处理系统的结构框图,该系统包括:
领域分类模型102,被设置为对输入的原始交互语句进行领域分类,确定所述原始交互语句是否属于预设领域;
目标生成式预训练GPT模型104,被设置为在所述原始交互语句不属于所述预设领域的情况下,解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;
对话引擎106,被设置为根据所述变换交互语句进行交互处理。
上述系统,在通过领域分类模型确定原始交互语句不属于预设领域的情况下,通过目标生成式预训练GPT模型解析原始交互语句在预设领域上的意图信息,并根据意图信息生成变换交互语句,进而根据变换交互语句进行交互处理,采用上述技术方案,使得交互系统可以挖掘用户的隐含意图,提高了交互系统对输入的交互语句的理解能力,进而交互系统可以准确地进行相应的响应,解决了交互系统直接根据交互语句进行交互处理,导致交互效果较差的问题。此外,由于交互系统可以挖掘用户的隐含意图,对交互语句的理解能力更强,使得交互系统可以根据用户意图实现更加自然贴心的交互方式、提高了交互系统的智能度;并且由于交互系统更加准确的识别了用户的隐含意图,使得交互系统可以主动地延续或者引导出新的话题,进而交互系统具备像人与人之间那样进行连续对话的能力,使得人机交互领域的交互体验有了质的飞跃。
本公开的实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述存储介质可以被设置为存储被设置为执行以下步骤的计算机程序:
S1,通过领域分类模型确定输入的原始交互语句的领域分类结果,并基于所述领域分类结果确定所述原始交互语句是否属于预设领域;
S2,在确定所述原始交互语句不属于所述预设领域的情况下,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;
S3,根据所述变换交互语句进行交互处理。
在一个示例性实施例中,上述计算机可读存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。
本公开的实施例还提供了一种电子装置,如图11所示,该电子装置包括存储器1102和处理器1104,该存储器1102中存储有计算机程序,该处理器1104被设置为通过计算机程序执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述电子装置可以位于计算机网络的多个网络设备中的至少一个网络设备。
可选地,在本实施例中,上述处理器1104可以被设置为通过计算机程序执行以下步骤:
S1,通过领域分类模型确定输入的原始交互语句的领域分类结果,并基于所述领域分类结果确定所述原始交互语句是否属于预设领域;
S2,在确定所述原始交互语句不属于所述预设领域的情况下,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;
S3,根据所述变换交互语句进行交互处理。
可选地,本领域普通技术人员可以理解,图11所示的结构仅为示意,电子装置也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Intemet Devices,MID)、PAD等终端设备。图11其并不对上述电子装置的结构造成限定。例如,电子装置还可包括比图11中所示更多或者更少的组件(如网络接口等),或者具有与图11所示不同的配置。
其中,存储器1102可用于存储软件程序以及模块,如本发明实施例中的基于目标生成式预训练GPT模型的交互语句的处理方法和装置对应的程序指令/模块,处理器1104通过运行存储在存储器1102内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的基于目标生成式预训练GPT模型的交互语句的处理方法。存储器1102可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器1102可进一步包括相对于处理器1104远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。作为一种示例,如图11所示,上述存储器1102中可以但不限于包括上述基于目标生成式预训练GPT模型的交互语句的处理装置中的确定模块92、生成模块94和交互模块96。此外,还可以包括但不限于上述语义转换装置中的其他模块单元,本示例中不再赘述。
可选地,上述的传输装置1106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输装置1106包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置1106为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
此外,上述电子装置还包括:显示器1108和连接总线1110,用于连接上述电子装置中的各个模块部件。
在一个示例性实施例中,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
本实施例中的具体示例可以参考上述实施例及示例性实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅是本公开的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本公开原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本公开的保护范围。

Claims (25)

  1. 一种基于目标生成式预训练GPT模型的交互语句的处理方法,包括:
    通过领域分类模型确定输入的原始交互语句的领域分类结果,并基于所述领域分类结果确定所述原始交互语句是否属于预设领域;
    在确定所述原始交互语句不属于所述预设领域的情况下,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;
    根据所述变换交互语句进行交互处理。
  2. 根据权利要求1所述的方法,其中,所述方法还包括:
    在基于所述领域分类结果确定所述原始交互语句属于所述预设领域的情况下,使用所述原始交互语句进行交互处理。
  3. 根据权利要求1所述的方法,其中,所述根据所述变换交互语句进行交互处理,包括:
    在确定所述变换交互语句不属于所述预设领域的情况下,使用所述原始交互语句进行交互处理。
  4. 根据权利要求1所述的方法,其中,所述根据所述变换交互语句进行交互处理,包括:
    在确定所述变换交互语句属于所述预设领域的情况下,使用所述变换交互语句进行交互处理。
  5. 根据权利要求1-4任一项所述的方法,其中,所述预设领域包括具有层级关系的N层子领域,所述N层子领域中的每层子领域分别对应至少一个GPT模型,N为正整数,所述通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息确定变换交互语句,包括:
    根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始 交互语句进行处理,得到当前层输出的交互语句,其中,在所述当前层是第一层的情况下,所述预设层输出的交互语句是所述原始交互语句;
    根据所述当前层输出的交互语句和所述当前层对应的层级,确定所述变换交互语句。
  6. 根据权利要求5所述的方法,其中,所述根据所述当前层输出的交互语句和所述当前层对应的层级,确定所述变换交互语句,包括:
    在所述当前层输出的交互语句不属于所述当前层子领域、且所述当前层不是第一层的情况下,将所述预设层输出的交互语句确定为所述变换交互语句,其中,所述预设层输出的交互语句属于所述预设层子领域;
    在所述当前层输出的交互语句属于所述当前层子领域、且所述当前层不是第N层的情况下,将下一层获取为所述当前层,并继续执行所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句的操作,直至得到所述变换交互语句。
  7. 根据权利要求5所述的方法,其中,所述根据所述当前层输出的交互语句和所述当前层对应的层级,确定所述变换交互语句,包括:
    在所述当前层输出的交互语句不属于所述当前层子领域、且所述当前层是第一层的情况下,将所述当前层输出的交互语句确定为所述变换交互语句;
    在所述当前层输出的交互语句属于所述当前层子领域、且所述当前层是第N层的情况下,将所述当前层输出的交互语句确定为所述变换交互语句。
  8. 根据权利要求6或7所述的方法,其中,所述方法还包括:
    通过所述当前层对应的领域分类模型确定所述当前层输出的交互语句是否属于所述当前层子领域。
  9. 根据权利要求5所述的方法,其中,所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句,包括:
    在所述N层子领域包括N个子领域、且所述N个子领域中的第i个子领域为第i-1个子领域的子领域的情况下,通过所述第i个子领域对应的第i个GPT模型解析所述第i-1个交互语句或所述原始交互语句在所述第i个子领域上的意图信息,生成第i个交互语句,其中,所述第i-1个交互语句根据第i-1个子领域对应的第i-1个GPT模型得到,所述当前层为第i层,所述预设层为第i-1层。
  10. 根据权利要求9所述的方法,其中,所述根据所述当前层输出的交互语句和所述当前层对应的层级,确定所述变换交互语句,包括:
    在所述第i个交互语句属于所述第i个子领域的交互语句、所述第i个交互语句属于第i+k个子领域的交互语句、且所述第i个交互语句不属于第i+k+1个子领域的交互语句的情况下,将所述第i个交互语句获取为所述预设层输出的交互语句,将所述第i+k+1层获取为所述当前层,并继续执行所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句的操作,直至得到所述变换交互语句,其中,所述k为自然数,i+k<N。
  11. 根据权利要求5所述的方法,其中,所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句,包括:
    在所述N层子领域包括N组领域、所述N组领域中的第i组领域为第i-1组领域的子领域、同一组领域中的各个领域属于同一层级、且各组领域对应一组GPT模型的情况下,通过第i子组领域对应的第i子组GPT模型中的各个GPT模型解析第i-1个交互语句或所述原始交互语句在所述第i子组领域中对应的子领域上的意图信息,得到第i组交互语句,其中,所述第i-1个交互语句是第i-1子组GPT模型中的第i-1个当前GPT模型生成的交互语句,所述第i-1个当前GPT模型是第i-1组领域中的第i-1个当前领域对应的GPT模型,所述第i子组领域是所述第i-1个当前领域在第i组领域中的子领域;
    在所述第i组交互语句中选择第i个交互语句,其中,所述第i个交互语 句是所述第i子组GPT模型中的第i个当前GPT模型生成的交互语句,所述第i个当前GPT模型是所述第i子组领域中的第i个当前领域对应的GPT模型,所述当前层为第i层,所述预设层为第i-1层。
  12. 根据权利要求11所述的方法,其中,所述根据所述当前层输出的交互语句和所述当前层对应的层级,确定所述变换交互语句,包括:
    在所述第i个交互语句不属于所述第i个当前领域的交互语句、且i等于1的情况下,将所述第i个交互语句确定为所述变换交互语句;
    在所述第i个交互语句不属于所述第i个当前领域的交互语句、且i不等于1的情况下,将所述第i-1个交互语句确定为所述变换交互语句;
    在所述第i个交互语句属于所述第i个当前领域的交互语句、且i小于N的情况下,将i的取值加1,并继续执行所述根据当前层子领域对应的GPT模型对预设层输出的交互语句或所述原始交互语句进行处理,得到当前层输出的交互语句的操作,直至得到所述变换交互语句;
    在所述第i个交互语句属于所述第i个当前领域的交互语句、且i等于N的情况下,将所述第i个交互语句确定为所述变换交互语句。
  13. 根据权利要求11所述的方法,其中,在所述第i组交互语句中选择第i个交互语句,包括:
    在所述第i组交互语句中选择置信度最高的交互语句,得到所述第i个交互语句,其中,所述第i组交互语句中的各个交互语句的置信度是所述第i子组GPT模型中对应的GPT模型根据解析到的所述第i-1个交互语句在所述第i子组领域中对应的领域上的意图信息生成的置信度。
  14. 根据权利要求12所述的方法,其中,所述方法还包括:
    通过所述第i个当前领域对应的第i个当前领域分类模型确定所述第i个交互语句是否属于所述第i个当前领域。
  15. 根据权利要求5所述的方法,其中,所述通过目标生成式预训练GPT模型解 析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息确定变换交互语句之前,所述方法还包括:
    获取所述N层子领域对应的M个GPT模型,其中,所述M为大于或等于N的正整数;
    将所述M个GPT模型分布式部署在对应的服务器中。
  16. 根据权利要求15所述的方法,其中,获取所述N层子领域对应的M个GPT模型,包括:
    通过以下方式之一获取所述M个GPT模型中的第j个GPT模型,其中,所述j为大于或等于1,小于或等于M的正整数:
    获取第一通用GPT模型,其中,所述第一通用GPT模型为使用第一预定数据训练得到的模型;使用第j个领域对应的第j组训练数据对所述第一通用GPT模型进行训练,得到所述第j个领域对应的第j个GPT模型;
    通过调用指定平台的指定接口将所述第j个领域对应的第j组训练数据发送至所述指定平台;获取所述指定平台使用所述第j组训练数据对第二通用GPT模型进行训练得到的所述第j个领域对应的第j个GPT模型,其中,所述第二通用GPT模型为所述指定平台使用第二预定数据训练得到的模型。
  17. 根据权利要求1所述的方法,其中,在通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句之前,所述方法还包括:
    通过以下步骤对通用GPT模型进行第i轮训练:
    将训练样本集合中的非预设领域的第i个样本交互语句输入到第i-1轮训练得到的通用GPT模型中,其中,所述第i个样本交互语句对应预设的第i个第一类型标注交互语句和第i个第二类型标注交互语句;
    通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行语法纠错处理,得到第i组第一类型候选交互语句,并在所述第i组第一类 型候选交互语句中确定第i个第一类型候选交互语句;
    通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行语义扩展处理,得到第i组第二类型候选交互语句,并在所述第i组第二类型候选交互语句中确定第i个第二类型候选交互语句;
    根据所述第i个第一类型标注交互语句、所述第i个第一类型候选交互语句、所述第i个第二类型标注交互语句和所述第i个第二类型候选交互语句,
    确定第i轮训练的目标损失值;
    在所述第i轮训练的目标损失值不满足预设训练截止条件的情况下,对所述第i-1轮训练得到的通用GPT模型中的参数进行调整,确定出第i轮训练得到的通用GPT模型;
    在所述第i轮训练的目标损失值满足预设训练截止条件的情况下,结束训练。
  18. 根据权利要求17所述的方法,其中,
    所述通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行所述语法纠错处理,得到第i组第一类型候选交互语句,包括:通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行所述语法纠错处理,得到所述第i组第一类型候选交互语句以及对应的第i组置信度;
    在所述第i组第一类型候选交互语句中确定第i个第一类型候选交互语句,包括:在所述第i组第一类型候选交互语句中选择置信度最高的第一类型候选交互语句,得到所述第i个第一类型候选交互语句。
  19. 根据权利要求1所述的方法,其中,在通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句之前,所述方法还包括:
    通过以下步骤对通用领域分类模型和通用GPT模型进行第i轮联合训练:将训练样本集合中的非预设领域的第i个样本交互语句输入到第i-1轮训 练得到的通用GPT模型中,其中,所述第i个样本交互语句对应预设的第i个第一类型标注交互语句、第i个第二类型标注交互语句、第i个实际领域;
    通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行语法纠错处理,得到第i组第一类型候选交互语句,并在所述第i组第一类型候选交互语句中确定第i个第一类型候选交互语句;
    通过所述第i-1轮训练得到的通用GPT模型对所述第i个样本交互语句进行语义扩展处理,得到第i组第二类型候选交互语句,并在所述第i组第二类型候选交互语句中确定第i个第二类型候选交互语句;
    根据所述第i个第一类型标注交互语句、所述第i个第一类型候选交互语句、所述第i个第二类型标注交互语句和所述第i个第二类型候选交互语句,确定第i轮训练的第一目标损失值;
    将所述第i个样本交互语句输入到第i-1轮训练得到的通用领域分类模型中,并通过所述第i-1轮训练得到的通用领域分类模型对所述第i个样本交互语句进行领域分类处理,得到第i个预测领域;
    根据所述第i个预测领域和所述第i个实际领域,确定第i轮训练的第二目标损失值;
    根据所述第i轮训练的第一目标损失值和所述第i轮训练的第二目标损失值,确定第i轮训练的目标损失值;
    在所述第i轮训练的目标损失值不满足预设训练截止条件的情况下,对所述第i-1轮训练得到的通用GPT模型中的参数和所述第i-1轮训练得到的通用领域分类模型中的参数进行调整,确定出第i轮训练得到的通用GPT模型和第i轮训练得到的通用领域分类模型;
    在所述第i轮训练的目标损失值满足预设训练截止条件的情况下,结束训练。
  20. 根据权利要求1所述的方法,其中,通过目标生成式预训练GPT模型解析所 述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句,包括:
    通过所述目标生成式预训练GPT模型,根据所述意图信息对所述原始交互语句进行语法纠错处理,得到一组第一类型候选交互语句;
    通过所述目标生成式预训练GPT模型,根据所述意图信息对所述原始交互语句进行语义扩展处理,得到一组第二类型候选交互语句;
    从所述一组第一类型的候选交互语句和所述一组第二类型候选交互语句中确定变换交互语句。
  21. 根据权利要求20所述的方法,其中,根据所述变换交互语句进行交互处理,包括:
    在所述变换交互语句属于所述预设领域、且通过所述变换交互语句的标签信息确定所述变换交互语句为所述一组第一类型候选交互语句中的交互语句的情况下,执行所述变换交互语句对应的操作;
    在所述变换交互语句属于所述预设领域、且通过所述变换交互语句的标签信息确定所述变换交互语句为所述一组第二类型候选交互语句中的交互语句的情况下,进入询问流程。
  22. 一种基于目标生成式预训练GPT模型的交互语句的处理装置,包括:
    确定模块,被设置为通过领域分类模型确定输入的原始交互语句的领域分类结果,并基于所述领域分类结果确定所述原始交互语句是否属于预设领域;
    生成模块,被设置为在确定所述原始交互语句不属于所述预设领域的情况下,通过目标生成式预训练GPT模型解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;
    交互模块,被设置为根据所述变换交互语句进行交互处理。
  23. 一种基于目标生成式预训练GPT模型的交互语句的处理系统,包括:
    领域分类模型,被设置为对输入的原始交互语句进行领域分类,确定所述原始交互语句是否属于预设领域;
    目标生成式预训练GPT模型,被设置为在所述原始交互语句不属于所述预设领域的情况下,解析所述原始交互语句在所述预设领域上的意图信息,并根据所述意图信息生成变换交互语句;
    对话引擎,被设置为根据所述变换交互语句进行交互处理。
  24. 一种计算机可读的存储介质,所述计算机可读的存储介质包括存储的程序,其中,所述程序运行时执行权利要求1至21中任一项所述的方法。
  25. 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行权利要求1至21中任一项所述的方法。
PCT/CN2024/088406 2023-04-20 2024-04-17 基于目标生成式预训练gpt模型的交互语句的处理方法 Ceased WO2024217469A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310428886.9 2023-04-20
CN202310428886.9A CN116756277B (zh) 2023-04-20 2023-04-20 基于目标生成式预训练gpt模型的交互语句的处理方法

Publications (1)

Publication Number Publication Date
WO2024217469A1 true WO2024217469A1 (zh) 2024-10-24

Family

ID=87946668

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/088406 Ceased WO2024217469A1 (zh) 2023-04-20 2024-04-17 基于目标生成式预训练gpt模型的交互语句的处理方法

Country Status (2)

Country Link
CN (1) CN116756277B (zh)
WO (1) WO2024217469A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116756277B (zh) * 2023-04-20 2023-11-24 海尔优家智能科技(北京)有限公司 基于目标生成式预训练gpt模型的交互语句的处理方法
CN117807215B (zh) * 2024-03-01 2024-05-24 青岛海尔科技有限公司 一种基于模型的语句多意图识别方法、装置及设备

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109063152A (zh) * 2018-08-08 2018-12-21 鲸数科技(北京)有限公司 智能问答方法、装置及智能终端
CN109492079A (zh) * 2018-10-09 2019-03-19 北京奔影网络科技有限公司 意图识别方法及装置
CN112100368A (zh) * 2020-07-21 2020-12-18 深思考人工智能科技(上海)有限公司 对话交互意图的识别方法和装置
CN112597310A (zh) * 2020-12-25 2021-04-02 深圳市声希科技有限公司 领域和意图分层联合分类方法、装置、设备及存储介质
CN115203393A (zh) * 2022-07-21 2022-10-18 中国平安人寿保险股份有限公司 一种对话应答方法及其系统、电子设备、存储介质
US20230084583A1 (en) * 2020-05-20 2023-03-16 Huawei Technologies Co., Ltd. Response method in human-computer dialogue, dialogue system, and storage medium
CN116756277A (zh) * 2023-04-20 2023-09-15 海尔优家智能科技(北京)有限公司 基于目标生成式预训练gpt模型的交互语句的处理方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427722A (zh) * 2018-02-09 2018-08-21 卫盈联信息技术(深圳)有限公司 智能交互方法、电子装置及存储介质
CN110457689B (zh) * 2019-07-26 2023-08-01 科大讯飞(苏州)科技有限公司 语义处理方法及相关装置
CN115620710A (zh) * 2021-06-30 2023-01-17 青岛海尔科技有限公司 语音识别的方法、装置、存储介质以及电子装置
CN113836944B (zh) * 2021-08-31 2025-07-01 青岛海尔科技有限公司 用于智能设备的控制方法、系统及其装置、电子设备
CN114757176B (zh) * 2022-05-24 2023-05-02 上海弘玑信息技术有限公司 一种获取目标意图识别模型的方法以及意图识别方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109063152A (zh) * 2018-08-08 2018-12-21 鲸数科技(北京)有限公司 智能问答方法、装置及智能终端
CN109492079A (zh) * 2018-10-09 2019-03-19 北京奔影网络科技有限公司 意图识别方法及装置
US20230084583A1 (en) * 2020-05-20 2023-03-16 Huawei Technologies Co., Ltd. Response method in human-computer dialogue, dialogue system, and storage medium
CN112100368A (zh) * 2020-07-21 2020-12-18 深思考人工智能科技(上海)有限公司 对话交互意图的识别方法和装置
CN112597310A (zh) * 2020-12-25 2021-04-02 深圳市声希科技有限公司 领域和意图分层联合分类方法、装置、设备及存储介质
CN115203393A (zh) * 2022-07-21 2022-10-18 中国平安人寿保险股份有限公司 一种对话应答方法及其系统、电子设备、存储介质
CN116756277A (zh) * 2023-04-20 2023-09-15 海尔优家智能科技(北京)有限公司 基于目标生成式预训练gpt模型的交互语句的处理方法

Also Published As

Publication number Publication date
CN116756277B (zh) 2023-11-24
CN116756277A (zh) 2023-09-15

Similar Documents

Publication Publication Date Title
WO2024217469A1 (zh) 基于目标生成式预训练gpt模型的交互语句的处理方法
KR102373905B1 (ko) 어시스턴트 애플리케이션을 위한 음성 사용자 인터페이스 단축
US11721343B2 (en) Hub device, multi-device system including the hub device and plurality of devices, and method of operating the same
WO2022015783A1 (en) Selecting a response in a multi-turn interaction between a user and a conversational bot
US11949635B2 (en) Proactive and reactive directing of conversational bot-human interactions
WO2024230736A1 (zh) 基于生成式预训练gpt模型的交互意图信息确定方法
US20230298568A1 (en) Authoring content for a conversational bot
CN117742792B (zh) 基于大模型的指令执行设备选取方法、装置、设备和介质
CN117056473B (zh) 一种设备控制方法、装置、设备及介质
JP2020087352A (ja) 対話制御方法、対話制御プログラム、対話制御装置、情報提示方法および情報提示装置
CN112992140B (zh) 智能设备的控制方法、装置、设备及存储介质
CN110096516B (zh) 自定义的数据库交互的对话生成方法及系统
CN118051625A (zh) 一种用于优化场景生成模型的方法及装置、存储介质、电子装置
CN115497468B (zh) 语音控制方法、装置、计算机设备及计算机可读存储介质
CN114694644B (zh) 语音意图识别方法、装置及电子设备
CN117116261A (zh) 一种智能家居语义解析方法及相关设备
WO2025015869A1 (zh) 一种设备控制方法、装置、系统、设备及介质
US20250335715A1 (en) Chatbot System For Structured And Unstructured Data
CN114301725B (zh) 设备控制方法、装置、电子设备及存储介质
US11442692B1 (en) Acoustic workflow system distribution
CN117706954A (zh) 一种用于场景生成的方法及装置、存储介质、电子装置
CN117807215B (zh) 一种基于模型的语句多意图识别方法、装置及设备
CN117708680B (zh) 一种用于提升分类模型准确度的方法及装置、存储介质、电子装置
US12141529B1 (en) Relevant object embedding in aggregated answers to questions regarding broad set of objects
CN121525827A (zh) 基于大模型专家群的问答方法、系统、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24792054

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 24792054

Country of ref document: EP

Kind code of ref document: A1