Artificial intelligence-based intent recognition method and device, computer device, and medium

By combining the sliding window mechanism with a multilingual model, the problem of inaccurate text intent recognition in agent services in the financial field is solved, achieving higher intent recognition accuracy.

CN116383389BActive Publication Date: 2025-10-24PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310597131.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-24
Publication Date
2025-10-24
Estimated Expiration
2043-05-24

AI Technical Summary

Technical Problem

In agent services in the financial field, existing technologies only perform text intent recognition based on the current sentence, resulting in inaccurate intent recognition.

Method used

A sliding window mechanism is used to segment the text, and the trained first language model is used to identify the probability distribution of candidate intents of the sentence. The probability distribution is converted into a vector and input into the trained second language model for correction. Multiple recognitions are performed in combination with the context to improve the accuracy of intent recognition.

Benefits of technology

The accuracy of text intent recognition in agent services in the financial field is improved through multiple recognition and context combination methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116383389B_ABST
    Figure CN116383389B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of artificial intelligence, and provides an intention recognition method and device based on artificial intelligence, computer equipment and readable storage medium, the method comprises the following steps: obtaining a first text, and splitting the first text based on a sliding window mechanism to obtain a first preset value of windows; performing intention recognition on the sentences contained in each window based on a trained first language model to obtain the candidate intention probability distribution of each sentence; converting the candidate intention probability distribution of the sentence into a vector according to the window to which the sentence belongs to obtain the text vector of the sentence contained in each window; inputting the text vector into a trained second language model in sequence to obtain the corrected intention probability distribution of each sentence; and obtaining the target intention recognition result of the first text based on the corrected intention probability distribution. The application can improve the accuracy of text intention recognition of the seat service in the financial field.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to an intention recognition method and device based on artificial intelligence, a computer device and a readable storage medium. BACKGROUND

[0002] Text classification is an important field of natural language processing, and in the financial field, such as insurance-related dialogue text classification, is an important field of application of text classification technology in the industry.

[0003] In the financial field, the agent service is an important way for the call center system to provide services for customers, such as communicating insurance matters through the agent service. The agent service refers to the process in which the agent personnel provides corresponding insurance services for customers through the support system of the call center.

[0004] In the scenario of continuous multi-round dialogue of the agent service, the intention recognition of a single sentence depends more on the context and even the literal content of the current sentence itself. In the current text processing process of the agent service, the intention of the text is often judged only according to the current sentence, resulting in inaccurate intention recognition of the text of the agent service in the financial field, i.e., inaccurate text classification related to finance. SUMMARY

[0005] The main purpose of the present application is to provide an intention recognition method and device based on artificial intelligence, a computer device and a readable storage medium, aiming to improve the accuracy of text intention recognition of the agent service in the financial field.

[0006] In a first aspect, the present application provides an intention recognition method based on artificial intelligence, which comprises:

[0007] Obtaining a first text and dividing the first text based on a sliding window mechanism to obtain a first preset number of windows;

[0008] Performing intention recognition on the sentences contained in each window based on a trained first language model to obtain the candidate intention probability distribution of each sentence;

[0009] Converting the candidate intention probability distribution of the sentence into a vector according to the window to which the sentence belongs to obtain the text vector of the sentence contained in each window;

[0010] Inputting the text vector into a trained second language model in order to obtain the corrected intention probability distribution of each sentence;

[0011] Based on the corrected intention probability distribution, obtaining the target intention recognition result of the first text.

[0012] In a second aspect, the present application also provides an intention recognition device based on artificial intelligence, the device comprising:

[0013] a first obtaining module, configured to obtain a first text, and split the first text based on a sliding window mechanism to obtain a first preset number of windows;

[0014] a recognition module, configured to perform intention recognition on a statement contained in each of the windows based on a trained first language model to obtain a candidate intention probability distribution of each of the statements;

[0015] a conversion module, configured to convert the candidate intention probability distribution of the statement into a vector according to the window to which the statement belongs to obtain a text vector of the statement contained in each window;

[0016] an input module, configured to input the text vector into a trained second language model in sequence to obtain a revised intention probability distribution of each of the statements;

