Intention recognition method and system based on semantic elements

By setting intent labels and element weights, extracting element words from dialogue sentences and calculating similarity indices, the problem of low accuracy in intent recognition in existing technologies is solved, achieving efficient intent analysis and recognition.

CN117786056BActive Publication Date: 2026-07-10SHENZHEN MAXVISION TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN MAXVISION TECH
Filing Date
2023-11-29
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing technologies have low accuracy in intent recognition, especially when faced with diverse individual user characteristics and a wide range of questions, making it difficult to accurately understand user intent.

Method used

By setting intent tags, intent keywords, and element weights, time, location, people, and event element words are extracted from dialogue sentences. The similarity index between element words and intent keywords is calculated, and the correlation index is calculated by combining preset weights to identify the person's intent.

Benefits of technology

It improves the accuracy of intent recognition, automatically identifying a person's intent based on the dialogue content, and achieves efficient intent analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117786056B_ABST
    Figure CN117786056B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of natural language processing, and more particularly to an intent recognition method based on semantic elements, comprising: a preparation step of setting an intent label, an intent keyword and an element weight according to a dialogue scenario and a dialogue object; an element extraction step of extracting element words corresponding to time elements, place elements, character elements and event elements from dialogue sentences; a calculation step of calculating a similarity index between the element words and the intent keyword, and calculating an association index between the dialogue sentences and the intent label according to the element weight and the similarity index; and further inferring the intent of a character according to the size of the association index, thereby achieving the technical effect of automatically recognizing the intent of a character through dialogue.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and in particular to an intent recognition method and system based on semantic elements. Background Technology

[0002] Intent recognition refers to the purpose expressed in a text, such as conveying a user's action or the information the user hopes to obtain. The intent recognition described above, based on a given text dialogue segment, analyzes the semantic relationships between preceding and following words and the surrounding context to determine the user's intent.

[0003] In existing applications, human-computer interaction or intelligent dialogue systems all involve intent recognition. Through intent recognition, the user's statements can be better understood, and corresponding responses can be given to complete effective communication and dialogue. In addition, user statement intent recognition also includes motivation recognition, which refers to analyzing the user's action purpose or the user's potential intention.

[0004] In the prior art, patent CN116450855A proposes a knowledge graph-based method for handling dialogue between the robot and the user in question-answering robots. However, due to the individual characteristics of users, the expression of their questions is diverse and the scope of the questions is broad, which makes the accuracy of the method in recognizing intent low. Summary of the Invention

[0005] The purpose of this invention is to provide an intent recognition method and system based on semantic elements to address the shortcomings of existing technologies, thereby solving the problem of low accuracy in intent recognition in existing technologies.

[0006] The present invention achieves the above objectives through the following technical solutions:

[0007] An intent recognition method based on semantic elements includes:

[0008] Preparation steps: Set intent tags, intent keywords, and element weights according to the dialogue scenario and the dialogue partner;

[0009] Element extraction steps: Extract element words corresponding to time elements, location elements, character elements, and event elements from dialogue sentences;

[0010] Calculation steps: Calculate the similarity index between the element word and the intent keyword, and calculate the association index between the dialogue sentence and the intent tag based on the element weight and the similarity index;

[0011] Intent analysis steps: Comprehensively analyze the correlation index between all the dialogue sentences and the intent tags to obtain the character's intent.

[0012] Furthermore, the element weights are expressed by the formula:

[0013] timeW:addressW:personW:eventW = 3:3:1:3; where timeW is the weight of the time element, addressW is the weight of the location element, personW is the weight of the person element, and eventW is the weight of the event element.

[0014] Furthermore, the method for setting the element weights includes fixed settings and dynamic settings. The fixed setting method is manual setting, and the dynamic setting method includes:

[0015] The sub-step for calculating the time sensitivity value is as follows: The time sensitivity value is obtained based on the similarity between the time element and the working time, expressed by the formula:

[0016]

[0017] Where tsens is the time-sensitive value, and time is the time element;

