Word segmentation method and device, intention triggering method and device, and readable storage medium
By classifying the proprietary words in the custom dictionary and building a custom dictionary, the problem of word segmentation tools in the enterprise service field being highly dependent on professional knowledge is solved, the recognition accuracy and scope of application of the word segmentation tools are improved, and the use of proprietary words is realized. Efficient vocabulary recognition and accuracy of word segmentation results.
Patent Information
- Application Number
- CN202111129412.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-26
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-09-26
AI Technical Summary
Existing word segmentation tools in the enterprise service field rely heavily on professional knowledge, have a small scope of applicable scenarios, and are not accurate enough in identifying proprietary vocabulary, resulting in keywords that cannot be successfully positioned.
Divide the proprietary vocabulary in the custom dictionary into two categories: basic vocabulary and user-related proprietary vocabulary. Build a custom dictionary and word segmentation by preloading basic vocabulary and dynamically loading user-related proprietary vocabulary into the word segmentation thesaurus. Thesaurus improves the recognition accuracy and scope of application of word segmentation tools.
It improves the accuracy of word segmentation results and the reliability of word segmentation tools, expands the scope of application of word segmentation tools, and ensures efficient and accurate identification of proprietary vocabulary.
Smart Images

Figure CN113919343B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of word segmentation, and in particular to a word segmentation method and device, an intention triggering method and device, and a readable storage medium. Background Art
[0002] Currently, word segmentation tools targeting the enterprise service sector face major challenges.
[0003] On the one hand, word segmentation tools for enterprise services are highly dependent on professional knowledge. For enterprises in different industries, word segmentation tools all require the support of professional knowledge in related fields. On the other hand, existing word segmentation tools are mostly built based on language materials such as People's Daily, and their applicability to scenarios of enterprise services with broad business functions is low, especially the recognition of proprietary vocabulary is not accurate enough, which leads to incorrect word segmentation results and makes it impossible to successfully locate keywords.
[0004] Therefore, existing word segmentation tools for the enterprise service field are highly dependent on professional knowledge, have a small range of applicable scenarios, and are not accurate enough in identifying and segmenting proprietary vocabulary, which leads to problems such as the inability to locate keywords. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0006] To this end, the first aspect of the present invention proposes a word segmentation method.
[0007] A second aspect of the present invention provides a word segmentation device.
[0008] The third aspect of the present invention provides an intention triggering method.
[0009] A fourth aspect of the present invention provides an intention triggering device.
[0010] A fifth aspect of the present invention provides a readable storage medium.
[0011] In view of this, a first aspect of the present invention provides a word segmentation method, comprising: loading a first category of proprietary vocabulary in a custom dictionary into a basic dictionary to construct a word segmentation vocabulary library; performing a first word segmentation on user input information according to the word segmentation vocabulary library to obtain a first word segmentation result; loading a second category of proprietary vocabulary in the custom dictionary into the word segmentation vocabulary library, identifying a first word segmentation term in the first word segmentation result according to the word segmentation vocabulary library to obtain a second word segmentation result; performing part-of-speech tagging on a second word segmentation term in the second word segmentation result to obtain a third word segmentation result; wherein the first category of proprietary vocabulary is a basic vocabulary, and the second category of proprietary vocabulary is a proprietary vocabulary related to the user.
[0012] The word segmentation method provided by the present invention first loads the first category of proprietary vocabulary in the custom dictionary into the basic dictionary to construct a word segmentation vocabulary library, and then performs the first word segmentation on the user input information according to the word segmentation vocabulary library to obtain the first word segmentation result, and then loads the second category of proprietary vocabulary in the custom dictionary into the word segmentation vocabulary library, and identifies the first word segmentation words in the first word segmentation result according to the new word segmentation vocabulary library to obtain the second word segmentation result, and finally performs part-of-speech tagging on the second word segmentation words in the second word segmentation result to obtain the third word segmentation result. Among them, the first category of proprietary vocabulary is the basic vocabulary, and the second category of proprietary vocabulary is the proprietary vocabulary related to the user. The word segmentation method proposed by the present invention divides the proprietary vocabulary into two categories: basic vocabulary and proprietary vocabulary related to the user, and constructs a custom dictionary based on these two categories of vocabulary. In this way, the scope of application of the word segmentation tool is expanded, the problem that the word segmentation tool is highly dependent on professional knowledge is solved, and the use scenarios of the word segmentation tool are increased. During the word segmentation process, by preloading basic vocabulary into the word segmentation vocabulary and dynamically loading user-related proprietary vocabulary into the word segmentation vocabulary, the word segmentation tool can recognize proprietary vocabulary more efficiently and accurately, thereby solving the problem of being unable to locate keywords due to incorrect segmentation of proprietary vocabulary, improving the accuracy of the word segmentation results, and improving the reliability of the word segmentation tool.
[0013] The word segmentation method provided by the present invention may also include: building a custom dictionary based on proprietary vocabulary. Among them, proprietary vocabulary can be divided into product-level vocabulary, industry-level vocabulary and user-level vocabulary, the first category of proprietary vocabulary includes product-level vocabulary and industry-level words, and the first category of proprietary vocabulary includes user-level vocabulary. Specifically, product structured data such as menus, services, business processes, metadata, UI metadata, and operations are collected from product prefabricated data, and industry terms are extracted from unstructured data such as help documents, requirement documents, and operation documents to establish product-level vocabulary such as service names, attribute names, operation names, and process names. Unstructured data is crawled from the network to collect industry terms in various fields to establish industry-level vocabulary in the fields of finance, human resources, supply chain, assets, and manufacturing. Organization names, department names, material names, supplier names, customer names, and bank file names are collected from the user's basic files to establish user-level professional vocabulary. In this way, the word range of the custom dictionary is increased, the scope of application of the word segmentation tool is expanded, the use scenarios of the word segmentation tool are increased, and the reliability of the word segmentation tool is improved. At the same time, during the word segmentation process, by preloading industry-level proprietary words and product-level proprietary words into the word segmentation vocabulary and dynamically loading user-level proprietary words into the word segmentation vocabulary, the word segmentation tool can recognize proprietary words more efficiently and accurately, thereby improving the accuracy of the word segmentation results and the reliability of the word segmentation tool.
[0014] Specifically, when dynamically loading user-level proprietary vocabulary, the redis database is used to store user-level proprietary vocabulary. In this way, it can ensure that user-level proprietary vocabulary can be quickly acquired and dynamically loaded into the word segmentation vocabulary, ensuring the efficiency and accuracy of the word segmentation tool in identifying proprietary vocabulary, thereby further improving the overall performance of the word segmentation tool and ensuring the reliability of the word segmentation tool.
[0015] Furthermore, the word segmentation method provided by the present invention may also include: updating the custom dictionary based on the update of the proprietary vocabulary. The word segmentation method provided by the present invention, when the proprietary vocabulary is updated, updates the custom dictionary according to the update of the proprietary vocabulary. In this way, the timely update of the custom dictionary can be guaranteed, and the scope of application and usage scenarios of the word segmentation tool can be further guaranteed, thereby further ensuring the reliability of the word segmentation tool.
[0016] Therefore, the word segmentation method provided by the present invention expands the word range of the word segmentation vocabulary by collecting various types of proprietary words to construct a custom dictionary and then construct a word segmentation vocabulary library, thereby solving the problem that the word segmentation tool is highly dependent on professional knowledge, expanding the scope of application of the word segmentation tool, and increasing the usage scenarios of the word segmentation tool. By combining pre-loading basic words into the word segmentation vocabulary library and dynamically loading proprietary words related to the user into the word segmentation vocabulary library, the word segmentation tool can recognize proprietary words more efficiently and accurately, thereby improving the accuracy of the word segmentation results and improving the reliability of the word segmentation tool.
[0017] In addition, the word segmentation method in the above technical solution provided by the present invention may also have the following additional technical features:
[0018] In the above technical solution, after the step of identifying the first segmentation words in the first segmentation result and before the step of obtaining the second segmentation result, it also includes: in the index mode, segmenting the first segmentation words whose length is greater than the preset threshold.
[0019] In this technical solution, after the user input information is segmented for the first time and the first segmentation result is identified, the first segmentation words whose length is greater than a preset threshold are segmented again in the index mode. In this way, the accuracy of the segmentation result is further improved, and the reliability of the segmentation tool is improved.
[0020] Specifically, the preset threshold may be 3, and in index mode, the first segmented words with a length greater than 3 are segmented again.
[0021] In any of the above technical solutions, the step of performing part-of-speech tagging on the second participial words in the second participial result to obtain the third participial result specifically includes: in the part-of-speech tagging mode, performing part-of-speech tagging on the second participial words in the second participial result according to the hidden Markov model; or in the part-of-speech tagging mode, marking the second participial words as regular parts of speech.
[0022] In this technical solution, when the part-of-speech tagging mode is turned on, the second participle words in the second participle result are tagged with part-of-speech according to the hidden Markov model. The hidden Markov model is a statistical model composed of a hidden state, an observable state, an initial state probability matrix, a hidden state probability transfer matrix, and an observable value transfer matrix. The hidden Markov model increases the scope of pattern observation by introducing a hidden state. The second participle words in the second participle result are tagged with part-of-speech according to the hidden Markov model, which ensures the accuracy of the part-of-speech tagging, thereby improving the accuracy of the word segmentation results and enhancing the reliability of the word segmentation tool.
[0023] The second aspect of the present invention provides a word segmentation device, including: a construction unit, which is used to load a first category of proprietary vocabulary in a custom dictionary into a basic dictionary to construct a word segmentation vocabulary library; a processing unit, which is used to perform a first word segmentation on user input information according to the word segmentation vocabulary library to obtain a first word segmentation result; the processing unit is also used to load a second category of proprietary vocabulary in the custom dictionary into the word segmentation vocabulary library, and identify the first word segmentation words in the first word segmentation result according to the word segmentation vocabulary library to obtain a second word segmentation result; the processing unit is also used to perform part-of-speech tagging on the second word segmentation words in the second word segmentation result to obtain a third word segmentation result; wherein the first category of proprietary vocabulary is a basic vocabulary, and the second category of proprietary vocabulary is a proprietary vocabulary related to the user.
[0024] The word segmentation device provided by the present invention first loads the first category of proprietary vocabulary in the custom dictionary into the basic dictionary through a construction unit to construct a word segmentation vocabulary library, and then performs the first word segmentation on the user input information according to the word segmentation vocabulary library through a processing unit to obtain a first word segmentation result, and then loads the second category of proprietary vocabulary in the custom dictionary into the word segmentation vocabulary library through a processing unit, and identifies the first word segmentation words in the first word segmentation result according to the new word segmentation vocabulary library to obtain a second word segmentation result, and finally performs part-of-speech tagging on the second word segmentation words in the second word segmentation result through a processing unit to obtain a third word segmentation result. Among them, the first category of proprietary vocabulary is basic vocabulary, and the second category of proprietary vocabulary is proprietary vocabulary related to the user. The word segmentation device proposed by the present invention divides proprietary vocabulary into two categories: basic vocabulary and proprietary vocabulary related to the user, and constructs a custom dictionary based on these two categories of vocabulary through a construction unit, thus expanding the scope of application of the word segmentation tool and increasing the usage scenarios of the word segmentation tool. During the word segmentation process, by preloading basic vocabulary into the word segmentation vocabulary and dynamically loading user-related proprietary vocabulary into the word segmentation vocabulary, the word segmentation tool can recognize proprietary vocabulary more efficiently and accurately, thereby improving the accuracy of the word segmentation results and the reliability of the word segmentation tool.
[0025] The word segmentation device provided by the present invention, the construction unit can also be used to build a custom dictionary based on proprietary vocabulary. Among them, the proprietary vocabulary can be divided into product-level vocabulary, industry-level vocabulary and user-level vocabulary, the first category of proprietary vocabulary includes product-level vocabulary and industry-level words, and the first category of proprietary vocabulary includes user-level vocabulary. Specifically, product structured data such as menus, services, business processes, metadata, UI metadata, operations, etc. are collected from product prefabricated data, and industry terms are extracted from unstructured data such as help documents, requirement documents, and operation documents to establish product-level vocabulary such as service names, attribute names, operation names, and process names. Unstructured data is crawled from the network to collect industry terms in various fields to establish industry-level vocabulary in the fields of finance, human resources, supply chain, assets, manufacturing, etc. The organization name, department name, material name, supplier name, customer name, and bank file name are collected from the user's basic files to establish user-level professional vocabulary. In this way, the scope of words in the custom dictionary is increased, the scope of application of the word segmentation tool is expanded, the use scenarios of the word segmentation tool are increased, and the reliability of the word segmentation tool is improved. At the same time, during the word segmentation process, industry-level proprietary vocabulary and product-level proprietary vocabulary are pre-loaded into the word segmentation vocabulary through the construction unit, and user-level proprietary vocabulary is dynamically loaded into the word segmentation vocabulary through the processing unit, making the word segmentation tool's recognition of proprietary vocabulary more efficient and accurate, thereby improving the accuracy of the word segmentation results and improving the reliability of the word segmentation tool.
[0026] Specifically, when dynamically loading user-level proprietary vocabulary, the redis database is used to store user-level proprietary vocabulary. In this way, the processing unit can quickly obtain and dynamically load user-level proprietary vocabulary into the word segmentation vocabulary, ensuring the efficiency and accuracy of the word segmentation tool in identifying proprietary vocabulary, thereby further improving the overall performance of the word segmentation tool and ensuring the reliability of the word segmentation tool.
[0027] Furthermore, in the word segmentation device provided by the present invention, the construction unit can also be used to update the custom dictionary based on the update of the proprietary vocabulary. In the word segmentation device provided by the present invention, when the proprietary vocabulary is updated, the custom dictionary is updated according to the update of the proprietary vocabulary. In this way, the timely update of the custom dictionary can be guaranteed, and the scope of application and usage scenarios of the word segmentation tool can be further guaranteed, thereby further ensuring the reliability of the word segmentation tool.
[0028] Therefore, the word segmentation device provided by the present invention collects various proprietary words through a construction unit to construct a custom dictionary and then construct a word segmentation vocabulary, thereby expanding the word range of the word segmentation vocabulary, thereby solving the problem that the word segmentation tool is highly dependent on professional knowledge, expanding the scope of application of the word segmentation tool, and increasing the usage scenarios of the word segmentation tool. The processing unit combines pre-loading basic words into the word segmentation vocabulary and dynamically loading user-related proprietary words into the word segmentation vocabulary, making the word segmentation tool more efficient and accurate in recognizing proprietary words, thereby improving the accuracy of the word segmentation results and improving the reliability of the word segmentation tool.
[0029] The third aspect of the present invention provides an intent triggering method, comprising: constructing a keyword dictionary tree based on keywords of at least one intent information; receiving conversation information input by a user, and performing word segmentation processing on the conversation information according to the word segmentation method of any of the above technical solutions to obtain a word segmentation result; matching the word segmentation result with the keyword dictionary tree to determine a target intent of at least one intent information; and executing at least one intent information according to the target intent.
[0030] The intention triggering method proposed in the present invention first constructs a keyword dictionary tree based on the keywords of at least one intention information, then receives the dialogue information input by the user, and performs word segmentation processing on the dialogue information according to the word segmentation method in any of the above technical solutions to obtain a word segmentation result, and then matches the word segmentation result with the keyword dictionary tree to determine the target intent of at least one intention information, and finally executes at least one intention information according to the target intent. In this way, the scope of application of the word segmentation tool is expanded, and the problem of low applicability of general word segmentation tools to enterprise service scenarios with broad business functions is solved. The proprietary vocabulary of the enterprise dialogue scenario can be identified, thereby improving the accuracy of the word segmentation results, improving the accuracy and speed of user intent matching, and ensuring the accuracy of user intent triggering.
[0031] Furthermore, the intention triggering method proposed in the present invention performs word segmentation processing on the dialogue information according to the word segmentation method in any of the above technical solutions. Therefore, the intention triggering method proposed in the present invention has all the beneficial effects of the word segmentation method in any of the above technical solutions, which will not be repeated here.
[0032] In addition, the word segmentation method in the above technical solution provided by the present invention may also have the following additional technical features:
[0033] In the above technical solution, the step of matching the word segmentation result with the keyword dictionary tree to determine the target intent of at least one intent information specifically includes: performing keyword recognition on the dialogue information input by the user, and determining a first trigger condition list according to a first recognition result of the keyword recognition; performing part-of-speech recognition on the word segmentation result and the keyword dictionary tree, and determining a second trigger condition list according to a second recognition result of the part-of-speech recognition; obtaining trigger condition information from the first trigger condition list and the second trigger condition list; and performing a keyword trigger judgment process and a part-of-speech trigger judgment process on the word segmentation result and the keyword dictionary tree in turn according to the trigger condition information to determine the target intent that meets the judgment conditions.
[0034] In this technical solution, when matching the word segmentation result with the keyword dictionary tree, the conversation information input by the user is firstly subjected to keyword recognition, and a first trigger condition list is determined according to a first recognition result of the keyword recognition, and then part-of-speech recognition is performed on the word segmentation result and the keyword dictionary tree, and a second trigger condition list is determined according to a second recognition result of the part-of-speech recognition. In this way, the matching of the word segmentation result and the keyword dictionary tree is divided into two aspects: keyword matching and part-of-speech matching, so that the intention trigger supports two triggering modes: trigger words and trigger sentences, which improves the flexibility of the intention triggering mode and further ensures the accuracy of the user intention matching.
[0035] Furthermore, in this technical solution, by obtaining trigger condition information from the first trigger condition list and the second trigger condition list, and according to the trigger condition information, the keyword trigger judgment process and the part-of-speech trigger judgment process are sequentially performed on the word segmentation result and the keyword dictionary tree to determine the target intent that meets the judgment condition. The word segmentation result and the keyword dictionary tree are matched through the keyword trigger judgment process and the part-of-speech trigger judgment process, and the keyword trigger judgment process and the part-of-speech trigger judgment process are both provided with a variety of matching rules, thus ensuring the flexibility and accuracy of the matching between the word segmentation result and the keyword dictionary tree, thereby improving the accuracy of the intent trigger.
[0036] In any of the above technical solutions, the keyword trigger judgment process includes: judging whether the word segmentation result contains all the keywords in the keyword phrase of the keyword dictionary tree, if not, it is considered that the match has failed, if so, entering the first judgment process; the first judgment process includes: judging whether the word segmentation result contains the keywords in any sub-keyword phrase of the keyword phrase of the keyword dictionary tree, if so, it is considered that the match is successful, and the target intent is determined according to the intent information corresponding to the keyword dictionary tree, if not, entering the second judgment process; the second judgment process includes: judging whether the word segmentation result contains words in any non-keyword phrase of the keyword phrase of the keyword dictionary tree, if so, it is considered that the match has failed, if not, entering the third judgment process; the third judgment process includes: judging whether the word segmentation result contains all the keywords in the approximate keyword phrase of the keyword phrase of the keyword dictionary tree, if so, it is considered that the match has failed, if not, entering the part-of-speech trigger judgment process.
[0037] In this technical solution, the matching of word segmentation results with the keyword dictionary tree is divided into two stages: keyword matching and part-of-speech matching. In the keyword matching stage, multiple matching rules are set to ensure the flexibility and accuracy of keyword matching, thereby ensuring the flexibility and accuracy of word segmentation result matching and improving the accuracy of intent triggering.
[0038] Specifically, first, determine whether the word segmentation result contains all the keywords in the keyword phrase of the keyword dictionary tree. If there are keywords in the above keyword phrase that are not in the word segmentation result, it is determined that the current match has failed and the next matching process is performed. If all the keywords in the above keyword phrase are in the word segmentation result, continue to determine whether the word segmentation result contains keywords in any sub-keyword phrase of the keyword phrase of the keyword dictionary tree. If so, it is considered that the current match is successful, and then the target intent is determined according to the intent information corresponding to the keyword dictionary tree. If not, continue to determine whether the word segmentation result contains words in any non-keyword phrase of the keyword phrase of the keyword dictionary tree, that is, determine whether the word segmentation result contains keywords that are not in the keyword dictionary tree. If so, it is considered that the current match has failed and the next matching process is performed. If not, continue to determine whether the word segmentation result contains all the keywords in the approximate keyword phrase of the keyword phrase of the keyword dictionary tree, that is, determine whether the conversation information corresponding to the word segmentation result and the intent information corresponding to the keyword dictionary tree are similar information. If so, it is considered that the current match has failed and the next matching process is performed. If not, enter the part-of-speech trigger judgment process. In this way, through the mutual cooperation of multiple matching rules, the flexibility and accuracy of word segmentation result matching are guaranteed, thereby improving the accuracy of intent triggering.
[0039] In any of the above technical solutions, the part-of-speech trigger judgment process includes: judging whether the part-of-speech of the segmented words in the segmentation result matches the part-of-speech of the keywords in the keyword dictionary tree, if not, it is considered that the match fails, if so, entering the fourth judgment process; the fourth judgment process includes: judging whether the segmented words and keywords with matching parts of speech match, if so, it is considered that the match is successful, and the target intent is determined according to the intent information corresponding to the keyword dictionary tree, if not, it is considered that the match fails; wherein, judging whether the part-of-speech of the segmented words in the segmentation result matches the part-of-speech of the keywords in the keyword dictionary tree includes three matching rules: combined part-of-speech matching judgment, noun part-of-speech matching judgment, and verb part-of-speech matching judgment.
[0040] In this technical solution, the matching of word segmentation results with the keyword dictionary tree is divided into two stages: keyword matching and part-of-speech matching. In the part-of-speech matching stage, multiple matching rules are set to ensure the flexibility and accuracy of part-of-speech matching, thereby ensuring the flexibility and accuracy of word segmentation result matching and improving the accuracy of intent triggering.
[0041] Specifically, first, judge whether the part of speech of the segmented words in the segmentation results matches the part of speech of the keywords in the keyword dictionary tree from three aspects: combined part of speech, noun part of speech and verb part of speech. If not, it is considered that the match has failed and the next matching process is carried out. If so, enter the fourth judgment process. Further, the fourth judgment process is: judge whether the segmented words with matching parts of speech and keywords match. If so, it is considered that the match is successful, and the target intent is determined according to the intent information corresponding to the keyword dictionary tree. If not, it is considered that the match has failed and the next matching process is carried out. In this way, through the mutual cooperation of multiple matching rules, the flexibility and accuracy of the segmentation result matching are guaranteed, thereby improving the accuracy of intent triggering.
[0042] The fourth aspect of the present invention provides an intention triggering device, comprising: a construction unit, used to construct a keyword dictionary tree based on keywords of at least one intent information; a word segmentation unit, used to receive dialogue information input by a user, and perform word segmentation processing on the dialogue information according to the word segmentation method in any of the above technical solutions to obtain a word segmentation result; a matching unit, used to match the word segmentation result with the keyword dictionary tree to determine the target intent of at least one intent information; and an execution unit, used to execute at least one intent information according to the target intent.
[0043] The intention triggering device proposed in the present invention first constructs a keyword dictionary tree according to the keywords of at least one intention information through a construction unit, then receives the dialogue information input by the user through a word segmentation unit, and performs word segmentation processing on the dialogue information according to the word segmentation method in any of the above technical solutions to obtain a word segmentation result, and then matches the word segmentation result with the keyword dictionary tree through a matching unit to determine the target intent of at least one intention information, and finally executes at least one intention information according to the target intent through an execution unit. In this way, the scope of application of the word segmentation tool is expanded, and the problem of low applicability of general word segmentation tools to enterprise service scenarios with broad business functions is solved. The proprietary vocabulary of the enterprise dialogue scenario can be identified, thereby improving the accuracy of the word segmentation results, improving the accuracy and speed of user intention matching, and ensuring the accuracy of user intention triggering.
[0044] Furthermore, the intention triggering device proposed in the present invention performs word segmentation processing on the dialogue information through the word segmentation unit according to the word segmentation method in any of the above technical solutions. Therefore, the intention triggering device proposed in the present invention has all the beneficial effects of the word segmentation method in any of the above technical solutions, which will not be repeated here.
[0045] The fifth aspect of the present invention provides a readable storage medium having a program stored thereon, and when the program is executed by a processor, the steps of the word segmentation method in any of the above technical solutions are implemented. Therefore, the readable storage medium proposed by the present invention can achieve all the beneficial effects of the word segmentation method in any of the above technical solutions, which will not be repeated here.
[0046] Furthermore, the readable storage medium proposed by the present invention stores a program thereon, and when the program is executed by the processor, the steps of the intention triggering method in any of the above technical solutions are implemented. Therefore, the readable storage medium proposed by the present invention can achieve all the beneficial effects of the intention triggering method in any of the above technical solutions, which will not be repeated here.
[0047] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0049] Figure 1 One of the flowcharts of the word segmentation method according to an embodiment of the present invention is shown;
[0050] Figure 2 A second flow chart of a word segmentation method according to an embodiment of the present invention is shown;
[0051] Figure 3 A third flowchart diagram of a word segmentation method according to an embodiment of the present invention is shown;
[0052] Figure 4 A fourth flowchart diagram of a word segmentation method according to an embodiment of the present invention is shown;
[0053] Figure 5 A structural block diagram of a word segmentation device according to an embodiment of the present invention is shown;
[0054] Figure 6 One of the flowcharts of the intention triggering method according to an embodiment of the present invention is shown;
[0055] Figure 7 A second flowchart of an intention triggering method according to an embodiment of the present invention is shown;
[0056] Figure 8 A schematic diagram showing a keyword triggering judgment process and a part-of-speech triggering judgment process in an intention triggering method according to an embodiment of the present invention;
[0057] Fig. 9 A structural block diagram of an intention triggering device according to an embodiment of the present invention is shown;
[0058] Fig.10 A schematic flow chart of a word segmentation method according to a specific embodiment of the present invention is shown. DETAILED DESCRIPTION
[0059] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0060] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0061] Refer to the following Figures 1 to 10 The present invention describes a word segmentation method and device thereof, an intention triggering method and device thereof, and a readable storage medium proposed according to some embodiments of the present invention.
[0062] Example 1
[0063] The first aspect of the present invention provides a word segmentation method. In one embodiment of the present invention, Figure 1 As shown, the present invention provides a word segmentation method, comprising:
[0064] Step S102, loading the first category of proprietary vocabulary in the custom dictionary into the basic dictionary to construct a word segmentation vocabulary;
[0065] Step S104, performing a first word segmentation on the user input information according to the word segmentation word library to obtain a first word segmentation result;
[0066] Step S106, loading the second category of proprietary vocabulary in the custom dictionary into the word segmentation word library, and identifying the first word segmentation words in the first word segmentation result according to the word segmentation word library to obtain a second word segmentation result;
[0067] Step S108, performing part-of-speech tagging on the second segmentation words in the second segmentation result to obtain a third segmentation result;
[0068] Among them, the first category of proprietary vocabulary is basic vocabulary, and the second category of proprietary vocabulary is user-related proprietary vocabulary.
[0069] The word segmentation method provided in this embodiment first loads the first category of proprietary vocabulary in the custom dictionary into the basic dictionary to construct a word segmentation vocabulary library, and then performs the first word segmentation on the user input information according to the word segmentation vocabulary library to obtain the first word segmentation result, and then loads the second category of proprietary vocabulary in the custom dictionary into the word segmentation vocabulary library, and identifies the first word segmentation words in the first word segmentation result according to the new word segmentation vocabulary library to obtain the second word segmentation result, and finally performs part-of-speech tagging on the second word segmentation words in the second word segmentation result to obtain the third word segmentation result. Among them, the first category of proprietary vocabulary is the basic vocabulary, and the second category of proprietary vocabulary is the proprietary vocabulary related to the user. The word segmentation method proposed in this embodiment divides the proprietary vocabulary into two categories: basic vocabulary and user-related proprietary vocabulary, and constructs a custom dictionary based on these two categories of vocabulary. In this way, the scope of application of the word segmentation tool is expanded, the problem that the word segmentation tool is highly dependent on professional knowledge is solved, and the usage scenarios of the word segmentation tool are increased. During the word segmentation process, by preloading basic vocabulary into the word segmentation vocabulary and dynamically loading user-related proprietary vocabulary into the word segmentation vocabulary, the word segmentation tool can recognize proprietary vocabulary more efficiently and accurately, thereby solving the problem of being unable to locate keywords due to incorrect segmentation of proprietary vocabulary, improving the accuracy of the word segmentation results, and improving the reliability of the word segmentation tool.
[0070] Furthermore, the word segmentation method provided in this embodiment may also include: constructing a custom dictionary based on proprietary vocabulary. The proprietary vocabulary can be divided into product-level vocabulary, industry-level vocabulary and user-level vocabulary, the first category of proprietary vocabulary includes product-level vocabulary and industry-level vocabulary, and the first category of proprietary vocabulary includes user-level vocabulary.
[0071] In a specific embodiment, product structured data such as menus, services, business processes, metadata, UI metadata, and operations are collected from product prefabricated data, and industry terms are extracted from unstructured data such as help documents, demand documents, and operation documents to establish product-level vocabulary such as service names, attribute names, operation names, and process names. Unstructured data is crawled from the network to collect industry terms in various fields to establish industry-level vocabulary in the fields of finance, human resources, supply chain, assets, and manufacturing. Organization names, department names, material names, supplier names, customer names, and bank file names are collected from the user's basic files to establish user-level professional vocabulary. In this way, the word range of the custom dictionary is increased, the scope of application of the word segmentation tool is expanded, the use scenarios of the word segmentation tool are increased, and the reliability of the word segmentation tool is improved. At the same time, in the word segmentation process, by preloading industry-level proprietary vocabulary and product-level proprietary vocabulary into the word segmentation vocabulary and dynamically loading user-level proprietary vocabulary into the word segmentation vocabulary, the word segmentation tool can recognize proprietary vocabulary more efficiently and accurately, thereby improving the accuracy of the word segmentation results and the reliability of the word segmentation tool.
[0072] In a specific embodiment, when dynamically loading user-level proprietary vocabulary, a redis database is used to store user-level proprietary vocabulary. In this way, it is possible to quickly obtain and dynamically load user-level proprietary vocabulary into the word segmentation vocabulary library, thereby ensuring the efficiency and accuracy of the word segmentation tool in identifying proprietary vocabulary, thereby further improving the overall performance of the word segmentation tool and ensuring the reliability of the word segmentation tool.
[0073] Furthermore, the word segmentation method provided in this embodiment may also include: updating the custom dictionary based on the update of the proprietary vocabulary. The word segmentation method provided in this embodiment, when the proprietary vocabulary is updated, updates the custom dictionary according to the update of the proprietary vocabulary. In this way, the timely update of the custom dictionary can be guaranteed, and the scope of application and usage scenarios of the word segmentation tool can be further guaranteed, thereby further ensuring the reliability of the word segmentation tool.
[0074] Therefore, the word segmentation method provided in this embodiment, by collecting various types of proprietary words to construct a custom dictionary and then construct a word segmentation vocabulary, expands the word range of the word segmentation vocabulary, thereby solving the problem that the word segmentation tool is highly dependent on professional knowledge, expanding the scope of application of the word segmentation tool, and increasing the usage scenarios of the word segmentation tool. By combining pre-loading basic vocabulary into the word segmentation vocabulary and dynamically loading user-related proprietary vocabulary into the word segmentation vocabulary, the word segmentation tool can recognize proprietary vocabulary more efficiently and accurately, thereby improving the accuracy of the word segmentation results and improving the reliability of the word segmentation tool.
[0075] Example 2
[0076] In one embodiment of the present invention, Figure 2 As shown, the word segmentation methods include:
[0077] Step S202, loading the first category of proprietary vocabulary in the custom dictionary into the basic dictionary to construct a word segmentation vocabulary library;
[0078] Step S204, performing a first word segmentation on the user input information according to the word segmentation word library to obtain a first word segmentation result;
[0079] Step S206, loading the second category of proprietary vocabulary in the custom dictionary into the word segmentation word library, identifying the first word segmentation words in the first word segmentation result according to the word segmentation word library, and segmenting the first word segmentation words whose length is greater than a preset threshold in the indexing mode to obtain a second word segmentation result;
[0080] Step S208, performing part-of-speech tagging on the second segmentation words in the second segmentation result to obtain a third segmentation result;
[0081] Among them, the first category of proprietary vocabulary is basic vocabulary, and the second category of proprietary vocabulary is user-related proprietary vocabulary.
[0082] In this embodiment, after the user input information is segmented for the first time and the first segmentation result is identified, the first segmentation words whose length is greater than the preset threshold are segmented again in the index mode. In this way, the accuracy of the segmentation result is further improved, and the reliability of the segmentation tool is improved.
[0083] In a specific embodiment, the preset threshold may be 3, and in the index mode, the first segmented words with a length greater than 3 are segmented again.
[0084] Example 3
[0085] In one embodiment of the present invention, Figure 3 As shown, the word segmentation methods include:
[0086] Step S302, loading the first category of proprietary vocabulary in the custom dictionary into the basic dictionary to construct a word segmentation vocabulary;
[0087] Step S304, performing a first word segmentation on the user input information according to the word segmentation word library to obtain a first word segmentation result;
[0088] Step S306, loading the second category of proprietary vocabulary in the custom dictionary into the word segmentation word library, and identifying the first word segmentation words in the first word segmentation result according to the word segmentation word library to obtain a second word segmentation result;
[0089] Step S308, in the part-of-speech tagging mode, the second participle words in the second participle result are tagged with the part-of-speech according to the hidden Markov model, or in the part-of-speech tagging mode, the second participle words are tagged with the regular part-of-speech;
[0090] Among them, the first category of proprietary vocabulary is basic vocabulary, and the second category of proprietary vocabulary is user-related proprietary vocabulary.
[0091] Example 4
[0092] In one embodiment of the present invention, Figure 4 As shown, the word segmentation methods include:
[0093] Step S402, loading the first category of proprietary vocabulary in the custom dictionary into the basic dictionary to construct a word segmentation vocabulary library;
[0094] Step S404, performing a first word segmentation on the user input information according to the word segmentation word library to obtain a first word segmentation result;
[0095] Step S406, loading the second category of proprietary vocabulary in the custom dictionary into the word segmentation word library, identifying the first word segmentation words in the first word segmentation result according to the word segmentation word library, and segmenting the first word segmentation words whose length is greater than a preset threshold in the indexing mode to obtain a second word segmentation result;
[0096] Step S408, in the part-of-speech tagging mode, the second participle words in the second participle result are tagged with the part-of-speech according to the hidden Markov model, or in the part-of-speech tagging mode is closed, the second participle words are tagged with the regular part-of-speech;
[0097] Among them, the first category of proprietary vocabulary is basic vocabulary, and the second category of proprietary vocabulary is user-related proprietary vocabulary.
[0098] In this embodiment, the word segmentation method may further include: constructing a custom dictionary based on proprietary vocabulary. Wherein, the proprietary vocabulary can be divided into product-level vocabulary, industry-level vocabulary and user-level vocabulary, the first category of proprietary vocabulary includes product-level vocabulary and industry-level vocabulary, and the first category of proprietary vocabulary includes user-level vocabulary. Further, in this embodiment, the word segmentation method may further include: updating the custom dictionary based on the update of the proprietary vocabulary.
[0099] In a specific embodiment, Fig.10 As shown, Fig.10 A schematic flow chart of a word segmentation method according to a specific embodiment of the present invention is shown.
[0100] like Fig.10As shown, in the process of word segmentation, first, determine whether to enable the custom dictionary loading mode. If enabled, the first category of proprietary words in the custom dictionary, namely, product-level proprietary words and industry-level proprietary words, are loaded into the word segmentation word library, otherwise only the basic dictionary is used to build the word segmentation word library. Then, the user input information is segmented for the first time according to the word segmentation word library to obtain the first word segmentation result. After that, determine whether to enable the custom dictionary mode. If enabled, the second category of proprietary words in the custom dictionary, namely, user-level proprietary words, are dynamically loaded into the word segmentation word library, and the first word segmentation words in the first word segmentation result are identified according to the new word segmentation word library, otherwise the first word segmentation result is directly tagged with part of speech. After that, determine whether to enable the index mode. If enabled, the words in the first word segmentation words whose length is greater than the preset threshold are segmented again, otherwise the first word segmentation result after identification is directly used as the second word segmentation result for part of speech tagging. Finally, it is determined whether the part-of-speech tagging mode is turned on. If it is turned on, the hidden Markov model is used to tag the second participle words in the second participle result. Otherwise, the second participle words are directly marked as regular part-of-speech. After the part-of-speech tagging is completed, the word segmentation ends and a final word segmentation result is obtained.
[0101] Example 5
[0102] The second aspect of the present invention provides a word segmentation device. In one embodiment of the present invention, Figure 5 As shown, the word segmentation device 500 includes:
[0103] A construction unit 502 is used to load the first category of special words in the custom dictionary into the basic dictionary to construct a word segmentation vocabulary;
[0104] The processing unit 504 is used to perform a first word segmentation on the user input information according to the word segmentation word library to obtain a first word segmentation result;
[0105] The processing unit 504 is further configured to load the second category of proprietary vocabulary in the custom dictionary into the word segmentation word library, and identify the first word segmentation words in the first word segmentation result according to the word segmentation word library to obtain a second word segmentation result;
[0106] The processing unit 504 is further configured to perform part-of-speech tagging on the second segmentation words in the second segmentation result to obtain a third segmentation result;
[0107] Among them, the first category of proprietary vocabulary is basic vocabulary, and the second category of proprietary vocabulary is user-related proprietary vocabulary.
[0108] The word segmentation device 500 provided in this embodiment first loads the first category of proprietary vocabulary in the custom dictionary into the basic dictionary through the construction unit 502 to construct a word segmentation vocabulary, and then performs the first word segmentation on the user input information according to the word segmentation vocabulary through the processing unit 504 to obtain the first word segmentation result, and then loads the second category of proprietary vocabulary in the custom dictionary into the word segmentation vocabulary through the processing unit 504, and recognizes the first word segmentation words in the first word segmentation result according to the new word segmentation vocabulary to obtain the second word segmentation result, and finally performs part-of-speech tagging on the second word segmentation words in the second word segmentation result through the processing unit 504 to obtain the third word segmentation result. Among them, the first category of proprietary vocabulary is the basic vocabulary, and the second category of proprietary vocabulary is the proprietary vocabulary related to the user. The word segmentation device 500 proposed in this embodiment divides the proprietary vocabulary into two categories: basic vocabulary and user-related proprietary vocabulary, and constructs a custom dictionary according to these two categories of vocabulary through the construction unit 502, so that the scope of application of the word segmentation tool is expanded and the usage scenarios of the word segmentation tool are increased. During the word segmentation process, by preloading basic vocabulary into the word segmentation vocabulary and dynamically loading user-related proprietary vocabulary into the word segmentation vocabulary, the word segmentation tool can recognize proprietary vocabulary more efficiently and accurately, thereby improving the accuracy of the word segmentation results and the reliability of the word segmentation tool.
[0109] The word segmentation device 500 provided in this embodiment, the construction unit 502 can also be used to construct a custom dictionary based on proprietary vocabulary. Among them, the proprietary vocabulary can be divided into product-level vocabulary, industry-level vocabulary and user-level vocabulary, the first category of proprietary vocabulary includes product-level vocabulary and industry-level vocabulary, and the first category of proprietary vocabulary includes user-level vocabulary.
[0110] In a specific embodiment, product structured data such as menus, services, business processes, metadata, UI metadata, operations, etc. are collected from product prefabricated data, and industry terms are extracted from unstructured data such as help documents, requirement documents, and operation documents to establish product-level vocabulary such as service names, attribute names, operation names, and process names. Unstructured data is crawled from the network to collect industry terms in various fields to establish industry-level vocabulary in the fields of finance, human resources, supply chain, assets, manufacturing, etc. Organization names, department names, material names, supplier names, customer names, and bank file names are collected from the user's basic files to establish user-level professional vocabulary. In this way, the word range of the custom dictionary is increased, the scope of application of the word segmentation tool is expanded, the use scenarios of the word segmentation tool are increased, and the reliability of the word segmentation tool is improved. At the same time, during the word segmentation process, industry-level proprietary vocabulary and product-level proprietary vocabulary are preloaded into the word segmentation vocabulary library through the construction unit 502, and user-level proprietary vocabulary is dynamically loaded into the word segmentation vocabulary library through the processing unit 504, making the word segmentation tool's recognition of proprietary vocabulary more efficient and accurate, thereby improving the accuracy of the word segmentation results and improving the reliability of the word segmentation tool.
[0111] In a specific embodiment, when dynamically loading user-level proprietary vocabulary, a redis database is used to store user-level proprietary vocabulary. In this way, the processing unit 504 can quickly obtain and dynamically load user-level proprietary vocabulary into the word segmentation vocabulary library, thereby ensuring the efficiency and accuracy of the word segmentation tool in identifying proprietary vocabulary, thereby further improving the overall performance of the word segmentation tool and ensuring the reliability of the word segmentation tool.
[0112] Furthermore, the word segmentation device 500 provided in this embodiment, the construction unit 502 can also be used to update the custom dictionary based on the update of the proprietary vocabulary. The word segmentation device 500 provided by the present invention updates the custom dictionary according to the update of the proprietary vocabulary when the proprietary vocabulary is updated. In this way, the timely update of the custom dictionary can be guaranteed, and the scope of application and usage scenarios of the word segmentation tool can be further guaranteed, thereby further ensuring the reliability of the word segmentation tool.
[0113] Therefore, the word segmentation device 500 provided in this embodiment collects various types of proprietary words through the construction unit 502 to construct a custom dictionary and then construct a word segmentation vocabulary, thereby expanding the word range of the word segmentation vocabulary, thereby solving the problem that the word segmentation tool is highly dependent on professional knowledge, expanding the scope of application of the word segmentation tool, and increasing the usage scenarios of the word segmentation tool. By combining the construction unit 502 to preload basic words into the word segmentation vocabulary and the processing unit 504 to dynamically load user-related proprietary words into the word segmentation vocabulary, the word segmentation tool can recognize proprietary words more efficiently and accurately, thereby improving the accuracy of the word segmentation results and improving the reliability of the word segmentation tool.
[0114] Example 6
[0115] The third aspect of the present invention provides an intention triggering method. In one embodiment of the present invention, Figure 6 As shown, the intent triggering methods include:
[0116] Step S602, constructing a keyword dictionary tree according to the keywords of at least one intent information;
[0117] Step S604, receiving the dialogue information input by the user, performing word segmentation processing on the dialogue information, and obtaining a word segmentation result;
[0118] Step S606, matching the word segmentation result with the keyword dictionary tree to determine a target intent of at least one intent information;
[0119] Step S608: execute at least one intention information according to the target intention.
[0120] The intention triggering method proposed in this embodiment first constructs a keyword dictionary tree based on the keywords of at least one intention information, then receives the dialogue information input by the user, and performs word segmentation processing on the dialogue information according to the word segmentation method in any of the above technical solutions to obtain a word segmentation result, and then matches the word segmentation result with the keyword dictionary tree to determine the target intent of at least one intention information, and finally executes at least one intention information according to the target intent. In this way, the scope of application of the word segmentation tool is expanded, and the problem of low applicability of general word segmentation tools to enterprise service scenarios with broad business functions is solved. The proprietary vocabulary of the enterprise dialogue scenario can be identified, thereby improving the accuracy of the word segmentation results, improving the accuracy and speed of user intent matching, and ensuring the accuracy of user intent triggering.
[0121] Furthermore, the intention triggering method proposed in this embodiment performs word segmentation processing on the dialogue information according to the word segmentation method in any of the above embodiments. Therefore, the intention triggering method proposed in this embodiment has all the beneficial effects of the word segmentation method in any of the above embodiments, which will not be repeated here.
[0122] Example 7
[0123] In one embodiment of the present invention, Figure 7 As shown, the intent triggering methods include:
[0124] Step S702, constructing a keyword dictionary tree according to the keywords of at least one intent information;
[0125] Step S704, receiving the dialogue information input by the user, performing word segmentation processing on the dialogue information, and obtaining a word segmentation result;
[0126] Step S706, performing keyword recognition on the dialogue information input by the user, and determining a first trigger condition list according to a first recognition result of the keyword recognition;
[0127] Step S708, performing part-of-speech recognition on the word segmentation result and the keyword dictionary tree, and determining a second trigger condition list according to a second recognition result of the part-of-speech recognition;
[0128] Step S710, acquiring trigger condition information from the first trigger condition list and the second trigger condition list;
[0129] Step S712, according to the trigger condition information, the keyword trigger judgment process and the part-of-speech trigger judgment process are sequentially performed on the word segmentation results and the keyword dictionary tree to determine the target intent that meets the judgment condition;
[0130] Step S714: execute at least one intention information according to the target intention.
[0131] In this embodiment, when matching the word segmentation result with the keyword dictionary tree, the conversation information input by the user is firstly subjected to keyword recognition, and a first trigger condition list is determined according to a first recognition result of the keyword recognition, and then part-of-speech recognition is performed on the word segmentation result and the keyword dictionary tree, and a second trigger condition list is determined according to a second recognition result of the part-of-speech recognition. In this way, the matching of the word segmentation result and the keyword dictionary tree is divided into two aspects: keyword matching and part-of-speech matching, so that the intention trigger supports two triggering modes: trigger words and trigger sentences, which improves the flexibility of the intention triggering mode, and further ensures the accuracy of the user intention matching.
[0132] Furthermore, in this embodiment, by obtaining trigger condition information from the first trigger condition list and the second trigger condition list, and according to the trigger condition information, the keyword trigger judgment process and the part-of-speech trigger judgment process are sequentially performed on the word segmentation result and the keyword dictionary tree to determine the target intent that meets the judgment condition. In this way, the word segmentation result and the keyword dictionary tree are matched through the keyword trigger judgment process and the part-of-speech trigger judgment process, and the keyword trigger judgment process and the part-of-speech trigger judgment process are both provided with a variety of matching rules, which ensures the flexibility and accuracy of the matching between the word segmentation result and the keyword dictionary tree, thereby improving the accuracy of the intent trigger.
[0133] Further, in this embodiment, if Figure 8 As shown, after obtaining the trigger condition information from the first trigger condition list and the second trigger condition list, the keyword trigger judgment process includes:
[0134] Step S802, determining whether the word segmentation result contains all the keywords in the keyword phrase of the keyword dictionary tree, if not, it is considered that the match fails, if so, proceeding to step S804;
[0135] Step S804, determining whether the word segmentation result contains a keyword in any sub-keyword phrase of the keyword phrase of the keyword dictionary tree, if so, it is considered that the match is successful, and the target intent is determined according to the intent information corresponding to the keyword dictionary tree, if not, proceeding to step S806;
[0136] Step S806, determining whether the word segmentation result contains any word in any non-keyword phrase of the keyword phrase of the keyword dictionary tree, if so, it is considered that the match fails, if not, proceeding to step S808;
[0137] Step S808, determine whether the word segmentation result contains all the keywords in the approximate keyword phrase of the keyword phrase in the keyword dictionary tree. If so, it is considered that the match fails. If not, enter step S810 of the part-of-speech trigger judgment process.
[0138] In this embodiment, the matching of word segmentation results with the keyword dictionary tree is divided into two stages: keyword matching and part-of-speech matching. In the keyword matching stage, multiple matching rules are set to ensure the flexibility and accuracy of keyword matching, thereby ensuring the flexibility and accuracy of word segmentation result matching and improving the accuracy of intent triggering.
[0139] Specifically, in this embodiment, first, it is determined whether the word segmentation result contains all the keywords in the keyword phrase of the keyword dictionary tree. If there are keywords in the above keyword phrase that are not in the word segmentation result, it is determined that the current match has failed and the next matching process is performed. If all the keywords in the above keyword phrase are in the word segmentation result, it is continued to be determined whether the word segmentation result contains keywords in any sub-keyword phrase of the keyword phrase of the keyword dictionary tree. If so, it is considered that the current match is successful, and then the target intent is determined according to the intent information corresponding to the keyword dictionary tree. If not, it is continued to be determined whether the word segmentation result contains words in any non-keyword phrase of the keyword phrase of the keyword dictionary tree, that is, it is determined whether the word segmentation result contains keywords that are not in the keyword dictionary tree. If so, it is considered that the current match has failed and the next matching process is performed. If not, it is continued to be determined whether the word segmentation result contains all the keywords in the approximate keyword phrase of the keyword phrase of the keyword dictionary tree, that is, it is determined whether the conversation information corresponding to the word segmentation result and the intent information corresponding to the keyword dictionary tree are similar information. If so, it is considered that the current match has failed and the next matching process is performed. If not, the part-of-speech trigger judgment process is entered. In this way, through the mutual cooperation of multiple matching rules, the flexibility and accuracy of word segmentation result matching are guaranteed, thereby improving the accuracy of intent triggering.
[0140] Further, in this embodiment, if Figure 8 As shown, after the keyword trigger judgment process, the part-of-speech trigger judgment process includes:
[0141] Step S810, determining whether the part of speech of the segmented words in the segmentation result matches the part of speech of the keyword in the keyword dictionary tree, if not, it is considered that the match fails, if so, proceeding to step S812;
[0142] Step S812, determine whether the segmented words with matching parts of speech match the keywords. If so, it is considered that the match is successful, and the target intent is determined according to the intent information corresponding to the keyword dictionary tree. If not, it is considered that the match fails.
[0143] Among them, judging whether the part of speech of the segmented words in the segmentation result matches the part of speech of the keywords in the keyword dictionary tree includes three matching rules: combination part of speech matching judgment, noun part of speech matching judgment and verb part of speech matching judgment.
[0144] In this embodiment, the matching of word segmentation results with the keyword dictionary tree is divided into two stages: keyword matching and part-of-speech matching. In the part-of-speech matching stage, multiple matching rules are set to ensure the flexibility and accuracy of part-of-speech matching, thereby ensuring the flexibility and accuracy of word segmentation result matching and improving the accuracy of intent triggering.
[0145] Specifically, in this embodiment, after the keyword trigger judgment process is completed, the part-of-speech trigger judgment process is entered. First, the part-of-speech of the segmented words in the segmentation result is judged from the three aspects of combined part-of-speech, noun part-of-speech and verb part-of-speech to see whether it matches the part-of-speech of the keyword in the keyword dictionary tree. If not, it is considered that the match has failed and the next matching process is performed. If so, it is continued to determine whether the segmented words with matching parts of speech and the keywords match. If so, it is considered that the match is successful and the target intent is determined based on the intent information corresponding to the keyword dictionary tree. If not, it is considered that the match has failed and the next matching process is performed. In this way, through the mutual cooperation of multiple matching rules, the flexibility and accuracy of the segmentation result matching are guaranteed, thereby improving the accuracy of intent triggering.
[0146] Example 8
[0147] A fourth aspect of the present invention provides an intention triggering device. In one embodiment of the present invention, Fig. 9 As shown, the intention triggering device 900 includes:
[0148] A construction unit 902, configured to construct a keyword dictionary tree according to a keyword of at least one intent information;
[0149] The word segmentation unit 904 is used to receive the dialogue information input by the user, and perform word segmentation processing on the dialogue information according to the word segmentation method in any of the above embodiments to obtain a word segmentation result;
[0150] A matching unit 906, configured to match the word segmentation result with the keyword dictionary tree to determine a target intent of at least one intent information;
[0151] The execution unit 908 is used to execute at least one intention information according to the target intention.
[0152] The intention triggering device 900 proposed in this embodiment first constructs a keyword dictionary tree according to the keywords of at least one intention information through the construction unit 902, then receives the dialogue information input by the user through the word segmentation unit 904, and performs word segmentation processing on the dialogue information according to the word segmentation method in any of the above technical solutions to obtain a word segmentation result, and then matches the word segmentation result with the keyword dictionary tree through the matching unit 906 to determine the target intention of at least one intention information, and finally executes at least one intention information according to the target intention through the execution unit 908. In this way, the scope of application of the word segmentation tool is expanded, and the problem that the general word segmentation tool has low applicability to enterprise service scenarios with broad business functions is solved. The proprietary vocabulary of the enterprise dialogue scenario can be identified, thereby improving the accuracy of the word segmentation result, improving the accuracy and rapidity of user intention matching, and ensuring the accuracy of user intention triggering.
[0153] Furthermore, the intention triggering device 900 proposed in this embodiment performs word segmentation processing on the dialogue information according to the word segmentation method in any of the above embodiments through the word segmentation unit 904. Therefore, the intention triggering device 900 proposed in this embodiment has all the beneficial effects of the word segmentation method in any of the above embodiments, which will not be repeated here.
[0154] Example 9
[0155] A fifth aspect of the present invention provides a readable storage medium. In one embodiment of the present invention, a program is stored on the readable storage medium, and when the program is executed by the processor, the steps of the word segmentation method in any of the above embodiments are implemented. Therefore, the readable storage medium proposed in this embodiment can achieve all the beneficial effects of the word segmentation method in any of the above embodiments, which will not be repeated here.
[0156] Example 10
[0157] In one embodiment of the present invention, a readable storage medium is provided, on which a program is stored, and when the program is executed by a processor, the steps of the intention triggering method in any of the above embodiments are implemented. Therefore, the readable storage medium provided in this embodiment can achieve all the beneficial effects of the intention triggering method in any of the above embodiments, which will not be repeated here.
[0158] In the description of the present invention, the term "plurality" refers to two or more than two. Unless otherwise clearly defined, the orientation or positional relationship indicated by the terms "upper" and "lower" is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention. The terms "connection", "installation", "fixation", etc. should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0159] In the description of the present invention, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In the present invention, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0160] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A word segmentation method, characterized in that: include: Load the first category of proprietary words in the custom dictionary into the basic dictionary to build a word segmentation vocabulary; Performing a first word segmentation on the user input information according to the word segmentation word library to obtain a first word segmentation result; Loading the second category of proprietary vocabulary in the custom dictionary into the word segmentation thesaurus, and identifying the first segmentation words in the first segmentation result according to the word segmentation thesaurus to obtain a second segmentation result; Performing part-of-speech tagging on the second segmentation words in the second segmentation result to obtain a third segmentation result; The first category of special words is basic words, and the second category of special words is special words related to the user.
2. The word segmentation method according to claim 1, characterized in that: After the step of identifying the first segmentation word in the first segmentation result and before the step of obtaining the second segmentation result, the method further includes: In the index mode, the first segmented words whose length is greater than a preset threshold are segmented.
3. The word segmentation method according to claim 1, characterized in that: The step of performing part-of-speech tagging on the second segmentation words in the second segmentation result to obtain the third segmentation result specifically includes: In the part-of-speech tagging mode, the part-of-speech tagging is performed on the second participial words in the second participial result according to the hidden Markov model; or In the mode of closing part-of-speech tagging, the second participle words are tagged as regular parts of speech.
4. A word segmentation device, characterized in that: include: A construction unit, used for loading the first category of proprietary vocabulary in the custom dictionary into the basic dictionary to construct a word segmentation vocabulary; A processing unit, configured to perform a first word segmentation on the user input information according to the word segmentation word library to obtain a first word segmentation result; The processing unit is further configured to load the second category of proprietary vocabulary in the custom dictionary into the word segmentation lexicon, and identify the first word segmentation term in the first word segmentation result according to the word segmentation lexicon to obtain a second word segmentation result; The processing unit is further configured to perform part-of-speech tagging on the second segmentation words in the second segmentation result to obtain a third segmentation result; The first category of special words is basic words, and the second category of special words is special words related to the user.
5. An intention triggering method, characterized in that: include: Constructing a keyword dictionary tree according to a keyword of at least one intent information; receiving dialogue information input by a user, and performing word segmentation processing on the dialogue information according to the word segmentation method according to any one of claims 1 to 3 to obtain a word segmentation result; Matching the word segmentation result with the keyword dictionary tree to determine the target intent of the at least one intent information; According to the target intention, execute the at least one intention information.
6. The intention triggering method according to claim 5, characterized in that: The step of matching the word segmentation result with the keyword dictionary tree to determine the target intent of the at least one intent information specifically includes: Performing keyword recognition on the conversation information input by the user, and determining a first trigger condition list according to a first recognition result of the keyword recognition; Performing part-of-speech recognition on the word segmentation result and the keyword dictionary tree, and determining a second trigger condition list according to a second recognition result of the part-of-speech recognition; Acquire trigger condition information from the first trigger condition list and the second trigger condition list; According to the trigger condition information, the keyword trigger judgment process and the part-of-speech trigger judgment process are sequentially performed on the word segmentation result and the keyword dictionary tree to determine the target intent that meets the judgment condition.
7. The intention triggering method according to claim 6, characterized in that: The keyword trigger judgment process includes: Determine whether the word segmentation result contains all the keywords in the keyword phrase of the keyword dictionary tree. If not, it is considered that the match fails. If so, enter the first judgment process; The first judgment process includes: judging whether the word segmentation result contains the keyword in any sub-keyword phrase of the keyword phrase in the keyword dictionary tree, if so, it is considered that the match is successful, and the target intent is determined according to the intent information corresponding to the keyword dictionary tree, if not, entering the second judgment process; The second judgment process includes: judging whether the word segmentation result contains any word in any non-keyword phrase of the keyword phrase in the keyword dictionary tree, if so, it is considered that the match fails, if not, entering the third judgment process; The third judgment process includes: judging whether the word segmentation result contains all the keywords in the approximate keyword phrase of the keyword phrase in the keyword dictionary tree, if so, it is considered that the match fails, if not, entering the part-of-speech trigger judgment process.
8. The intention triggering method according to claim 6, characterized in that: The part-of-speech trigger judgment process includes: Determine whether the part of speech of the segmented words of the segmentation result matches the part of speech of the keywords in the keyword dictionary tree. If not, it is considered that the match fails. If so, enter the fourth judgment process; The fourth judgment process includes: judging whether the segmented words with matching parts of speech match the keywords, if so, it is considered that the match is successful, and determining the target intent according to the intent information corresponding to the keyword dictionary tree, if not, it is considered that the match fails; The step of judging whether the part of speech of the segmented words of the segmented results matches the part of speech of the keywords in the keyword dictionary tree includes three matching rules: combination part of speech matching judgment, noun part of speech matching judgment and verb part of speech matching judgment.
9. An intention triggering device, characterized in that: include: A construction unit, configured to construct a keyword dictionary tree according to a keyword of at least one intent information; A word segmentation unit, configured to receive dialogue information input by a user, and perform word segmentation processing on the dialogue information according to the word segmentation method according to any one of claims 1 to 3 to obtain a word segmentation result; A matching unit, configured to match the word segmentation result with the keyword dictionary tree to determine a target intent of the at least one intent information; An execution unit is used to execute the at least one intention information according to the target intention.
10. A readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, the steps of the word segmentation method as described in any one of claims 1 to 3 are implemented; and / or when the program is executed by a processor, the steps of the intention triggering method as described in any one of claims 5 to 8 are implemented.
Citation Information
Patent Citations
Method for setting multi-granularity dictionary and segmenting words and device thereof
CN103324626A
Semantic matching method and intelligent device
CN107291783A
Method and system for intelligently understanding user query intention
CN110309400A
Kanji compound word dividing method and kanji compound word dividing device
JP2011096245A