[0017] a second obtaining module, configured to obtain a target intention recognition result of the first text based on the revised intention probability distribution.

[0018] In a third aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the intention recognition method based on artificial intelligence are implemented.

[0019] In a fourth aspect, the present application also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, the intention recognition method based on artificial intelligence is implemented.

[0020] The present application discloses an intention recognition method, apparatus, computer device and readable storage medium based on artificial intelligence. The intention recognition method based on artificial intelligence obtains a first text related to the financial field, such as a first text related to insurance, and divides the first text based on a sliding window mechanism to obtain a first preset value of windows; performs intention recognition on the sentences contained in each window based on a trained first language model to obtain a candidate intention probability distribution of each sentence; converts the candidate intention probability distribution of the sentence into a vector according to the window to which the sentence belongs, and obtains a text vector of the sentence contained in each window; inputs the text vector into a trained second language model in sequence to obtain a revised intention probability distribution of each sentence; and obtains a target intention recognition result of the first text based on the revised intention probability distribution. In this way, after performing intention recognition based on each sentence in the first text, further intention recognition is performed on multiple sentences contained in the window based on the context of the sentence, thereby obtaining the intention recognition result of the first text. Due to multiple recognitions and the combination of individual sentence recognition and context-based sentence recognition, the accuracy of intention recognition of insurance-related seat service questions in the financial field is improved based on artificial intelligence.

[0021] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0023] Figure 1 This is a flowchart of an embodiment of an intention recognition method based on artificial intelligence of the present application;

[0024] Figure 2 This is a schematic diagram of a scenario involved in an embodiment of the artificial intelligence-based intention recognition method of the present application;

[0025] Figure 3 A schematic block diagram of an artificial intelligence-based intention recognition device provided in one embodiment of the present application;

[0026] Figure 4 This is a schematic block diagram of the structure of a computer device involved in one embodiment of the present application.

[0027] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0028] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the scope of protection of the present application.

[0029] The flowcharts shown in the drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor are they necessarily executed in the described order. For example, some operations / steps can be further decomposed, combined or partially merged, so that the actual execution order can be changed according to the actual situation.

[0030] It should be understood that the terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and the appended claims of the present application, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0031] It should also be understood that the term "and / or" used in the specification and the appended claims of the present application means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0032] The embodiments of the present application provide an artificial intelligence-based intent recognition method, device, computer equipment and readable storage medium. The artificial intelligence-based intent recognition method is mainly applied to an artificial intelligence-based intent recognition device, which can be a server or other terminal equipment with data processing function.

[0033] The server can be a stand-alone server, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CoNteNt Delivery Network, CDN), and basic cloud computing services such as big data and data analysis platforms.

[0034] The embodiments of the present application can acquire and classify text based on artificial intelligence technology. Artificial intelligence (Artificial Intelligence, AI) is the use of digital computers or digital computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0035] The basic technologies of artificial intelligence generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation / interaction systems, mechatronics, etc. The software technologies of artificial intelligence mainly include computer vision technologies, robot technologies, biometric identification technologies, speech processing technologies, natural language processing technologies, and machine learning / deep learning, etc.

[0036] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The following examples and features in the examples can be combined with each other without conflict.

[0037] The present application provides an artificial intelligence-based intent recognition method, device, computer equipment and readable storage medium, which aims to improve the accuracy of insurance-related text intent recognition in the financial field.

[0038] Please refer to Figure 1 , Figure 1 A flowchart of an artificial intelligence-based intent recognition method provided by an embodiment of the present application.

[0039] As Figure 1 shown, the intent recognition method includes steps S101 to S105.

[0040] Step S101, obtain a first text, and split the first text based on a sliding window mechanism to obtain a first preset number of windows.