[0018] The sub-step for calculating the location sensitivity value is as follows: Search for the location and the dialogue scenario separately through a predetermined search engine to obtain the number of location results and the number of dialogue scenario results, and then calculate the average number of results. Then input the location and the dialogue scenario together into the predetermined search engine to obtain the number of combined results. Calculate the ratio of the number of combined results to the average number of results to obtain the location sensitivity value.

[0019] The sub-step for calculating the character sensitivity value is as follows: classify the characters that appear in the dialogue scene according to their age and occupation to obtain the character categories, and calculate the proportion of each character category to obtain the character sensitivity value.

[0020] The sub-step for calculating the event sensitivity value is as follows: Calculate the ratio of the number of times the event occurs in the dialogue scenario to the number of times all other events occur to obtain the event sensitivity value;

[0021] The weight calculation sub-step involves calculating the ratio between the time sensitivity value, the location sensitivity value, the person sensitivity value, and the event sensitivity value, and then multiplying the ratio by 10 to obtain the element weight.

[0022] Furthermore, the calculation steps include:

[0023] The tag selection sub-step involves selecting intent tags related to the dialogue scenario as candidate tags.

[0024] Matching sub-step: Match the intent keywords corresponding to the candidate tags with the element words according to the element attributes to obtain calculated word pairs;

[0025] Steps for calculating the similarity index: Call the synonyms.compare function to process the word pairs and obtain the similarity index;

[0026] The sub-step for calculating the association index is as follows: The association index between the dialogue sentence and the intent tag is calculated based on the element weights. The calculation process is as follows:

[0027] conection=(ts×timeW+as×addressW+ps×personW+es×eventW)×10,

[0028] Wherein, connection is the association index, ts is the similarity index between the time element and the corresponding time keyword, as is the similarity index between the location element and the location keyword, ps is the similarity index between the person element and the person keyword, es is the similarity index between the event element and the event keyword, timeW is the weight of the time element, addressW is the weight of the location element, personW is the weight of the person element, and eventW is the weight of the event element.

[0029] The tag determination sub-step is to select the candidate tag with the highest correlation index as the sentence intent tag.

[0030] Furthermore, the intent analysis step includes:

[0031] Consistency calculation step: Calculate the consistency index of the sentence intent label corresponding to the dialogue sentence;

[0032] Error removal step: Delete the sentence intent tags that have a consistency index below a predetermined threshold;

[0033] Intent determination step: Obtain the character's intent based on the remaining sentence intent tags.

[0034] Furthermore, the element extraction step includes:

[0035] Analysis sub-step: The dialogue sentence is segmented and semantically analyzed using pre-trained LTP4.0 to obtain the element words;

[0036] Verification sub-step: Query the set of pre-set verification words to find verification words that match the element words, and determine whether the element attributes of the verification words are consistent with the element attributes of the element words. If they are consistent, the element extraction step is considered complete; otherwise, the analysis sub-step is performed again.

[0037] Furthermore, the training process of the LTP4.0 includes:

[0038] The dialogue set organization step is to classify the dialogue sentences into different scenario dialogue sentence sets according to the scenario.

[0039] The element annotation process involves manually annotating the dialogue sentences with time, location, characters, and events.

[0040] Adjusting node weights: The LTP4.0 is used to process the dialogue sentence to obtain the processing result. The processing result is compared with the manually annotated result to obtain the comparison result. The weights of the nodes in LTP4.0 are adjusted according to the comparison result.

[0041] Model verification steps: When the comparison results reach the predetermined accuracy, determine that the current weight values ​​of each node in the model are the most suitable values, and determine that the model training is complete.

[0042] Furthermore, in the preparation step, the dialogue scenario, the intent tag, and the intent keyword are stored together in the database. Taking the dialogue scenario as an object, the data structure is represented as follows:

[0043]

[0044] Here, context is the dialogue scenario, tagA, tagB, and tagC are intent tags, and k is the intent keyword, with its subscript used to distinguish the corresponding intent tags.

[0045] A semantic element-based intent recognition system, applying the aforementioned semantic element-based intent recognition method, includes:

