Physical library expansion methods, apparatus, computer equipment and storage media
By combining ASR and NER technologies, the entity database of dishes for catering robots is identified and expanded, solving the problem of difficulty in recognizing custom dishes, achieving more efficient and accurate dish recognition, and improving the user experience.
Patent Information
- Application Number
- CN202210399141.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-11
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2042-04-11
AI Technical Summary
Service robots in the catering industry are limited by the fixed physical database of dishes, making it impossible for them to accurately identify the custom-made dish information of customers, resulting in a poor user experience.
ASR technology is used to convert voice dialogue into semantic text, and NER technology is used to extract dish names. By judging and processing the word structure in the semantic text, the dish names are identified and the volume library is expanded, or manual review is used to expand the library when the names cannot be identified.
This improves the efficiency and accuracy of dish recognition, ensuring that customer dish information can be identified and added to the physical database even in a custom dish database, thus enhancing the user experience.
Smart Images

Figure CN114691851B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to computers, and more specifically to methods, apparatus, computer equipment, and storage media for expanding physical libraries. Background Technology
[0002] With the widespread use of service robots in daily life, people have placed higher demands on them, hoping that robots will provide better services. This is particularly evident in the catering industry. Because there are no rules governing the names of dishes in the catering industry, each restaurant can have its own unique dish names, and each customer's suggested names vary greatly. This diversity of dish names presents significant challenges for service robots in understanding customer meaning.
[0003] Service robots in the catering industry typically pick up customers' voice messages, convert them into semantic text, and then match the corresponding dish names from a fixed entity database. However, as the number of dishes continues to expand while the corresponding entity database remains fixed, it is easy for the server robot to fail to accurately identify the dish information mentioned by the customer, resulting in a poor customer experience.
[0004] Therefore, it is necessary to design a new method that can identify dish names that do not exist in a custom dish entity database, and add the identified dish names to the dish entity database to expand the database, thereby improving the efficiency and accuracy of subsequent dish identification. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, apparatus, computer equipment and storage medium for expanding physical libraries.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: an entity library expansion method, comprising:
[0007] Get the content of the voice conversation;
[0008] The voice dialogue content is converted using ASR to obtain semantic text;
[0009] The NER technique is used to extract the dish names from the semantic text to obtain the extraction results;
[0010] Determine whether the extracted results contain a dish name;
[0011] If the extraction result contains a dish name, the extraction result is expanded to a preset dish entity library, and the dish names in the preset dish entity library are deduplicated.
[0012] If the extraction results do not contain dish names, then the dish names in the semantic text are extracted manually to obtain the extraction results. The extraction results are then expanded into a preset dish entity library, and the dish names in the preset dish entity library are deduplicated.
[0013] The further technical solution is as follows: the NER technology is used to extract the dish names in the semantic text to obtain the extraction results, including:
[0014] Process the entities in the preset dish entity library to obtain the dish word segmentation library;
[0015] The semantic text is preprocessed to obtain the preprocessing result;
[0016] Based on the word segmentation set of the dishes, recall the words matched by the preprocessing results to obtain the recall results;
[0017] Determine whether the recall results contain any matched words;
[0018] If the recall results contain matching words, then the dish name within the semantic text is determined based on the recall results to obtain the extraction results;
[0019] If the recall results do not contain any matching words, then it is determined that the extraction results do not contain any dish name.
[0020] The further technical solution is as follows: The processing of entities within the preset dish entity library to obtain a dish word segmentation library includes:
[0021] The entities in the pre-defined food entity library are segmented into words to obtain an initial word library;
[0022] The words in the initial lexicon are expanded with synonyms and similar words to obtain a dish word segmentation lexicon.
[0023] The further technical solution is as follows: the preprocessing of the semantic text to obtain the preprocessing result includes:
[0024] The semantic text is segmented and its parts of speech are tagged to obtain the preprocessing results.
[0025] The further technical solution is as follows: determining the dish name within the semantic text based on the recall result to obtain the extraction result includes:
[0026] Determine whether the extracted results contain consecutive matching words;
[0027] If the extraction results contain consecutive matching words, then it is determined whether there are other words between the verbs in the preprocessing results and the matching words;
[0028] If there are other words between the verb in the preprocessing result and the hit word, then determine whether there is the word "的" between the verb and the hit word;
[0029] If there is the word "的" between the verb and the hit word, then combine the word after the last "的" in the preprocessing result with the hit word to form a dish name, so as to obtain an extraction result;
[0030] If there is no word "的" between the verb and the hit word, then combine the words between the verb and the hit word with the hit word to form a dish name, so as to obtain an extraction result;
[0031] If there are no other words between the verb in the preprocessing result and the hit word, then combine the hit words to form a dish name, so as to obtain an extraction result.
[0032] Its further technical solution is: after determining whether the extraction result has consecutive hit words, it further includes:
[0033] If the extraction result has no consecutive hit words, then determine whether there is the word "的" between the hit words;
[0034] If there is the word "的" between the hit words, then determine the hit word after the last "的" as the dish name, so as to obtain an extraction result;
[0035] If there is no word "的" between the hit words, then combine all the words between the first hit word and the last hit word to form a dish name, so as to obtain an extraction result.
[0036] The present invention also provides an entity library expansion device, including:
[0037] A content acquisition unit, configured to acquire voice dialogue content;
[0038] A conversion unit, configured to perform ASR conversion on the voice dialogue content to obtain a semantic text;
[0039] An extraction unit, configured to extract the dish name in the semantic text by using NER technology to obtain an extraction result;
[0040] A judgment unit, configured to judge whether there is a dish name in the extraction result;
[0041] An expansion unit, configured to, if there is a dish name in the extraction result, expand the extraction result into a preset dish entity library and perform duplicate removal processing on the dish names in the preset dish entity library;
[0042] The manual processing unit is used to manually extract the dish name from the semantic text if the extraction result does not contain the dish name, in order to obtain the extraction result, and to perform the step of expanding the extraction result into a preset dish entity library, and performing deduplication processing on the dish names in the preset dish entity library.
[0043] The further technical solution is as follows: the extraction unit includes:
[0044] The entity processing subunit is used to process entities in the preset dish entity library to obtain the dish word segmentation library;
[0045] The preprocessing subunit is used to preprocess the semantic text to obtain the preprocessing result;
[0046] The recall subunit is used to recall the words matched by the preprocessing results based on the menu word segmentation set, so as to obtain the recall results;
[0047] The recall result judgment subunit is used to determine whether the recall result contains a matched word;
[0048] The first determining subunit is used to determine the dish name in the semantic text based on the recall result if the recall result contains a matched word, so as to obtain the extraction result;
[0049] The second determining subunit is used to determine that the extracted result does not contain a dish name if the recall result does not contain a matching word.
[0050] The present invention also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the above-described method.
[0051] The present invention also provides a storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0052] The beneficial effects of this invention compared to existing technologies are as follows: This invention performs ASR conversion on the acquired voice dialogue content to form semantic text, and uses NER technology to extract the dish names within the semantic text. When the extracted results contain dish names, the extracted results are expanded into a preset dish entity library, and the dish names in the preset dish entity library are deduplicated. When the extracted results do not contain dish names, the dish names are extracted through manual review, and the preset dish entity library is expanded. This enables the recognition of dish names that do not exist in the custom dish entity library, and the recognition of dish names can be added to the dish entity library to expand the dish entity library, thereby improving the efficiency and accuracy of subsequent dish recognition.
[0053] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0054] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a schematic diagram illustrating an application scenario of the entity library expansion method provided in this embodiment of the invention.
[0056] Figure 2 A flowchart illustrating the entity library expansion method provided in an embodiment of the present invention;
[0057] Figure 3 A schematic diagram of a sub-process of the entity library expansion method provided in an embodiment of the present invention;
[0058] Figure 4 A schematic diagram of a sub-process of the entity library expansion method provided in an embodiment of the present invention;
[0059] Figure 5 A schematic diagram of a sub-process of the entity library expansion method provided in an embodiment of the present invention;
[0060] Figure 6 A schematic block diagram of an entity library expansion device provided in an embodiment of the present invention;
[0061] Figure 7 A schematic block diagram of the extraction unit of the entity library expansion device provided in an embodiment of the present invention;
[0062] Figure 8 A schematic block diagram of the entity processing subunit of the entity library expansion device provided in an embodiment of the present invention;
[0063] Figure 9 A schematic block diagram of the first determining subunit of the entity library expansion device provided in an embodiment of the present invention;
[0064] Figure 10 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation
[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0066] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0067] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0068] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0069] Please see Figure 1 and Figure 2 , Figure 1 This is a schematic diagram illustrating an application scenario of the entity library expansion method provided in this embodiment of the invention. Figure 2 This is a schematic flowchart illustrating the entity library expansion method provided in this embodiment of the invention. The method is applied to a server. The server interacts with the robot via data exchange. This server can be a standalone server or a robot controller. The robot integrates a microphone to acquire voice dialogue content and convert it into semantic text. NER (Network Errata Extraction) technology is used to extract dish names from the semantic text. When a dish name is extracted, the extraction result is added to a preset dish entity library. If no dish name is extracted, manual extraction is performed, and the result is then added to the preset dish entity library. This embodiment supports user-defined dish entity libraries. The catering service robot identifies dish names mentioned in customer-robot conversations based on the user-defined library. Even if a dish name is not present in the user-defined library, it can still identify the dish name in the customer's speech and add it to the entity library, continuously expanding the library and improving the efficiency and accuracy of subsequent dish recognition.
[0070] In other embodiments, the robot described above can also be replaced by a terminal.
[0071] Figure 2 This is a flowchart illustrating the entity library expansion method provided in an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S160.
[0072] S110, Obtain the content of the voice conversation.
[0073] In this embodiment, the voice dialogue content refers to the voice data picked up by the microphone during the voice interaction process.
[0074] Before acquiring the voice dialogue content, a custom dish entity library will be created to form a preset dish entity library. Users can customize the dish entity library. If the catering service robot comes with a general system dish entity library, users can choose not to add personalized dish entities. However, due to the characteristics of dish names—a combination of various basic dish names and adjectives—the dish entity library should include as many basic dish names as possible, such as "dumplings" and "pizza".
[0075] S120. Perform ASR conversion on the voice dialogue content to obtain semantic text.
[0076] In this embodiment, semantic text refers to the text obtained after converting the voice dialogue content using ASR (Automatic Speech Recognition) technology.
[0077] When users interact with the robot via voice, the user's voice is converted into semantic text using ASR (Automatic Speech Recognition).
[0078] When customers interact with the robot via voice, their speech is converted into semantic text using ASR (Automatic Speech Recognition). The server then extracts dish entities from this semantic text based on an existing dish entity database. Two scenarios can occur: First, if a dish matching the semantic text exists in the pre-defined dish entity database, it doesn't necessarily mean the dish name has been successfully identified. The matched dish name might be a subset of the customer's actual desired dish name. For example, if the semantic text is "I want to eat New Orleans roasted chicken pizza," and the dish entity database contains "pizza" and "New Orleans roasted meat" entities, the semantic text will identify both "pizza" and "New Orleans roasted meat" entities, resulting in a match. There are two scenarios: First, the semantic text might contain multiple dish entities. For example, in the phrase "I want to eat the Supreme Pizza," the verb "eat" matches "pizza" in the pre-defined dish entity database. While "supreme" exists between "eat" and "pizza," it's also a dish name. However, the robot can only recognize "pizza" in this case. This demonstrates that even if the semantic text matches an entity in the database, it doesn't guarantee an accurate dish name. Therefore, NER (Network Entity Recognition) technology is needed for further dish name recognition. Second, the semantic text might not contain any entities that match the pre-defined database. In this case, NER technology is also required for dish name recognition. Applying NER to the semantic text in both scenarios involves predicting a dish name. If the prediction is accurate, it needs to be manually reviewed. If it's not, it needs to be manually extracted. The manually processed dish name is then added to the dish entity database and deduplicated, achieving the goal of recognizing entities while expanding the database.
[0079] In this embodiment, the entity mentioned above is actually the name of the dish.
[0080] S130. Use NER technology to extract the dish names in the semantic text to obtain the extraction results.
[0081] In this embodiment, the extraction result refers to the result of extracting the dish name in the semantic text using NER (Named Entity Recognition) technology. It includes two cases: one is that the extraction result is the dish name, and the other is that the extraction result does not contain a prompt message indicating that the dish name does not exist.
[0082] In one embodiment, please refer to Figure 3 The above-mentioned step S130 may include steps S131 to S136.
[0083] S131. Process the entities in the preset dish entity library to obtain the dish word segmentation library.
[0084] In this embodiment, the dish word segmentation library refers to the set of words consisting of dish names in a preset dish entity library.
[0085] In one embodiment, please refer to Figure 4 The above step S131 may include steps S1311 to S1312.
[0086] S1311. Segment the entities in the preset dish entity library to obtain the initial word library.
[0087] In this embodiment, the initial lexicon refers to the set of words formed by segmenting the names of dishes in the preset dish entity library.
[0088] Since most dish names are simply random combinations of several basic dish names and decorative terms, further fine-grained segmentation of dish names, such as segmenting "Northeast Dumplings" into "Northeast" and "dumplings", can help improve the accuracy of subsequent entity recognition.
[0089] S1312. Expand the words in the initial word library with synonyms and similar words to obtain a dish word segmentation library.
[0090] Specifically, the words in the initial vocabulary are expanded with synonyms and near-synonyms to enrich the initial vocabulary and form a food-specific vocabulary, thus obtaining different expressions for the same food or similar flavors. For example, the synonym "dumplings" is added to the initial vocabulary, and the near-synonyms "fragrant and spicy," "extremely spicy," "extra spicy," and "fragrant and numbing" are added to the initial vocabulary. The words in the initial vocabulary are called tokens.
[0091] S132. Preprocess the semantic text to obtain the preprocessing result.
[0092] In this embodiment, the preprocessing result refers to the result of word segmentation and part-of-speech tagging of the semantic text.
[0093] Specifically, the semantic text is segmented and tagged with part-of-speech tags to obtain a preprocessing result. The main reason for performing part-of-speech tagging here is to extract verbs from the semantic text for subsequent entity recognition of dish names. For example, the preprocessing result of segmenting and tagging the phrase "I want to eat Northeastern dumplings" is: {'I':'r','want':'v','eat':'v','Northeastern':'ns','dumplings':'n'}.
[0094] S133. Recall the words matched by the preprocessing results based on the word segmentation set of the dishes to obtain the recall results.
[0095] In this embodiment, the recall result refers to the words that exist in both the preprocessing result and the dish word segmentation set. There are also two cases for the recall result. One is that there are corresponding words, and the other is that there are no words that meet the requirements. The words that meet the requirements refer to the tokens hit in the semantic text recalled based on the dish word segmentation set. This situation may occur when there is no dish name in the original semantic text, or because the dish name is unique to the store and too unconventional, resulting in no hits. For example: "Hello, Uncle Mango", after word segmentation, it is {'uncle': 'n', 'hello': 'l','mango': 'ng'}, and no token can be matched in the dish word segmentation set, indicating that there is no dish name in the extraction result. This situation will enter the manual recognition link.
[0096] S134. Determine whether there are hit words in the recall result;
[0097] S135. If there are hit words in the recall result, determine the dish name in the semantic text according to the recall result to obtain the extraction result.
[0098] In one embodiment, please refer to Figure 5 , the above step S135 may include steps S1351 to S1359.
[0099] S1351. Determine whether the extraction result has continuously hit words.
[0100] In this embodiment, the situation of determining whether the extraction result has continuously hit words includes having only one hit word.
[0101] S1352. If the extraction result has continuously hit words, determine whether there are other words between the verb in the preprocessing result and the hit words;
[0102] S1353. If there are other words between the verb in the preprocessing result and the hit words, determine whether there is the word "de" between the verb and the hit words;
[0103] S1354. If there is the word "de" between the verb and the hit words, combine the words after the last "de" in the preprocessing result with the hit words to form the dish name to obtain the extraction result.
[0104] In this embodiment, when there are other words between the last verb in the preprocessing result and the hit token, but there is the character "的", it indicates that the words between the verb and the character "的" are modifiers and cannot be part of the dish name. The words after the last "的" should be combined with the hit token as the dish name. For example, in the sentence "我想吃东北饺子馆的好吃的精品水饺", "水饺" is the hit token. There are two "的" in this text, and the words between the verb "吃" and the last "的" are all modifiers. Therefore, the combination of "精品" after the last "的" and the hit "水饺", i.e., "精品水饺", is the dish name.
[0105] S1355. If there is no character "的" between the verb and the hit word, then combine the words between the verb and the hit word with the hit word to form the dish name to obtain the extraction result.
[0106] In this embodiment, when there are other words between the last verb in the preprocessing result and the hit token, but there is no "的", it indicates that there is a prefix before the hit token. The words between the verb and the hit token should be combined with the hit token as the dish name. For example: {'我':'r','想':'v','吃':'v','精品':'n','水饺':'n'}. "水饺" is the hit token, and "吃" is the last verb before the hit token. There is "精品" between "吃" and "水饺". Here, "精品水饺" is regarded as a dish name.
[0107] S1356. If there are no other words between the verb in the preprocessing result and the hit word, then combine the hit words to form the dish name to obtain the extraction result.
[0108] In this embodiment, when there are no other words between the last verb in the preprocessing result and the hit token, then combine the continuously hit tokens as a dish name. For example: {'我':'r','想':'v','吃':'v','牛肉':'n','芝士':'ns','披萨':'n'}. "牛肉", "芝士", and "披萨" are hit tokens, and there are no other words between the verb "吃" and the hit tokens. Then, "牛肉芝士披萨" is the dish name.
[0109] In this embodiment, the above-mentioned hit token is the word hit in the preprocessing result.
[0110] S1357. If there are no continuously hit words in the extraction result, then judge whether there is the character "的" between the hit words;
[0111] S1358. If there is a "de" character between the hit words, determine the word hit after the last "de" character as the dish name to obtain the extraction result.
[0112] In this embodiment, when the hit tokens are not continuous and there is a "de" between the hit words, it means that the tokens before the "de" character only serve as modifiers, and only the token hit after the last "de" character is retained as the dish name. For example: {'I': 'r', 'want': 'v', 'eat': 'v', 'northeast': 'ns', 'de': 'uj', 'dumplings': 'n'}. Both "northeast" and "dumplings" are hit tokens, but there is a "de" between the two tokens, which means that "northeast" is a modifier of "dumplings" at this time. Therefore, "dumplings" is the dish name.
[0113] S1359. If there is no "de" character between the hit words, combine all the words between the first hit word and the last hit word to form the dish name to obtain the extraction result.
[0114] When the hit tokens are not continuous and there is no "de" character between the hit words, it means that there are non-rhetorical addition words between the hit tokens. Combine all the words between the first hit token and the last hit token as a dish name. For example: {'I': 'r', 'want': 'v', 'eat': 'v', 'northeast': 'ns','sauerkraut': 'n','stuffing': 'n', 'dumplings': 'n'}. "northeast" and "dumplings" are hit tokens, and there are "sauerkraut" and "stuffing" between them. But since there is no "de", it means there is no modifier, so "northeast sauerkraut stuffed dumplings" is the dish name.
[0115] S136. If there are no hit words in the recall result, determine that there is no dish name in the extraction result.
[0116] S140. Determine whether there is a dish name in the extraction result;
[0117] S150. If there is a dish name in the extraction result, expand the extraction result into a preset dish entity library and perform deduplication on the dish names in the preset dish entity library;
[0118] S160. If there is no dish name in the extraction result, manually extract the dish name in the semantic text to obtain the extraction result and execute step S150.
[0119] When the corresponding dish name cannot be extracted using NER technology, manual extraction is required to ensure that unique dish names can also be expanded into the preset dish entity library.
[0120] The aforementioned entity library expansion method involves performing ASR conversion on the acquired voice dialogue content to form semantic text, and using NER technology to extract dish names from the semantic text. When a dish name exists in the extraction result, the extraction result is expanded into a preset dish entity library, and duplicate dish names in the preset dish entity library are deduplicated. When no dish name exists in the extraction result, a manual review process is used to extract the dish name, and the preset dish entity library is expanded. This method enables the identification of dish names that do not exist in the custom dish entity library, and allows the identification of dish names to be added to the entity library to expand the dish entity library, thereby improving the efficiency and accuracy of subsequent dish recognition.
[0121] Figure 6 This is a schematic block diagram of a physical library expansion device 300 provided in an embodiment of the present invention. Figure 6 As shown, corresponding to the above entity library expansion method, the present invention also provides an entity library expansion apparatus 300. This entity library expansion apparatus 300 includes a unit for performing the above entity library expansion method, and the apparatus can be configured in a server. Specifically, please refer to... Figure 6 The entity library expansion device 300 includes a content acquisition unit 301, a conversion unit 302, an extraction unit 303, a judgment unit 304, an expansion unit 305, and a manual processing unit 306.
[0122] The system comprises: a content acquisition unit 301 for acquiring voice dialogue content; a conversion unit 302 for performing ASR conversion on the voice dialogue content to obtain semantic text; an extraction unit 303 for extracting dish names from the semantic text using NER technology to obtain extraction results; a judgment unit 304 for judging whether the extraction results contain dish names; an expansion unit 305 for expanding the extraction results to a preset dish entity library if dish names exist, and performing deduplication processing on the dish names in the preset dish entity library; and a manual processing unit 306 for manually extracting dish names from the semantic text if dish names do not exist, and performing the steps of expanding the extraction results to the preset dish entity library and performing deduplication processing on the dish names in the preset dish entity library.
[0123] In one embodiment, such as Figure 7 As shown, the extraction unit 303 includes an entity processing subunit 3031, a preprocessing subunit 3032, a recall subunit 3033, a recall result judgment subunit 3034, a first determination subunit 3035, and a second determination subunit 3036.
[0124] The entity processing subunit 3031 is used to process entities in a preset dish entity library to obtain a dish word segmentation library; the preprocessing subunit 3032 is used to preprocess the semantic text to obtain a preprocessing result; the recall subunit 3033 is used to recall words matched by the preprocessing result based on the dish word segmentation library to obtain a recall result; the recall result judgment subunit 3034 is used to determine whether the recall result matches any words; the first determination subunit 3035 is used to determine the dish name in the semantic text based on the recall result if the recall result matches any words to obtain an extraction result; the second determination subunit 3036 is used to determine that the extraction result does not contain a dish name if the recall result does not match any words.
[0125] In one embodiment, such as Figure 8 As shown, the entity processing subunit 3031 includes a word segmentation module 30311 and a word expansion module 30312.
[0126] The word segmentation module 30311 is used to segment entities in the preset dish entity library to obtain an initial word library; the word expansion module 30312 is used to expand the words in the initial word library with synonyms and similar words to obtain a dish word segmentation library.
[0127] In one embodiment, the preprocessing subunit 3032 is used to segment the semantic text into words and tag its parts of speech to obtain a preprocessing result.
[0128] In one embodiment, such as Figure 9 As shown, the first determining subunit 3035 includes a first determining module 30351, a second determining module 30352, a third determining module 30353, a first joint module 30354, a second joint module 30355, a third joint module 30356, a fourth determining module 30357, a fourth joint module 30358, and a fifth joint module 30359.
[0129] The first judgment module 30351 is used to judge whether the extraction result has continuously hit words; the second judgment module 30352 is used to judge whether there are other words between the verb in the preprocessing result and the hit words if the extraction result has continuously hit words; the third judgment module 30353 is used to judge whether there is a "de" character between the verb and the hit words if there are other words between the verb in the preprocessing result and the hit words; the first combination module 30354 is used to combine the words after the last "de" character in the preprocessing result with the hit words to form a dish name if there is a "de" character between the verb and the hit words, so as to obtain the extraction result; the second combination module 30355 is used to combine the words between the verb and the hit words with the hit words to form a dish name if there is no "de" character between the verb and the hit words, so as to obtain the extraction result; the third combination module 30356 is used to combine the hit words to form a dish name if there are no other words between the verb in the preprocessing result and the hit words, so as to obtain the extraction result. The fourth judgment module 30357 is used to judge whether there is a "de" character between the hit words if the extraction result does not have continuously hit words; the fourth combination module 30358 is used to determine the hit word after the last "de" character as the dish name if there is a "de" character between the hit words, so as to obtain the extraction result; the fifth combination module 30359 is used to combine all the words between the first hit word and the last hit word to form a dish name if there is no "de" character between the hit words, so as to obtain the extraction result.
[0130] It should be noted that those skilled in the art can clearly understand that the specific implementation processes of the above entity library expansion device 300 and each unit can refer to the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity of description, they will not be elaborated herein.
[0131] The above entity library expansion device 300 can be implemented in the form of a computer program, and this computer program can run on a computer device as shown in Figure 10 shown.
[0132] Please refer to Figure 10 , Figure 10 which is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 can be a server. Among them, the server can be an independent server or a server cluster composed of multiple servers.
[0133] Refer to Figure 10The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.
[0134] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform an entity library expansion method.
[0135] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.
[0136] The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a physical library expansion method.
[0137] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0138] The processor 502 is used to run a computer program 5032 stored in the memory to perform the following steps:
[0139] The process involves: acquiring voice dialogue content; performing ASR (Automatic Speech Responsive) conversion on the voice dialogue content to obtain semantic text; extracting dish names from the semantic text using NER (Network Execution Responsibility) technology to obtain extraction results; determining whether dish names exist in the extraction results; if dish names exist in the extraction results, expanding the extraction results into a preset dish entity library and deduplicating the dish names in the preset dish entity library; if dish names do not exist in the extraction results, manually extracting dish names from the semantic text to obtain extraction results, and then expanding the extraction results into the preset dish entity library and deduplicating the dish names in the preset dish entity library.
[0140] In one embodiment, when the processor 502 implements the step of extracting the dish names from the semantic text using NER technology to obtain the extraction result, the following steps are specifically implemented:
[0141] Process the entities in the preset dish entity library to obtain a dish word segmentation library; preprocess the semantic text to obtain a preprocessing result; recall the words hit by the preprocessing result according to the dish word segmentation set to obtain a recall result; determine whether there are any hit words in the recall result; if there are hit words in the recall result, determine the dish name in the semantic text according to the recall result to obtain an extraction result; if there are no hit words in the recall result, determine that there is no dish name in the extraction result.
[0142] In one embodiment, when the processor 502 implements the step of processing the entities in the preset dish entity library to obtain a dish word segmentation library, the specific implementation is as follows:
[0143] Perform word segmentation on the entities in the preset dish entity library to obtain an initial word library; expand the words in the initial word library with synonyms and approximate words to obtain a dish word segmentation library.
[0144] In one embodiment, when the processor 502 implements the step of preprocessing the semantic text to obtain a preprocessing result, the specific implementation is as follows:
[0145] Perform word segmentation on the semantic text and label the word nature to obtain a preprocessing result.
[0146] In one embodiment, when the processor 502 implements the step of determining the dish name in the semantic text according to the recall result to obtain an extraction result, the specific implementation is as follows:
[0147] Determine whether the extraction result has continuously hit words; if the extraction result has continuously hit words, determine whether there are other words between the verb in the preprocessing result and the hit words; if there are other words between the verb in the preprocessing result and the hit words, determine whether there is a "de" character between the verb and the hit words; if there is a "de" character between the verb and the hit words, combine the word after the last "de" character in the preprocessing result with the hit words to form a dish name to obtain an extraction result; if there is no "de" character between the verb and the hit words, combine the words between the verb and the hit words with the hit words to form a dish name to obtain an extraction result; if there are no other words between the verb in the preprocessing result and the hit words, combine the hit words to form a dish name to obtain an extraction result.
[0148] In one embodiment, after the processor 502 implements the step of determining whether the extraction result has continuously hit words, the following steps are also implemented:
[0149] If the extraction result does not continuously match words, determine whether there is the word "的" between the matched words; if there is the word "的" between the matched words, determine the word matched after the last "的" as the dish name to obtain the extraction result; if there is no word "的" between the matched words, combine all the words between the first matched word and the last matched word to form the dish name to obtain the extraction result.
[0150] It should be understood that in the embodiments of the present application, the processor 502 may be a central processing unit (CPU), and this processor 502 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or this processor may also be any conventional processor, etc.
[0151] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, and this storage medium is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0152] Therefore, the present invention also provides a storage medium. This storage medium may be a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following steps:
[0153] Obtain the voice dialogue content; perform ASR conversion on the voice dialogue content to obtain a semantic text; use NER technology to extract the dish name in the semantic text to obtain an extraction result; determine whether there is a dish name in the extraction result; if there is a dish name in the extraction result, expand the extraction result into a preset dish entity library and perform duplicate removal on the dish names in the preset dish entity library; if there is no dish name in the extraction result, manually extract the dish name in the semantic text to obtain an extraction result, and perform the operations of expanding the extraction result into the preset dish entity library and performing duplicate removal on the dish names in the preset dish entity library.
[0154] In one embodiment, when the processor executes the computer program to implement the step of extracting the dish names in the semantic text using NER technology to obtain an extraction result, the specific implementation is as follows:
[0155] Process the entities in the preset dish entity library to obtain a dish word segmentation library; preprocess the semantic text to obtain a preprocessing result; recall the words hit by the preprocessing result according to the dish word segmentation set to obtain a recall result; determine whether there are hit words in the recall result; if there are hit words in the recall result, determine the dish names in the semantic text according to the recall result to obtain an extraction result; if there are no hit words in the recall result, determine that there are no dish names in the extraction result.
[0156] In one embodiment, when the processor executes the computer program to implement the step of processing the entities in the preset dish entity library to obtain a dish word segmentation library, the specific implementation is as follows:
[0157] Perform word segmentation on the entities in the preset dish entity library to obtain an initial word library; expand the words in the initial word library with synonyms and approximate words to obtain a dish word segmentation library.
[0158] In one embodiment, when the processor executes the computer program to implement the step of preprocessing the semantic text to obtain a preprocessing result, the specific implementation is as follows:
[0159] Perform word segmentation on the semantic text and annotate the word nature to obtain a preprocessing result.
[0160] In one embodiment, when the processor executes the computer program to implement the step of determining the dish names in the semantic text according to the recall result to obtain an extraction result, the specific implementation is as follows:
[0161] Determine whether the extraction result has continuously hit words; if the extraction result has continuously hit words, determine whether there are other words between the verb in the preprocessing result and the hit words; if there are other words between the verb in the preprocessing result and the hit words, determine whether there is the word "的" between the verb and the hit words; if there is the word "的" between the verb and the hit words, combine the words after the last "的" in the preprocessing result with the hit words to form a dish name to obtain an extraction result; if there is no word "的" between the verb and the hit words, combine the words between the verb and the hit words with the hit words to form a dish name to obtain an extraction result; if there are no other words between the verb in the preprocessing result and the hit words, combine the hit words to form a dish name to obtain an extraction result.
[0162] In one embodiment, after the processor executes the computer program to implement the step of determining whether the extraction result has consecutive hit words, the following steps are further implemented:
[0163] If the extraction result does not have consecutive hit words, then determine whether there is a "de" character between the hit words; if there is a "de" character between the hit words, then determine the word hit after the last "de" character as the dish name to obtain the extraction result; if there is no "de" character between the hit words, then combine all the words between the first hit word and the last hit word to form the dish name to obtain the extraction result.
[0164] The storage medium may be various computer-readable storage media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disc that can store program codes.
[0165] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0166] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0167] The steps in the method embodiments of the present invention can be adjusted, combined, and deleted according to actual needs. The units in the device embodiments of the present invention can be combined, divided, and deleted according to actual needs. Additionally, in each embodiment of the present invention, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0168] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0169] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for expanding an entity database, characterized in that, Includes: Obtain the content of the voice conversation; Perform ASR conversion on the voice conversation content to obtain semantic text; Use NER technology to extract the dish names in the semantic text to obtain an extraction result; Determine whether there are dish names in the extraction result; If there are dish names in the extraction result, expand the extraction result into a preset dish entity library and perform duplicate removal on the dish names in the preset dish entity library; If there are no dish names in the extraction result, manually extract the dish names in the semantic text to obtain an extraction result, and perform the operation of expanding the extraction result into a preset dish entity library and performing duplicate removal on the dish names in the preset dish entity library; Among them, the use of NER technology to extract the dish names in the semantic text to obtain an extraction result includes: Process the entities in the preset dish entity library to obtain a dish segmentation library; Preprocess the semantic text to obtain a preprocessing result; Recall the words hit by the preprocessing result according to the dish segmentation library to obtain a recall result; Determine whether there are hit words in the recall result; If there are hit words in the recall result, determine the dish names in the semantic text according to the recall result to obtain an extraction result; If there are no hit words in the recall result, determine that there are no dish names in the extraction result; Among them, the determination of the dish names in the semantic text according to the recall result to obtain an extraction result includes: Determine whether the extraction result has continuously hit words; If the extraction result has continuously hit words, determine whether there are other words between the verb in the preprocessing result and the hit words; If there are other words between the verb in the preprocessing result and the hit words, determine whether there is the word "的" between the verb and the hit words; If there is the word "的" between the verb and the hit words, combine the words after the last "的" in the preprocessing result with the hit words to form a dish name to obtain an extraction result; If there is no word "的" between the verb and the hit words, combine the words between the verb and the hit words with the hit words to form a dish name to obtain an extraction result; If there are no other words between the verb in the preprocessing result and the hit words, combine the hit words to form a dish name to obtain an extraction result.
2. The entity library expansion method according to claim 1, characterized in that, The process of processing the entities in the preset dish entity library to obtain a dish segmentation library includes: Segment the entities in the preset dish entity library to obtain an initial word library; Expand the words in the initial word library with synonyms and approximate words to obtain a dish segmentation library.
3. The entity library expansion method according to claim 1, characterized in that, The preprocessing of the semantic text to obtain a preprocessing result includes: Segment the semantic text and label the词性 to obtain a preprocessing result.
4. The entity library expansion method according to claim 1, characterized in that, After determining whether the extraction result has continuously hit words, it also includes: If the extraction result does not continuously match words, determine whether there is the word "的" between the matched words; if there is the word "的" between the matched words, determine the word matched after the last "的" as the dish name to obtain the extraction result; if there is no word "的" between the matched words, combine all the words between the first matched word and the last matched word to form the dish name to obtain the extraction result.
5. A physical library expansion device, characterized in that, including: a content acquisition unit for acquiring the voice dialogue content; a conversion unit for performing ASR conversion on the voice dialogue content to obtain a semantic text; an extraction unit for extracting the dish name in the semantic text by using NER technology to obtain an extraction result; a judgment unit for judging whether there is a dish name in the extraction result; an expansion unit for, if there is a dish name in the extraction result, expanding the extraction result into a preset dish entity library and performing duplicate removal processing on the dish names in the preset dish entity library; an artificial processing unit for, if there is no dish name in the extraction result, manually extracting the dish name in the semantic text to obtain an extraction result, and performing the operation of expanding the extraction result into a preset dish entity library and performing duplicate removal processing on the dish names in the preset dish entity library; wherein, the extraction unit includes: an entity processing sub-unit for processing the entities in the preset dish entity library to obtain a dish word segmentation library; a preprocessing sub-unit for preprocessing the semantic text to obtain a preprocessing result; a recall sub-unit for recalling the words matched in the preprocessing result according to the dish word segmentation library to obtain a recall result; a recall result judgment sub-unit for judging whether there are any matched words in the recall result; a first determination sub-unit for, if there are any matched words in the recall result, determining the dish name in the semantic text according to the recall result to obtain an extraction result, specifically for: judging whether the extraction result has continuously matched words; if the extraction result has continuously matched words, judging whether there are other words between the verb in the preprocessing result and the matched words; if there are other words between the verb in the preprocessing result and the matched words, judging whether there is the word "的" between the verb and the matched words; if there is the word "的" between the verb and the matched words, combining the word after the last "的" in the preprocessing result and the matched words to form the dish name to obtain the extraction result; if there is no word "的" between the verb and the matched words, combining the words between the verb and the matched words and the matched words to form the dish name to obtain the extraction result; if there are no other words between the verb in the preprocessing result and the matched words, combining the matched words to form the dish name to obtain the extraction result; a second determination sub-unit for, if there are no matched words in the recall result, determining that there is no dish name in the extraction result.
6. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1 to 4.
7. A storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for identifying dish names, storage medium and electronic device
CN110110577A
Entity library updating method and device, computer equipment and storage medium
CN114297207A