[0041] In this embodiment, the first text is the text that needs to be recognized, and the first text can be the dialogue text between the customer service personnel and the user in the customer service process. For example, the customer service is an important way for the call center system in the financial field to provide services for customers, and the customer service personnel communicates with the user about insurance matters through the call center system. Customer service refers to the process of customer service personnel providing corresponding insurance services for customers through the support system of the call center. At this time, the first text is the call record or description of the insurance between the customer service personnel and the customer, such as the customer's question, "What are the precautions for this insurance?", "What is the monthly premium?", etc. After obtaining the first text, the first text is first split based on the sliding window mechanism, that is, the first text is divided into a sliding window, thereby being divided into shorter texts. Specifically, the size and step length of the sliding window can be set according to the user's demand or the length of the first text.

[0042] In some embodiments, step S101 specifically includes:

[0043] cut the sentences of the first text based on a sliding window with a third preset size and a fourth preset step, to obtain a first preset number of windows, wherein the first preset number is obtained based on the third preset size, the fourth preset step, and a number of sentences contained in the first text, and each window contains a third preset number of sentences.

[0044] Specifically, for example, a complete conversation is cut based on a sliding window with a size of 5 and a step of 1, that is, the first text is cut, and it is assumed that a first text contains 10 sentences, so that 10-5+1, that is, 6 sliding windows are obtained, that is, windows, and each window contains 5 sentences. It can be seen that the number of windows is related to the parameters of the sliding window, that is, the size and step of the sliding window, and the length of the text. The number of sentences contained in each window is related to the size of the sliding window.

[0045] In some embodiments, before step S101, the method can further include:

[0046] perform vertical domain pre-training on the pre-training model based on Chinese based on a training set in a specific scenario, to obtain a trained first language model, wherein the training set includes single-sentence text and labels in the specific scenario.

[0047] The pre-training model can be a BERT model (Bidirectional Encoder Representations from Transformer), which is a bidirectional encoder representation based on Transformer and is a pre-trained language representation model.

[0048] Specifically, the corresponding training set can be collected based on a specific use scenario, and the training set includes single-sentence text and labels. For example, in the agent-customer scenario, the agent responds with “hmm”, and the corresponding label can include confirmatory expressions and simple agreement. The pre-training model based on Chinese is pre-trained in the vertical domain to obtain a trained pre-training model, that is, a first language model.

[0049] In some embodiments, after the step of performing vertical domain pre-training on the pre-training model based on Chinese based on a training set in a specific scenario to obtain a trained first language model, the method can further include:

[0050] perform intent recognition on the single sentences in the training set in the specific scenario based on the trained first language model, to obtain a probability distribution of each candidate intent to which each single sentence belongs;

[0051] convert the probability distribution of each candidate intent to which each single sentence belongs into a vector, and use the vector as a text vector representation of each sentence;

[0052] use a sliding window with a third preset size to input the text vectors of the adjacent N sentences into the pre-trained second language model to obtain the intent recognition result of each unit of the pre-trained second language model;

[0053] According to the intent label corresponding to each sentence in the training set and the intent recognition result, the loss of the adjacent N sentences is calculated, and the pre-trained second language model is trained based on the loss to obtain a trained second language model.

[0054] After obtaining the trained first language model, the pre-trained second language model can be further trained based on the trained first language model. Specifically, first, input a single sentence in the training set into the trained first language model, perform intent recognition on the single sentence in the training set based on the trained first language model to obtain a probability distribution of the single sentence belonging to each candidate intent, convert the probability distribution of each sentence into a vector, and use the vector as a text vector representation of each sentence. Use a sliding window with a third preset size to input the text vectors of the adjacent sentences into the pre-trained second language model to obtain the intent recognition result of each unit of the pre-trained second language model. Compare the intent label corresponding to each sentence in the training set with the intent recognition result, calculate the loss of the adjacent N sentences, and train the pre-trained second language model based on the loss to obtain a trained second language model.

[0055] Step S102, based on the trained first language model, perform intent recognition on the sentences contained in each of the windows to obtain a candidate intent probability distribution of each of the sentences.

[0056] Specifically, input the sentences contained in each window into the trained first language model separately, obtain the probability that the output sentence belongs to each category from the trained first language model, and thereby obtain the probability distribution of each sentence, i.e., the candidate intent probability distribution.

[0057] In some embodiments, step S102 specifically includes:

[0058] segment the sentences contained in the windows into words;