[0046] Preparation module: Set intent tags, intent keywords, and element weights based on the dialogue scenario and dialogue partners;

[0047] Element extraction module: Extracts element words corresponding to time elements, location elements, character elements, and event elements from dialogue sentences;

[0048] Calculation module: Calculates the similarity index between the element words and the intent keywords, and calculates the association index between the dialogue sentence and the intent tag based on the element weights and the similarity index;

[0049] Intent Analysis Module: This module comprehensively analyzes the correlation index between all the dialogue sentences and the intent tags to obtain the character's intent.

[0050] Furthermore, the computing module includes:

[0051] The tag selection submodule selects intent tags related to the dialogue scenario as candidate tags.

[0052] Matching submodule: Matches the intent keywords corresponding to the candidate tags with the element words according to the element attributes to obtain calculated word pairs;

[0053] The similarity index calculation module calls the synonyms.compare function to process the word pairs and obtain the similarity index.

[0054] The submodule for calculating the correlation index calculates the correlation index between the dialogue sentence and the intent tag based on the element weights. The calculation process is as follows:

[0055] conection=(ts×timeW+as×addressW+ps×personW+es×eventW)×10,

[0056] Wherein, connection is the association index, ts is the similarity index between the time element and the corresponding time keyword, as is the similarity index between the location element and the location keyword, ps is the similarity index between the person element and the person keyword, es is the similarity index between the event element and the event keyword, timeW is the weight of the time element, addressW is the weight of the location element, personW is the weight of the person element, and eventW is the weight of the event element.

[0057] The tag determination submodule selects the candidate tag with the highest correlation index as the sentence intent tag.

[0058] The beneficial effects of this invention are as follows: by setting a large number of intent tags and their corresponding intent keywords, and then selecting appropriate intent tags according to the dialogue scenario, calculating the correlation index between the dialogue content and the intent tags, the intention of the person can be identified. The intent tags are set by professionals, and the dialogue content is processed by a natural language processing model to obtain element words corresponding to the intent keywords. The similarity index between the element words and the intent keywords is calculated, and the correlation index between the dialogue content and the intent tags is calculated according to the preset weights. Then, the person's intention can be inferred based on the magnitude of the correlation index, thus achieving the technical effect of automatically identifying the person's intention through dialogue. Attached Figure Description

[0059] Figure 1 This is a flowchart of an intent recognition method based on semantic elements proposed in this invention.

[0060] Figure 2 This is a schematic diagram of an intent recognition system based on semantic elements proposed in this invention.

[0061] Figure 3 This is a schematic diagram illustrating the principle of an intent recognition method based on semantic elements proposed in this invention. Detailed Implementation

[0062] The present invention will now be described in detail with reference to the accompanying drawings.

[0063] like Figure 1 The diagram shows a flowchart of an intent recognition method based on semantic elements, including: preparation steps, element extraction steps, calculation steps, and intent analysis steps.

[0064] This solution identifies a person's intent by setting a large number of intent tags and their corresponding intent keywords, selecting appropriate intent tags based on the dialogue scenario, calculating the correlation index between dialogue sentences and intent tags, and then identifying the person's intent. The intent tags are set by professionals, and the dialogue sentences are processed by a natural language processing model to obtain element words corresponding to intent keywords. The similarity index between element words and intent keywords is calculated, and the correlation index between dialogue content and intent tags is calculated according to preset weights. Then, the person's intent is inferred based on the magnitude of the correlation index, thus achieving the technical effect of automatically identifying a person's intent through dialogue.

[0065] Preparation steps: Set intent tags, intent keywords, and element weights according to the dialogue scenario and the dialogue partner;

[0066] Element extraction steps: Extract element words corresponding to time elements, location elements, character elements, and event elements from dialogue sentences;

[0067] Calculation steps: Calculate the similarity index between the element word and the intent keyword, and calculate the association index between the dialogue sentence and the intent tag based on the element weight and the similarity index;

