Text multi-intention recognition method and system based on AI and medium
By selecting a number of neighbors of the target sentence in the text, the target long sentence is formed, and the preset intention recognition model is entered to recognize the problem of identifying the accuracy of the accuracy at this stage. Accuracy.
Patent Information
- Application Number
- CN202411469694.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-01-28
AI Technical Summary
The current semantic understanding technology is not very accurate in multi-intention recognition, and it is difficult to effectively identify the real needs in multi-intention text.
By obtaining the target text, select a number of neighbor clauses of the target sentence, form a long sentence of the target, and use the preset intention to identify the model to identify it. This method takes into account the neighbor of a neighbor of a sentence, which may also be the neighbor of the sentence, which enriches the characteristic information of the target long sentence and enhances the accuracy of multi -intention identification.
By forming a long sentence of the goal of richer characteristic information, the accuracy of multi -ideological identification of target text has been improved, and more accurate intent to identify.
Smart Images

Figure CN119377382A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of NLP technology, and in particular to an AI-based text multi-intent recognition method, system and medium. Background Art
[0002] In communication services, especially AI-based customer service services, the voice provided by the customer is usually converted into text, and then the text is analyzed based on natural language processing (NLP) to obtain the real needs.
[0003] In the process of obtaining real needs, it is necessary to first detect the intention of the customer's text, and then perform semantic understanding and recognition based on the user's intention to achieve better recognition results.
[0004] At present, the intent of the text is usually recognized based on a preset intent recognition model, but the recognition accuracy is good only for single intent. However, for multi-intent recognition, the accuracy of current semantic understanding technology is not high. Summary of the invention
[0005] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0006] The main purpose of the embodiments of the present disclosure is to propose an AI-based text multi-intent recognition method, system and medium, which can improve the accuracy of multi-intent recognition and have guiding significance for subsequent semantic analysis.
[0007] A first aspect of an embodiment of the present application proposes an AI-based text multi-intent recognition method, the method comprising:
[0008] Get the target text;
[0009] In the target text, a plurality of neighbor clauses corresponding to a target clause are selected, and the target clause and the corresponding plurality of neighbor clauses are combined into a target long sentence; the target clause is any clause in the target text, and the neighbor clause is a first clause adjacent to the target clause and / or a second clause adjacent to the first clause;
[0010] Each of the target long sentences in the target text is input into a preset intention recognition model to obtain the intention corresponding to each of the target long sentences output by the intention recognition model.
[0011] This application proposes an AI-based text multi-intent recognition method, which has at least the following beneficial effects:
[0012] The method includes: obtaining a target text, selecting several neighbor clauses corresponding to a target clause in the target text, and forming a target long sentence with the target clause and the corresponding several neighbor clauses; the target clause is any clause in the target text, the neighbor clause is the first clause adjacent to the target clause and / or the second clause adjacent to the first clause, and inputting each target long sentence of the target text into a preset intention recognition model to obtain the intention corresponding to each target long sentence output by the intention recognition model. The method takes into account that the neighbor of the neighbor of a clause is likely to be the neighbor of the clause, and selects several corresponding neighbor clauses for each target clause, and then forms a target long sentence based on the target clause and the corresponding several neighbor clauses, so that the target long sentence has richer feature information than the target clause, which can improve the accuracy of multi-intention recognition of the target text. Moreover, the method inputs each target long sentence of the target text into a preset intention recognition model, obtains the intention corresponding to each target long sentence output by the intention recognition model, and realizes multi-intention recognition.
[0013] In some implementations, the selecting of several neighbor clauses corresponding to the target clause includes:
[0014] calculating a first similarity between the target clause and the first clause, and calculating a second similarity between the target clause and the second clause;
[0015] If both the first similarity and the second similarity are greater than a preset threshold, taking the first clause and the second clause as the neighbor clauses of the target clause;
[0016] If only the first similarity is greater than a preset threshold, taking the first clause as the neighbor clause of the target clause;
[0017] If only the second similarity is greater than a preset threshold, the second clause is used as the neighbor clause of the target clause.
[0018] In some implementations, calculating a first similarity between the target clause and the first clause, and calculating a second similarity between the target clause and the second clause, includes:
[0019] Inputting the target text into a word2vec model, obtaining a vector of the target clause, a vector of the first clause, and a vector of the second clause output by the word2vec model;
[0020] Calculating a first cosine similarity between the vector of the target clause and the vector of the first clause, and using the first cosine similarity as a first similarity between the target clause and the first clause;
[0021] A second cosine similarity between the vector of the target clause and the vector of the second clause is calculated, and the second cosine similarity is used as the second similarity between the target clause and the second clause.
[0022] In some embodiments, the training process of the intent recognition model includes:
[0023] Get training text;
[0024] Extracting a plurality of standard vectors of the training text;
[0025] Training the initial intent recognition model with multiple standard vectors of the training text, and obtaining the initial intent recognition model by dividing the corresponding intent category for each standard vector, so as to obtain the trained intent recognition model;
[0026] The step of inputting each target long sentence of the target text into a preset intention recognition model to obtain the intention corresponding to each target long sentence output by the intention recognition model includes:
[0027] Each target long sentence of the target text is input into a preset intention recognition model, the similarity between the corresponding vector of the target long sentence and the standard vector is determined according to the intention recognition model, and the intention category corresponding to the standard vector with the highest similarity is selected as the intention category of the target long sentence.
[0028] In some embodiments, the initial intent recognition model is an xgboost model.
[0029] In some embodiments, the intent is an emotional intent.
[0030] A second aspect of the embodiments of the present application proposes an AI-based text multi-intention recognition system, the system comprising:
[0031] A target text acquisition module is used to acquire the target text;
[0032] A target long sentence calculation module is used to select a number of neighbor clauses corresponding to a target clause in the target text, and combine the target clause and the corresponding number of neighbor clauses to form a target long sentence; the target clause is any clause in the target text, and the neighbor clause is a first clause adjacent to the target clause and / or a second clause adjacent to the first clause;
[0033] The intention calculation module is used to input each of the target long sentences of the target text into a preset intention recognition model to obtain the intention corresponding to each of the target long sentences output by the intention recognition model.
[0034] A third aspect of an embodiment of the present application proposes an electronic device, comprising at least one controller and a memory for communicating with the controller; the memory stores instructions that can be executed by the at least one controller, and the instructions are executed by the at least one controller so that the at least one controller executes the AI-based text multi-intent recognition method as described above.
[0035] The fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed, the AI-based text multi-intent recognition method as described above is implemented.
[0036] The fifth aspect of the embodiments of the present application proposes a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes an AI-based text multi-intent recognition method as described above.
[0037] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0039] Figure 1 It is a flowchart of an embodiment of an AI-based text multi-intent recognition method provided by the present application;
[0040] Figure 2 This is a structural diagram of an AI-based text multi-intent recognition system provided by this application;
[0041] Figure 3 It is a structural schematic diagram of the electronic device provided by this application. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0045] First, a brief background:
[0046] In communication services, especially AI-based customer service services, the voice provided by the customer is usually converted into text, and then the text is analyzed based on natural language processing (NLP) to obtain the real needs.
[0047] In the process of obtaining real needs, it is necessary to first detect the intention of the customer's text, and then perform semantic understanding and recognition based on the user's intention to achieve better recognition results.
[0048] At present, the intent of the text is usually recognized based on a preset intent recognition model, but the recognition accuracy is good only for single intent. However, for multi-intent recognition, the accuracy of current semantic understanding technology is not high.
[0049] In order to solve the above defects, the embodiment of the present application proposes an AI-based text multi-intent recognition method, which includes the following steps:
[0050] Step S110, obtaining target text;
[0051] Step S120: In the target text, select a number of neighbor clauses corresponding to the target clause, and combine the target clause and the corresponding number of neighbor clauses to form a target long sentence; the target clause is any clause in the target text, and the neighbor clause is the first clause adjacent to the target clause and / or the second clause adjacent to the first clause;
[0052] Step S130: input each target long sentence of the target text into a preset intention recognition model to obtain the intention corresponding to each target long sentence output by the intention recognition model.
[0053] In some embodiments of the present application, the target text can be obtained based on the voice conversion of the customer input. For example, speech-to-text is a technology that converts human speech into editable text. This technology is widely used in various scenarios, such as meeting records, customer service, educational tools, etc. Speech-to-text systems usually support multiple languages and audio formats, and can convert the voice content in the recording into text in real time or non-real time. For example, some applications support the conversion of audio files in MP3, MAV, M4A and other formats into text.
[0054] The target text includes multiple clauses. Here, the target text can be divided into multiple clauses based on punctuation marks, which will not be described in detail here.
[0055] In step S120, the target clause is any clause in the target text. The purpose of this embodiment is to select the corresponding neighbor clause for each target clause. Wherein, the neighbor clause is the first clause adjacent to the target clause and / or the second clause adjacent to the first clause. Because in the text, the clause adjacent to the target clause may contain the same characteristic information as the target clause, and may also contain characteristic information that is not present in the target clause. And at this stage, usually only the clause adjacent to the target clause is considered, ignoring that the neighbor of the neighbor of a clause is likely to be the neighbor of the clause, that is, the adjacent clause of the clause adjacent to the target clause may also contain the same characteristic information as the target clause, and may also contain characteristic information that is not present in the target clause, so the neighbor clause corresponding to the target clause defined in this application is the first clause adjacent to the target clause and / or the second clause adjacent to the first clause.
[0056] In step S120, the target clause and the corresponding neighbor clauses are combined into a target long sentence. Because the neighbor clauses of the target clause may contain the same feature information as the target clause, or may contain feature information that is not in the target clause, by combining the target clause and the corresponding neighbor clauses into a target long sentence, the information of the target long sentence can be enriched, so that the feature model can learn richer information when extracting information through the target long sentence, thereby obtaining a more accurate intention.
[0057] Finally, each target long sentence of the target text is input into the preset intent recognition model to obtain the intent corresponding to each target long sentence output by the intent recognition model. It should be noted that in the target text, there may be multiple target long sentences with the same intent category, or each target long sentence may have an intent category different from other target long sentences. This is not limited here. According to the intent recognition model, the corresponding intent can be output for each target long sentence, thereby realizing multi-intent recognition of the target text.
[0058] The AI-based text multi-intent recognition method provided in this embodiment has at least the following beneficial effects:
[0059] The method includes: obtaining a target text, selecting several neighbor clauses corresponding to a target clause in the target text, and forming a target long sentence with the target clause and the corresponding several neighbor clauses; the target clause is any clause in the target text, the neighbor clause is the first clause adjacent to the target clause and / or the second clause adjacent to the first clause, and inputting each target long sentence of the target text into a preset intention recognition model to obtain the intention corresponding to each target long sentence output by the intention recognition model. The method takes into account that the neighbor of the neighbor of a clause is likely to be the neighbor of the clause, and selects several corresponding neighbor clauses for each target clause, and then forms a target long sentence based on the target clause and the corresponding several neighbor clauses, so that the target long sentence has richer feature information than the target clause, which can improve the accuracy of multi-intention recognition of the target text. Moreover, the method inputs each target long sentence of the target text into a preset intention recognition model, obtains the intention corresponding to each target long sentence output by the intention recognition model, and realizes multi-intention recognition.
[0060] In some embodiments of the present application, the step S120 of selecting a plurality of neighbor clauses corresponding to the target clause includes the following steps:
[0061] calculating a first similarity between the target clause and the first clause, and calculating a second similarity between the target clause and the second clause;
[0062] If both the first similarity and the second similarity are greater than a preset threshold, the first clause and the second clause are used as neighbor clauses of the target clause;
[0063] If only the first similarity is greater than a preset threshold, the first clause is taken as a neighbor clause of the target clause;
[0064] If only the second similarity is greater than the preset threshold, the second clause is taken as a neighbor clause of the target clause.
[0065] In some embodiments of the present application, assuming that there is always a similarity greater than a threshold between a target clause and a first clause or between a target clause and a second clause, if both the first similarity and the second similarity are greater than a preset threshold, the first clause and the second clause are regarded as neighbor clauses of the target clause; if only the first similarity is greater than the preset threshold, the first clause is regarded as a neighbor clause of the target clause; if only the second similarity is greater than the preset threshold, the second clause is regarded as a neighbor clause of the target clause.
[0066] The similarity can be calculated using cosine similarity, and the word2vec model can be used to extract features.
[0067] In some embodiments, the threshold value may be set empirically.
[0068] In some embodiments of the present application, calculating a first similarity between a target clause and a first clause, and calculating a second similarity between a target clause and a second clause, includes:
[0069] Input the target text into the word2vec model, and obtain the vector of the target clause, the vector of the first clause, and the vector of the second clause output by the word2vec model;
[0070] Calculate the first cosine similarity between the vector of the target clause and the vector of the first clause, and use the first cosine similarity as the first similarity between the target clause and the first clause;
[0071] A second cosine similarity between the vector of the target clause and the vector of the second clause is calculated, and the second cosine similarity is used as the second similarity between the target clause and the second clause.
[0072] Word2Vec is a toolkit for obtaining word vectors, which was open sourced by Google in 2013. Its basic idea is to represent the semantics of a word through its context and then calculate its vector representation. The Word2Vec model includes two main models: CBOW (Continuous Bag of Words Model) and Skip-gram Model.
[0073] In the Word2Vec model, the input can be multiple words, and the model's task is to predict the next word of these words. During the training process, the text is usually input into the neural network using the Embedding layer. The training data can come from sentences with normal logic, such as novels and papers. The CBOW model predicts the center word vector through the context word vector, while the Skip-gram model predicts the context word vector through the center word vector.
[0074] In order to optimize the training speed of the Word2Vec model, hierarchical softmax and negative sampling techniques are used. Hierarchical softmax uses the Huffman tree for probability prediction, while negative sampling reduces the computational complexity by sampling different central words.
[0075] The Word2Vec model is widely used in natural language processing, such as text sentiment analysis, grammar analyzers, etc. Through word vectors, the similarity between words can be calculated, and then tasks such as text classification and sentiment analysis can be performed.
[0076] Cosine similarity, also known as cosine similarity, evaluates the similarity between two vectors by calculating the cosine of the angle between them.
[0077] In some embodiments of the present application, the training process of the intent recognition model in step S130 includes the following steps:
[0078] Get training text;
[0079] Extract multiple standard vectors of training text;
[0080] The initial intent recognition model is trained using multiple standard vectors of the training text, and the initial intent recognition model is obtained by dividing the corresponding intent category for each standard vector to obtain a trained intent recognition model;
[0081] Step S130 of inputting each target long sentence of the target text into a preset intention recognition model to obtain the intention corresponding to each target long sentence output by the intention recognition model includes the following steps:
[0082] Each target long sentence of the target text is input into the preset intention recognition model, and the similarity between the corresponding vector of the target long sentence and the standard vector is determined according to the intention recognition model, and the intention category corresponding to the standard vector with the highest similarity is selected as the intention category of the target long sentence.
[0083] In some embodiments of the present application, the training text is a text prepared in advance, which may be generated by a computer, or may be text converted from the voice of customers collected daily, which is not limited here.
[0084] In some embodiments of the present application, multiple standard vectors of training text can be extracted through the Word2Vec model.
[0085] The standard vector is the vector of the text with the highest probability when the text has the highest probability of appearing in the intent category to which it belongs, and serves as the standard vector of the intent category to which the text with the highest probability belongs.
[0086] Then, the initial intent recognition model is trained using multiple standard vectors of the training text, and the initial intent recognition model is obtained by dividing the corresponding intent category for each standard vector to obtain a trained intent recognition model.
[0087] Finally, when in use, each target long sentence of the target text is input into the preset intention recognition model, and the similarity between the corresponding vector of the target long sentence and the standard vector is judged according to the intention recognition model, and the intention category corresponding to the standard vector with the highest similarity is selected as the intention category of the target long sentence.
[0088] In some embodiments of the present application, the initial intent recognition model is an xgboost model.
[0089] The XGBoost (eXtreme Gradient Boosting) model is an optimized gradient boosting decision tree algorithm. It has made many improvements based on GBDT, including the second-order Taylor expansion of the loss function, the addition of regularization terms, parallel computing, and missing value processing, thereby improving the training speed and the generalization ability of the model.
[0090] The core principle of XGBoost lies in the construction and optimization of its objective function. It trains a series of weak learners (usually decision trees) step by step and iteratively, and each iteration attempts to correct the error of the previous iteration, and finally combines these weak learners into a strong learner. In the process of optimizing the objective function, XGBoost uses the second-order Taylor expansion, which enables it to more accurately estimate the changes in the objective function during the solution process, so as to find a better solution. In addition, XGBoost also controls the complexity of the model by adding regularization terms to prevent overfitting, and supports parallel computing, which greatly improves the training speed.
[0091] XGBoost has not only performed well in academic research, but has also been widely used in practical applications. It is used to solve various machine learning tasks, including regression, classification, and ranking problems. The open source nature of XGBoost also makes it easy for researchers and developers to use and improve this powerful tool.
[0092] In general, XGBoost, through its unique optimization strategy and efficient computing method, not only improves model performance, but also greatly simplifies the implementation process of complex machine learning tasks. It is currently a very popular machine learning algorithm.
[0093] In some embodiments of the present application, the intent is an emotional intent.
[0094] In some embodiments, the affective intent is an emotional intent, which includes but is not limited to: requesting help, making a complaint, interested in a product / service, and the like.
[0095] One embodiment of the present application provides an AI-based text multi-intent recognition system, which includes: a target text acquisition module 1100, a target long sentence calculation module 1200 and an intent calculation module 1300.
[0096] A target text acquisition module is used to acquire the target text;
[0097] A target long sentence calculation module is used to select a number of neighbor clauses corresponding to a target clause in a target text, and combine the target clause and the corresponding number of neighbor clauses to form a target long sentence; the target clause is any clause in the target text, and the neighbor clause is a first clause adjacent to the target clause and / or a second clause adjacent to the first clause;
[0098] The intention calculation module is used to input each target long sentence of the target text into a preset intention recognition model to obtain the intention corresponding to each target long sentence output by the intention recognition model.
[0099] It should be noted that this AI-based text multi-intent recognition system embodiment and the above-mentioned AI-based text multi-intent recognition method embodiment are based on the same inventive concept, so the relevant content of the above method embodiment is also applicable to the system embodiment and will not be described in detail here.
[0100] like Figure 3 Based on the same inventive concept, an embodiment of the present application also provides an electronic device.
[0101] The electronic device may include a processor 401 and a memory 402 storing computer programs or instructions.
[0102] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.
[0103] The memory 402 may include a large capacity memory for data or instructions. For example, but not limitation, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 402 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 402 is a non-volatile solid-state memory. The memory may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described in the AI-based text multi-intent recognition method provided in the above-mentioned embodiments.
[0104] The processor 401 implements any one of the AI-based text multi-intent recognition methods in the above embodiments by reading and executing computer program instructions stored in the memory 402.
[0105] In one example, the electronic device may further include a communication interface 403 and a bus 410. The processor 401, the memory 402, and the communication interface 403 are connected via the bus 410 and communicate with each other.
[0106] The communication interface 403 is mainly used to implement the communication between the modules, devices, units and / or devices in the embodiment of the present invention.
[0107] Bus 410 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection.
[0108] The electronic device can execute the data processing method in the embodiment of the present invention, thereby realizing Figure 1 Any AI-based text multi-intent recognition method described.
[0109] In addition, in combination with the AI-based text multi-intent recognition method in the above embodiment, the embodiment of the present invention can provide a readable storage medium for implementation. The readable storage medium stores program instructions; when the program instructions are executed by the processor, any one of the AI-based text multi-intent recognition methods in the above embodiment is implemented.
[0110] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0111] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0112] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0113] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
Claims
1. A method for identifying multiple intentions in text based on AI, characterized in that: The method comprises Get the target text; In the target text, a plurality of neighbor clauses corresponding to a target clause are selected, and the target clause and the corresponding plurality of neighbor clauses are combined into a target long sentence; the target clause is any clause in the target text, and the neighbor clause is a first clause adjacent to the target clause and / or a second clause adjacent to the first clause; Each of the target long sentences in the target text is input into a preset intention recognition model to obtain the intention corresponding to each of the target long sentences output by the intention recognition model.
2. The AI-based text multi-intention recognition method according to claim 1, characterized in that: The selecting of several neighbor clauses corresponding to the target clause includes: calculating a first similarity between the target clause and the first clause, and calculating a second similarity between the target clause and the second clause; If both the first similarity and the second similarity are greater than a preset threshold, taking the first clause and the second clause as the neighbor clauses of the target clause; If only the first similarity is greater than a preset threshold, taking the first clause as the neighbor clause of the target clause; If only the second similarity is greater than a preset threshold, the second clause is used as the neighbor clause of the target clause.
3. The AI-based text multi-intention recognition method according to claim 2 is characterized in that: The calculating a first similarity between the target clause and the first clause, and the calculating a second similarity between the target clause and the second clause, comprises: Inputting the target text into a word2vec model, obtaining a vector of the target clause, a vector of the first clause, and a vector of the second clause output by the word2vec model; Calculating a first cosine similarity between the vector of the target clause and the vector of the first clause, and using the first cosine similarity as a first similarity between the target clause and the first clause; A second cosine similarity between the vector of the target clause and the vector of the second clause is calculated, and the second cosine similarity is used as the second similarity between the target clause and the second clause.
4. The AI-based text multi-intention recognition method according to claim 1, characterized in that: The training process of the intent recognition model includes: Get training text; Extracting a plurality of standard vectors of the training text; Training the initial intent recognition model with multiple standard vectors of the training text, and obtaining the initial intent recognition model by dividing the corresponding intent category for each standard vector, so as to obtain the trained intent recognition model; The step of inputting each target long sentence of the target text into a preset intention recognition model to obtain the intention corresponding to each target long sentence output by the intention recognition model includes: Each target long sentence of the target text is input into a preset intention recognition model, the similarity between the corresponding vector of the target long sentence and the standard vector is determined according to the intention recognition model, and the intention category corresponding to the standard vector with the highest similarity is selected as the intention category of the target long sentence.
5. The AI-based text multi-intention recognition method according to claim 4 is characterized in that: The initial intent recognition model is an xgboost model.
6. The AI-based text multi-intention recognition method according to claim 1, characterized in that: The intent is an emotional intent.
7. An AI-based text multi-intention recognition system, characterized in that: The system comprises: A target text acquisition module is used to acquire the target text; A target long sentence calculation module is used to select a number of neighbor clauses corresponding to a target clause in the target text, and combine the target clause and the corresponding number of neighbor clauses to form a target long sentence; the target clause is any clause in the target text, and the neighbor clause is a first clause adjacent to the target clause and / or a second clause adjacent to the first clause; The intention calculation module is used to input each of the target long sentences of the target text into a preset intention recognition model to obtain the intention corresponding to each of the target long sentences output by the intention recognition model.
8. An electronic device, characterized in that: It includes at least one controller and a memory for communicating with the controller; the memory stores instructions that can be executed by the at least one controller, and the instructions are executed by at least one of the controllers to enable at least one of the controllers to execute the AI-based text multi-intent recognition method as described in any one of claims 1 to 7.
9. A computer storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the AI-based text multi-intent recognition method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes an AI-based text multi-intent recognition method as described in any one of claims 1 to 6.
Citation Information
Cited By
Information processing method and device, electronic equipment, storage medium and product
CN121387980A