[0059] convert the words into sequences and obtain segmentation markers;

[0060] input the sequences and the segmentation markers into the trained first language model to obtain the output of each of the words;

[0061] based on the output of each of the words, obtain the candidate intent probability distribution of each of the sentences.

[0062] Specifically, first, based on a word segmentation algorithm, the sentences contained in the windows are segmented into words, the words are converted into sequences, and segmentation marks, i.e., positions of the segmented words, are obtained. The sequences and segmentation marks are input into the first language model to obtain outputs of the words, i.e., probabilities of categories to which the words belong. Based on the outputs of the words, candidate intent probability distributions of the sentences are obtained.

[0063] In some embodiments, the step of obtaining, based on the outputs of the words, candidate intent probability distributions of the sentences specifically includes:

[0064] The outputs of the words corresponding to the sentences are accumulated and summed to obtain candidate intent probability distributions of the sentences.

[0065] The outputs of the words corresponding to the sentences are accumulated and summed to obtain candidate intent probability distributions of the sentences.

[0066] In step S103, the candidate intent probability distributions of the sentences are converted into vectors according to the windows to which the sentences belong, and text vectors of the sentences contained in the windows are obtained.

[0067] Specifically, in this embodiment, each specific probability distribution is grouped by window, i.e., the probability distributions of the sentences belonging to the same window are placed in the same group. The probability distributions are converted into vectors according to the groups, and thus text vectors of the sentences in the same window are obtained. The text vectors at this time are vectors of the sentences contained in the window. For example, assuming that each window contains 5 sentences, the text vectors are text vectors of 5 sentences.

[0068] In step S104, the text vectors are input into the trained second language model in sequence, and revised intent probability distributions of the sentences are obtained.

[0069] The text vectors are input into the trained second language model in the order of the corresponding sentences, and probability values output by the trained second language model are obtained, i.e., revised intent probability distributions of the sentences are obtained.

[0070] In step S105, based on the revised intent probability distributions, a target intent recognition result of the first text is obtained.

[0071] Based on the modified intention probability distribution, the sentences are arranged in order of sequence with allowed overlap, such as the first sentence is modified 1 time, the second sentence is modified 2 times, and the third sentence is modified 3 times. Each sentence is modified at least once and at most 5 times. The final intention probability distribution is obtained by adding all the modified intention probability distributions of each sentence. According to the final intention probability distribution, the candidate intention with the maximum probability is selected as the final intention recognition result of the first text.

[0072] For better understanding of the above embodiments, please refer to Figure 2 , for example, the application scenarios are as follows:

[0073] First, in the process of financial field service, the service is an important way for the call center system in the financial field to provide services for customers. Through the service, the relevant matters of insurance are communicated, and the service refers to the process of the service personnel providing corresponding insurance services for customers through the support system of the call center. The dialogue text between the service personnel and the user can include the dialogue text provided by the service personnel for the user online business consultation or the text of online call record of business handling. At this time, the dialogue text is the call record or description of the customer service personnel and the customer communicating insurance matters, such as the customer's question, "what are the precautions for this insurance", "how much is the monthly premium", etc. Then, the obtained dialogue text is divided based on the sliding window mechanism to obtain a first preset value window, wherein each window includes a second preset value sentence. Thus, the intention of the sentences contained in each window is recognized based on the trained first language model to obtain the candidate intention probability distribution of each sentence; the probability distribution of the corresponding sentence is converted into a vector according to the belonging sentence window to obtain the text vector of the sentence contained in each window; further, the text vector is input into the trained second language model in order to perform secondary recognition to obtain the modified intention probability distribution of each sentence; and based on the modified intention probability distribution, the target intention recognition result of the first text is obtained, so that the model can better combine the context to recognize the intention of the sentence, and the accuracy of the intention recognition of the service text in the financial field is improved.