[0068] Intent analysis steps: Comprehensively analyze the correlation index between all the dialogue sentences and the intent tags to obtain the character's intent.

[0069] In one embodiment, the element weights are expressed by the formula: timeW:dressW:personW:eventW = 3:3:1:3; where timeW is the weight of the time element, addressW is the weight of the location element, personW is the weight of the person element, and eventW is the weight of the event element.

[0070] Specifically, one implementation method for setting weights is for professionals to set fixed weights based on the scenario. In practice, the influence of the person on intent recognition is relatively small compared to time, location, and event. Therefore, setting the weight of the person to 1 and the weight of time, location, and event to 3 can achieve a more accurate result.

[0071] In one embodiment, the method for setting the element weights includes fixed setting and dynamic setting. The fixed setting method is manual setting, and the dynamic setting method includes:

[0072] The sub-step for calculating the time sensitivity value is as follows: The time sensitivity value is obtained based on the similarity between the time element and the working time, expressed by the formula:

[0073]

[0074] Where tsens is the time-sensitive value, and time is the time element;

[0075] The sub-step for calculating the location sensitivity value is as follows: Search for the location and the dialogue scenario separately through a predetermined search engine to obtain the number of location results and the number of dialogue scenario results, and then calculate the average number of results. Then input the location and the dialogue scenario together into the predetermined search engine to obtain the number of combined results. Calculate the ratio of the number of combined results to the number of average results to obtain the location sensitivity value.

[0076] The sub-step for calculating the character sensitivity value is as follows: classify the characters that appear in the dialogue scene according to their age and occupation to obtain character categories, and calculate the proportion of each character category to obtain the character sensitivity value.

[0077] The sub-step for calculating the event sensitivity value is as follows: Calculate the ratio of the number of times the event occurs in the dialogue scenario to the number of times all other events occur to obtain the event sensitivity value;

[0078] The weight calculation sub-step involves calculating the ratio between the time sensitivity value, the location sensitivity value, the person sensitivity value, and the event sensitivity value, and then multiplying the ratio by 10 to obtain the element weight.

[0079] Specifically, another way to set weights is through dynamic settings. Dynamic weight settings are primarily based on the deviations between the actual values ​​and conventional values ​​of the four key elements. For example, for the time element, if the time is during unconventional activity times, such as late at night or early morning, the ratio of the difference between the time and the conventional time to the total length of the unconventional activity time is calculated. The larger the ratio, the more unconventional the time, and the greater the weight of the time element should be. For the location element, theoretically, in the same dialogue scenario, the location the dialogue partner is going to has a certain degree of correlation with the location of the dialogue scenario. A search engine is used to automatically search for both locations separately, and then the same search engine is used to search for keywords combining the two locations. The ratio of these two searches is calculated to obtain a value that indicates the degree of correlation between the two locations. The higher the correlation, the more important the location is in inferring intent, and the greater the corresponding sensitivity value should be. For the event element, the ratio of the number of times the event element appears in the dialogue scenario to the total number of times all events appear in the dialogue scenario is calculated as the event sensitivity value. The weight value is then set according to the proportion of the sensitivity values ​​of the four key elements. This achieves the technical effect of dynamically setting appropriate weight values ​​for each element based on specific circumstances.

[0080] In one embodiment, the calculation step includes:

[0081] The tag selection sub-step involves selecting intent tags related to the dialogue scenario as candidate tags.

[0082] Matching sub-step: Match the intent keywords corresponding to the candidate tags with the element words according to the element attributes to obtain calculated word pairs;

[0083] Steps for calculating the similarity index: Call the synonyms.compare function to process the word pairs and obtain the similarity index;

[0084] The sub-step for calculating the association index is as follows: The association index between the dialogue sentence and the intent tag is calculated based on the element weights. The calculation process is as follows:

[0085] conection=(ts×timeW+as×addressW+ps×personW+es×eventW)×10,