[0074] The intent recognition method based on artificial intelligence provided by the above embodiment, the intent recognition method, device, computer equipment and readable storage medium, the intent recognition method based on artificial intelligence, by acquiring a first text related to the financial field, such as a first text related to insurance, and based on the sliding window mechanism, the first text is divided, and a first preset value window is obtained; based on the trained first language model, the intent of each window containing the sentence is recognized, and the candidate intent probability distribution of each sentence is obtained; the candidate intent probability distribution of the sentence is converted into a vector according to the window to which the sentence belongs, and the text vector of the sentence contained in each window is obtained; the text vector is input into the trained second language model in order, and the modified intent probability distribution of each sentence is obtained; based on the modified intent probability distribution, the target intent recognition result of the first text is obtained. Through the above mode, after the intent of each sentence in the first text is recognized, the context of the sentence is further recognized based on the window, and the multiple sentences contained in the window are further recognized based on the context, so as to obtain the intent recognition result of the first text. Since multiple recognitions are performed, and the single sentence recognition and the context-based sentence recognition are combined, the accuracy of the problem intent recognition of the insurance-related seat service in the financial field is improved based on artificial intelligence.

[0075] Please refer to Figure 3 , Figure 3 The schematic block diagram of the intent recognition device based on artificial intelligence provided by the embodiment of the application is shown.

[0076] As Figure 3 shown, the device 300 includes a first acquisition module 301, an identification module 302, a conversion module 303, an input module 304 and a second acquisition module 305.

[0077] The first acquisition module 301 is configured to acquire a first text, and based on the sliding window mechanism, the first text is divided to obtain a first preset value window;

[0078] The identification module 302 is configured to recognize the intent of each window containing the sentence based on the trained first language model, and obtain the candidate intent probability distribution of each sentence.

[0079] The conversion module 303 is configured to convert the candidate intent probability distribution of the sentence into a vector according to the window to which the sentence belongs, and obtain the text vector of the sentence contained in each window.

[0080] The input module 304 is configured to input the text vector into the trained second language model in order, and obtain the modified intent probability distribution of each sentence.

[0081] The second obtaining module 305 is configured to obtain a target intent recognition result of the first text based on the modified intent probability distribution.

[0082] It should be noted that, for the convenience and brevity of description, the specific working process of the apparatus and each module and unit described above can refer to the corresponding process in the foregoing artificial intelligence-based intent recognition method embodiments, which will not be described herein.

[0083] The apparatus provided by the foregoing embodiments can be implemented as a computer program in the form of a program product, which can run on a computer device such as the computer device shown in Figure 3 .

[0084] Please refer to Figure 3 , Figure 3 for a structural schematic block diagram of a computer device provided by an embodiment of the present application. The computer device can be a personal computer (PC), a server, or the like device having a data processing function.

[0085] As shown in Figure 4 , the computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory can include a non-volatile storage medium and an internal memory.

[0086] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, which, when executed, can cause the processor to perform any one of the artificial intelligence-based intent recognition methods.

[0087] The processor is configured to provide computing and control capabilities to support the operation of the entire computer device.

[0088] The internal memory provides an environment for the running of the computer program in the non-volatile storage medium, and the computer program, when executed by the processor, can cause the processor to perform any one of the artificial intelligence-based intent recognition methods.

[0089] The network interface is configured to perform network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that Figure 4 the structure shown in the foregoing embodiments, only the block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0090] It should be appreciated that the processor can be a central processing unit (CPU), the processor can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0091] In one embodiment, the processor is configured to run a computer program stored in the memory to implement the following steps:

[0092] Obtain a first text, and split the first text based on a sliding window mechanism to obtain a first preset number of windows;

[0093] Perform intent recognition on the sentences contained in each window based on the trained first language model to obtain a candidate intent probability distribution of each sentence;

[0094] Convert the candidate intent probability distribution of the sentence into a vector according to the window to which the sentence belongs to obtain a text vector of the sentence contained in each window;

[0095] Input the text vector into the trained second language model in order to obtain a revised intent probability distribution of each sentence;

[0096] Obtain a target intent recognition result of the first text based on the revised intent probability distribution.

[0097] In some embodiments, when the processor implements the obtaining of the first text and the splitting of the first text based on the sliding window mechanism to obtain a first preset number of windows, it is configured to implement:

[0098] Cut the sentences of the first text based on a sliding window with a third preset size and a fourth preset step to obtain a first preset number of windows, wherein the first preset number is obtained based on the third preset size, the fourth preset step, and the number of sentences contained in the first text, and each window contains a third preset number of sentences.

[0099] In some embodiments, when the processor implements the intent recognition on the sentences contained in each window based on the trained first language model to obtain a candidate intent probability distribution of each sentence, it is configured to implement:

[0100] segmenting the sentences contained in each window into words;

[0101] converting the words into sequences and obtaining segmentation flags;

[0102] inputting the sequences and the segmentation flags into the trained first language model to obtain outputs of the words;

[0103] obtaining candidate intent probability distributions of the sentences based on the outputs of the words.

[0104] In some embodiments, when the processor implements the obtaining candidate intent probability distributions of the sentences based on the outputs of the words, it is configured to:

[0105] obtaining candidate intent probability distributions of the sentences by accumulating and summing the outputs of the words corresponding to the sentences.

[0106] In some embodiments, when the processor implements the converting the candidate intent probability distributions of the sentences into vectors according to the windows to which the sentences belong, and obtaining text vectors of the sentences contained in each window, it is configured to:

[0107] combining the probability distributions of the sentences in the same window into an array to obtain the text vectors of the sentences contained in each window.

[0108] In some embodiments, before the processor implements the obtaining a first text and splitting the first text based on a sliding window mechanism to obtain a first preset number of windows, it is further configured to:

[0109] performing vertical domain pre-training on a Chinese-based pre-training model using a training set in a specific scenario to obtain the trained first language model, wherein the training set includes texts and labels of single sentences in the specific scenario.

[0110] In some embodiments, after the processor implements the performing vertical domain pre-training on a Chinese-based pre-training model using a training set in a specific scenario to obtain the trained first language model, wherein the training set includes texts and labels of single sentences in the specific scenario, it is further configured to:

[0111] performing intent recognition on the single sentences in the training set in the specific scenario based on the trained first language model to obtain probability distributions of the single sentences belonging to each candidate intent;

[0112] converting the probability distributions of each single sentence belonging to each candidate intent into a vector, and taking the vector as a text vector representation of each sentence;

[0113] using a sliding window with a third preset size, the text vector of the adjacent N sentences is represented, and input into the pre-trained second language model to obtain an intent recognition result of each unit of the pre-trained second language model;

[0114] According to the corresponding intent label and the intent recognition result of each sentence in the training set, the loss of the adjacent N sentences is calculated, and the pre-trained second language model is trained based on the loss to obtain a trained second language model.

[0115] The embodiments of the application further provide a computer readable storage medium, the computer readable storage medium stores a computer program, the computer program includes program instructions, and the method implemented when the program instructions are executed can refer to each embodiment of the application based on artificial intelligence intent recognition method.

[0116] The computer readable storage medium can be an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. The computer readable storage medium can also be an external storage device of the computer device, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc.

[0117] Further, the computer readable storage medium can mainly include a storage program area and a storage data area, wherein the storage program area can store an operating system, at least one application required by a function, etc.; and the storage data area can store data created according to the use of the blockchain node, etc.

[0118] The blockchain referred to in the application is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. Blockchain, in essence, is a decentralized database, which is a series of data blocks associated using cryptographic methods, each data block containing information of a batch of network transactions, for verifying the validity (anti-fake) of the information and generating the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer, etc.