[0086] Wherein, connection is the association index, ts is the similarity index between the time element and the corresponding time keyword, as is the similarity index between the location element and the location keyword, ps is the similarity index between the person element and the person keyword, es is the similarity index between the event element and the event keyword, timeW is the weight of the time element, addressW is the weight of the location element, personW is the weight of the person element, and eventW is the weight of the event element.

[0087] The tag determination sub-step is to select the candidate tag with the highest correlation index as the sentence intent tag.

[0088] Specifically, several candidate tags have been selected based on the dialogue scenario. Each candidate tag corresponds to four intent keywords. The similarity between the element words and the intent keywords is calculated, and then the association index between the intent tag and the dialogue sentence is calculated based on the weight. The candidate tags are selected based on the degree of association between the intent tags and the dialogue scenario. For example, if the dialogue scenario is customs, the intent keywords with a high degree of association are: travel, studying abroad, trade, purchasing agents, and investment. The intent keywords corresponding to purchasing agents are: businessman (person), March (time), South Korea (location), and travel (event). The intent keywords corresponding to investment are: villager (person), February (time), abroad (location), and working (event). For example, based on the dialogue file obtained from customs, the element words in the dialogue are parsed as follows: time element words: March, location... The key element is "Korea," the event element is "tourism," and the person element is empty. The similarity index between the element and the corresponding intent keyword in the time-space calculation is 1. The calculation process is as follows: ts = synonyms.compare('March', 'March') = 1, as = synonyms.compare('Korea', 'Korea') = 1, ps = 1, es = synonyms.compare('tourism', 'travel') = 0.88, and the similarity index connection = (1×3 + 1×3 + 1×1 + 0.88×3)×10 = 96.4. The similarity index with the intent keyword "investment" is calculated in the same way and is 44.97. Therefore, it can be preliminarily determined that the intention of the person in the dialogue sentence is "personal shopping agent."

[0089] In one embodiment, the intent analysis step includes:

[0090] Consistency calculation step: Calculate the consistency index of the sentence intent label corresponding to the dialogue sentence;

[0091] Error removal step: Delete the sentence intent tags whose consistency index is lower than a predetermined threshold;

[0092] Intent determination step: Obtain the character's intent based on the remaining sentence intent tags.

[0093] Specifically, each dialogue sentence corresponds to an intent label with the highest similarity index. The correlation between the intent labels corresponding to all dialogue sentences is calculated, and intent labels with obvious low correlation with other intent labels are removed. The remaining intent labels are analyzed to obtain the character's intent.

[0094] In one embodiment, the feature extraction step includes:

[0095] Analysis sub-step: The dialogue sentence is segmented and semantically analyzed using pre-trained LTP4.0 to obtain the element words;

[0096] Verification sub-step: Query the set of pre-set verification words to find verification words that match the element words, and determine whether the element attributes of the verification words are consistent with the element attributes of the element words. If they are consistent, the element extraction step is considered complete; otherwise, the analysis sub-step is performed again.

[0097] Specifically, LTP4.0 is a high-efficiency, high-precision open-source Chinese natural language processing platform developed by the Social Computing and Information Retrieval Research Center of Harbin Institute of Technology. LTP4.0 optimizes and improves several natural language processing techniques, including lexical analysis, syntactic analysis, and semantic analysis. Based on the Chinese ELECTRASmall pre-trained model released by the Harbin Institute of Technology-iFlytek Joint Laboratory, it effectively improves the accuracy of various tasks. In this solution, LTP4.0 is used to analyze dialogue sentences to obtain various element words. In specific implementations, other natural language processing models can also be used. After obtaining the element words, to improve accuracy, a pre-defined element word set is used to verify the word segmentation results.

[0098] In one embodiment, the training process of the LTP4.0 includes:

[0099] The dialogue set organization step is to classify the dialogue sentences into different scenario dialogue sentence sets according to the scenario.

[0100] The element annotation process involves manually annotating the dialogue sentences with time, location, characters, and events.

[0101] Adjusting node weights: The LTP4.0 is used to process the dialogue sentence to obtain the processing result. The processing result is compared with the manually labeled result to obtain the comparison result. The weights of the nodes in LTP4.0 are adjusted according to the comparison result.

[0102] Model verification steps: When the comparison results reach the predetermined accuracy, determine that the current weight values ​​of each node in the model are the most suitable values, and determine that the model training is complete.

[0103] Specifically, all dialogues occurring at customs are collected as a dialogue set for the customs scenario, dialogues within banks are collected as a dialogue set for the banking scenario, and dialogues occurring at schools are collected as a dialogue set for the school scenario. The dialogue sentences in these dialogue sets are manually annotated, and then LTP4.0 is used to analyze and process the dialogue sets. The processing results are compared with the manually annotated results, and the weights of the model nodes are adjusted according to the error until the accuracy of the model reaches a predetermined value. In this scheme, the predetermined accuracy is 98%.

[0104] In one embodiment, during the preparation step, the dialogue scenario, the intent tag, and the intent keyword are stored together in a database. The data structure, with the dialogue scenario as an object, is as follows:

[0105]

[0106] Here, context is the dialogue scenario, tagA, tagB, and tagC are intent tags, and k is the intent keyword, with its subscript used to distinguish the corresponding intent tags.

[0107] Specifically, intent tags and intent keywords are stored in units of dialogue scenarios. Each dialogue scenario corresponds to an "object". The intent tag is the key in the key-value pair in the object, and the value is the intent keyword. They are stored in the form of an array.

[0108] like Figure 2 As shown, this is an intent recognition system based on semantic elements. The intent recognition method based on semantic elements described above includes: a preparation module, an element extraction module, a calculation module, and an intent analysis module.

[0109] This solution identifies a person's intent by setting a large number of intent tags and their corresponding intent keywords, selecting appropriate intent tags based on the dialogue scenario, calculating the correlation index between the dialogue content and the intent tags, and then identifying the person's intent. The intent tags are set by professionals, and the dialogue content is processed by a natural language processing model to obtain element words corresponding to the intent keywords. The similarity index between the element words and the intent keywords is calculated, and the correlation index between the dialogue content and the intent tags is calculated according to preset weights. The higher the correlation index, the more likely the corresponding intent tag is to be the intent of the person in the dialogue.

[0110] Preparation module: Set intent tags, intent keywords, and element weights based on the dialogue scenario and dialogue partners;

[0111] Element extraction module: Extracts element words corresponding to time elements, location elements, character elements, and event elements from dialogue sentences;

[0112] Calculation module: Calculates the similarity index between the element words and the intent keywords, and calculates the association index between the dialogue sentence and the intent tag based on the element weights and the similarity index;

[0113] Intent Analysis Module: This module comprehensively analyzes the correlation index between all the dialogue sentences and the intent tags to obtain the character's intent.

[0114] In one embodiment, the computing module includes:

[0115] The tag selection submodule selects intent tags related to the dialogue scenario as candidate tags.

[0116] Matching submodule: Matches the intent keywords corresponding to the candidate tags with the element words according to the element attributes to obtain calculated word pairs;

[0117] The similarity index calculation module calls the synonyms.compare function to process the word pairs and obtain the similarity index.

[0118] The submodule for calculating the correlation index calculates the correlation index between the dialogue sentence and the intent tag based on the element weights. The calculation process is as follows:

[0119] conection=(ts×timeW+as×addressW+ps×personW+es×eventW)×10,

[0120] Wherein, connection is the association index, ts is the similarity index between the time element and the corresponding time keyword, as is the similarity index between the location element and the location keyword, ps is the similarity index between the person element and the person keyword, es is the similarity index between the event element and the event keyword, timeW is the weight of the time element, addressW is the weight of the location element, personW is the weight of the person element, and eventW is the weight of the event element.

[0121] The tag determination submodule selects the candidate tag with the highest correlation index as the sentence intent tag.