[0119] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a", "comprising", or "comprises" does not, without further qualification, preclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0120] The above-mentioned embodiment serial numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments. The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. An artificial intelligence-based intent recognition method, characterized by, The method comprises the following steps: obtaining a first text, and performing segmentation on the first text based on a sliding window mechanism to obtain a first preset number of windows; performing intent recognition on a sentence contained in each window based on a trained first language model to obtain a candidate intent probability distribution of each sentence; converting the candidate intent probability distribution of the sentence into a vector according to the window to which the sentence belongs to obtain a text vector of the sentence contained in each window; inputting the text vector into a trained second language model in sequence to obtain a revised intent probability distribution of each sentence; obtaining a target intent recognition result of the first text based on the revised intent probability distribution; wherein converting the candidate intent probability distribution of the sentence into a vector according to the window to which the sentence belongs to obtain a text vector of the sentence contained in each window comprises: combining the probability distributions of the sentences in the same window into an array to obtain a text vector of the sentences contained in each window; wherein the text vectors of adjacent N sentences in a training set of a specific scenario are represented and input into a pre-trained second language model to obtain an intent recognition result predicted by the pre-trained second language model using a sliding window with a third preset size; the loss of the adjacent N sentences is calculated according to the corresponding intent label and intent recognition result of each sentence in the training set, and the pre-trained second language model is trained based on the loss to obtain the trained second language model. 2.The artificial intelligence-based intent recognition method of claim 1, wherein, The method comprises the following steps: cutting the sentences of the first text based on a sliding window with a third preset size and a fourth preset step size to obtain a first preset number of windows, wherein the first preset number is obtained based on the third preset size, the fourth preset size, and the number of sentences contained in the first text, and each window contains a third preset number of sentences. 3.The AI-based intent recognition method of claim 1, wherein, The method comprises the following steps: segmenting the sentences contained in each window into words; converting the words into sequences and obtaining segmentation marks; inputting the sequences and the segmentation marks into the trained first language model to obtain the output of each word; obtaining the candidate intent probability distribution of each sentence based on the output of each word. 4.The AI-based intent recognition method of claim 3, wherein, The method comprises the following steps: performing cumulative summation on the output of the words corresponding to each sentence to obtain the candidate intent probability distribution of each sentence. 5.The artificial intelligence-based intent recognition method of claim 1, wherein, Before the step of obtaining a first text and performing segmentation on the first text based on a sliding window mechanism to obtain a first preset number of windows, the method further comprises the following steps: performing vertical field pre-training on a Chinese-based pre-training model using a training set of the specific scenario to obtain a trained first language model, wherein the training set comprises single-sentence text and labels of the specific scenario. 6.The AI-based intent recognition method of claim 5, wherein, The training set of the specific scene is used to pre-train a Chinese-based pre-trained model in a vertical field to obtain a trained first language model, wherein the training set includes texts of single sentences of the specific scene and labels, and further includes: Based on the trained first language model, intent recognition is performed on the single sentences in the training set of the specific scene to obtain probability distributions of the single sentences belonging to each candidate intent. Each probability distribution of the single sentences belonging to each candidate intent is converted into a vector, and the vector is taken as a text vector representation of each sentence. 7.An artificial intelligence-based intent recognition apparatus, characterized by comprising: The intent recognition device includes: A first obtaining module configured to obtain a first text and split the first text based on a sliding window mechanism to obtain a first preset number of windows; An identification module configured to perform intent recognition on sentences contained in each window based on a trained first language model to obtain a candidate intent probability distribution of each sentence; A conversion module configured to convert the candidate intent probability distribution of each sentence into a vector according to the window to which the sentence belongs to obtain a text vector of the sentence contained in each window; An input module configured to input the text vectors into a trained second language model in sequence to obtain a revised intent probability distribution of each sentence; A second obtaining module configured to obtain a target intent recognition result of the first text based on the revised intent probability distribution; The conversion module is specifically configured to combine the probability distributions of sentences in the same window into an array to obtain a text vector of the sentences contained in each window. The intent recognition device further includes a training module. The training module is configured to use a sliding window with a third preset size to input text vector representations of adjacent N sentences in a training set of a specific scene into a pre-trained second language model to obtain an intent recognition result predicted by the pre-trained second language model; calculate a loss of the adjacent N sentences according to an intent label corresponding to each sentence in the training set and the intent recognition result; and train the pre-trained second language model based on the loss to obtain a trained second language model.

8. A computer device, comprising: The computer device includes a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the artificial intelligence-based intent recognition method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein when the computer program is executed by the processor, the steps of the artificial intelligence-based intent recognition method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Sample statement processing method and device, computer equipment and storage medium

    CN114118059A

  • User intention recognition method and apparatus based on statement context relationship prediction

    US20230080671A1