[0122] Specifically, several candidate tags have been selected based on the dialogue scenario. Each candidate tag corresponds to four intent keywords. The similarity between element words and intent keywords is calculated, and then the association index between the intent tag and the dialogue sentence is calculated based on the weight. The method of selecting candidate tags is based on the degree of association between the intent tag and the dialogue scenario. For example, if the dialogue scenario is customs, the intent keywords with a high degree of association are: travel, study abroad, trade, purchasing agent, and investment. The intent keywords corresponding to purchasing agent are: merchant, March, South Korea, and travel. The intent keywords corresponding to investment are: villager, February, abroad, and working. The element words of the dialogue sentence are: March, South Korea, and tourism. The character element words are empty. When calculating the similarity between the element words in the time and space, the association index between the element words and the dialogue sentence is calculated. The similarity index between the corresponding intent keywords is 1; the calculation process is as follows: ts = synonyms.compare('March', 'March') = 1, as = synonyms.compare('Korea', 'Korea') = 1, ps = 1, es = synonyms.compare('tourism', 'travel') = 0.88, similarity index connection = (1×3 + 1×3 + 1×1 + 0.88×3)×10 = 96.4; the similarity index between the keyword and the intent keyword "investment" is calculated in the same way and is 44.97; therefore, it can be preliminarily determined that the intention of the person in the dialogue sentence is "personal shopping agent".

[0123] In summary, the present invention possesses the excellent characteristics described above, which enhances its effectiveness in use compared to previous technologies, making it a highly practical product.

[0124] The above description is only a preferred embodiment of the present invention. For those skilled in the art, there will be changes in the specific implementation and application scope based on the ideas of the present invention. The content of this specification should not be construed as a limitation of the present invention.

Claims

1. An intent recognition method based on semantic elements, characterized in that, include: Preparation steps: Set intent tags, intent keywords, and element weights according to the dialogue scenario and the dialogue partner; Element extraction steps: Extract element words corresponding to time elements, location elements, character elements, and event elements from dialogue sentences; Calculation steps: Calculate the similarity index between the element word and the intent keyword, and calculate the association index between the dialogue sentence and the intent tag based on the element weight and the similarity index; Intent analysis steps: Comprehensively analyze the correlation index between all the dialogue sentences and the intent tags to obtain the character's intent; The method for setting the element weights includes fixed setting and dynamic setting. The fixed setting method is manual setting, and the dynamic setting method includes: The sub-step for calculating the time sensitivity value is as follows: The time sensitivity value is obtained based on the similarity between the time element and the working time, expressed by the formula: , Where tsens is the time-sensitive value, and time is the time element; The sub-step for calculating the location sensitivity value is as follows: Search for the location and the dialogue scenario separately through a predetermined search engine to obtain the number of location results and the number of dialogue scenario results, and then calculate the average number of results. Then input the location and the dialogue scenario together into the predetermined search engine to obtain the number of combined results. Calculate the ratio of the number of combined results to the average number of results to obtain the location sensitivity value. The sub-step for calculating the character sensitivity value is as follows: classify the characters that appear in the dialogue scene according to their age and occupation to obtain the character categories, and calculate the proportion of each character category to obtain the character sensitivity value. The sub-step for calculating the event sensitivity value is as follows: Calculate the ratio of the number of times the event occurs in the dialogue scenario to the number of times all other events occur to obtain the event sensitivity value; The weight calculation sub-step involves calculating the ratio between the time sensitivity value, the location sensitivity value, the person sensitivity value, and the event sensitivity value, and then multiplying the ratio by 10 to obtain the element weight.

2. The semantic element-based intent recognition method according to claim 1, characterized in that, The element weights are expressed by the formula: Wherein, timeW is the weight of the time element, addressW is the weight of the location element, personW is the weight of the person element, and eventW is the weight of the event element.

3. The semantic element-based intent recognition method according to claim 1, characterized in that, The calculation steps include: The tag selection sub-step involves selecting intent tags related to the dialogue scenario as candidate tags. Matching sub-step: Match the intent keywords corresponding to the candidate tags with the element words according to the element attributes to obtain calculated word pairs; Steps for calculating the similarity index: Call the synonyms.compare function to process the word pairs and obtain the similarity index; The sub-step for calculating the association index is as follows: The association index between the dialogue sentence and the intent tag is calculated based on the element weights. The calculation process is as follows: , Wherein, connection is the association index, ts is the similarity index between the time element and the corresponding time keyword, as is the similarity index between the location element and the location keyword, ps is the similarity index between the person element and the person keyword, es is the similarity index between the event element and the event keyword, timeW is the weight of the time element, addressW is the weight of the location element, personW is the weight of the person element, and eventW is the weight of the event element. The tag determination sub-step is to select the candidate tag with the highest correlation index as the sentence intent tag.

4. The semantic element-based intent recognition method according to claim 1, characterized in that, The intent analysis steps include: Consistency calculation step: Calculate the consistency index of the sentence intent label corresponding to the dialogue sentence; Error removal step: Delete the sentence intent tags that have a consistency index below a predetermined threshold; Intent determination step: Obtain the character's intent based on the remaining sentence intent tags.

5. The semantic element-based intent recognition method according to claim 1, characterized in that, The feature extraction steps include: Analysis sub-step: The dialogue sentence is segmented and semantically analyzed using pre-trained LTP4.0 to obtain the element words; Verification sub-step: Query the set of pre-set verification words to find verification words that match the element words, and determine whether the element attributes of the verification words are consistent with the element attributes of the element words. If they are consistent, the element extraction step is considered complete; otherwise, the analysis sub-step is performed again.

6. The semantic element-based intent recognition method according to claim 5, characterized in that, The training process of LTP4.0 includes: The dialogue set organization step is to classify the dialogue sentences into different scenario dialogue sentence sets according to the scenario. The element annotation process involves manually annotating the dialogue sentences with time, location, characters, and events. Adjusting node weights: The LTP4.0 is used to process the dialogue sentence to obtain the processing result. The processing result is compared with the manually annotated result to obtain the comparison result. The weights of the nodes in LTP4.0 are adjusted according to the comparison result. Model verification steps: When the comparison results reach the predetermined accuracy, determine that the current weight values ​​of each node in the model are the most suitable values, and determine that the model training is complete.

7. The semantic element-based intent recognition method according to claim 6, characterized in that, In the preparation step, the dialogue scenario, the intent tag, and the intent keyword are stored together in the database. Taking the dialogue scenario as an object, the data structure is represented as follows: , Here, context is the dialogue scenario, tagA, tagB, tagC...tagN are intent tags, and k is the intent keyword, with its subscript used to distinguish the corresponding intent tag.

8. A semantic element-based intent recognition system, employing the semantic element-based intent recognition method according to any one of claims 1-7, characterized in that, include: Preparation module: Set intent tags, intent keywords, and element weights based on the dialogue scenario and dialogue partners; Element extraction module: Extracts element words corresponding to time elements, location elements, character elements, and event elements from dialogue sentences; Calculation module: Calculates the similarity index between the element words and the intent keywords, and calculates the association index between the dialogue sentence and the intent tag based on the element weights and the similarity index; Intent Analysis Module: This module comprehensively analyzes the correlation index between all the dialogue sentences and the intent tags to obtain the character's intent.

9. The semantic element-based intent recognition system according to claim 8, characterized in that, The computing module includes: The tag selection submodule selects intent tags related to the dialogue scenario as candidate tags. Matching submodule: Matches the intent keywords corresponding to the candidate tags with the element words according to the element attributes to obtain calculated word pairs; The similarity index calculation module calls the synonyms.compare function to process the word pairs and obtain the similarity index. The submodule for calculating the correlation index calculates the correlation index between the dialogue sentence and the intent tag based on the element weights. The calculation process is as follows: , Wherein, connection is the association index, ts is the similarity index between the time element and the corresponding time keyword, as is the similarity index between the location element and the location keyword, ps is the similarity index between the person element and the person keyword, es is the similarity index between the event element and the event keyword, timeW is the weight of the time element, addressW is the weight of the location element, personW is the weight of the person element, and eventW is the weight of the event element. The tag determination submodule selects the candidate tag with the highest correlation index as the sentence intent tag.