Spoken language information extraction method, system, device and medium
By combining the above and current spoken language information, using word segmentation dictionary and processing vector generation technology, the problem of user omitting or multiple entity words in intelligent customer service is solved, and more accurate oral information recognition and ambiguity removal is achieved.
Patent Information
- Application Number
- CN202111632724.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In the prior art, users often omit vocabulary or use multiple entity words when using smart customer service, resulting in the inability to effectively identify the user's spoken information.
By obtaining the user's spoken language information above, generating the above sentence vector, combining the current spoken language information, using a preset word segmentation dictionary to segment the semantics, generate semantic vocabulary groups, and then processing each semantic vocabulary group, generating processing vectors, and finally Generate the final word vector for each word based on the above sentence vector and the processing vector.
It improves the accuracy of intelligent customer service to identify users' oral information, eliminates the ambiguity in the semantics of this sentence, and allows voice assistants to better understand the user's intentions.
Smart Images

Figure CN114358018B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent answering technology, and in particular to a method, system, device and apparatus for extracting spoken information. Background Art
[0002] In intelligent customer service, the current mainstream method to solve the missing information in the above context is based on manual rule processing. Regular sentences are configured according to the characteristics of different entities, and the matched entities belong to this type. There are also methods that use deep learning methods to train neural network models in advance, encode the text and the above context, and input them into the model to identify each entity and its type. The questions raised by users in intelligent customer service will include omissions in the sentence, omissions between contexts, and multiple entity words that may appear in the vocabulary. Summary of the invention
[0003] The technical problem to be solved by the present invention is to overcome the defects in the prior art that users omit words when using intelligent customer service and that vocabulary may have multiple entity words, making it impossible to effectively recognize the user's spoken language, and to provide a method, device and medium for extracting spoken information.
[0004] The present invention solves the above technical problems through the following technical solutions:
[0005] Obtain the user's previous spoken information, and generate a previous sentence vector based on the user's previous spoken information;
[0006] Get the user's current spoken information, which includes the semantics of the sentence;
[0007] The semantics of the sentence is segmented according to the preset word segmentation dictionary to generate semantic vocabulary groups corresponding to each word;
[0008] Process each semantic vocabulary group separately to generate a processing vector corresponding to each word;
[0009] The final word vector of each word is generated according to the previous sentence vector and the processing vector corresponding to the word.
[0010] Preferably, obtaining the user's previous spoken language information and generating the previous sentence vector according to the user's previous spoken language information is specifically as follows:
[0011] The spoken language information of the previous context includes the semantics of the previous context, and the semantics of the previous context are converted into the word vector of the previous context word by word;
[0012] The above action vector is generated according to the action keywords in the above spoken information, the above attention weight is generated according to the above action vector, and the above sentence vector is generated according to the above word vector, the above attention weight and the above action vector.
[0013] Preferably, the semantics of the sentence is segmented according to a preset word segmentation dictionary, and the semantic vocabulary groups corresponding to each word are generated as follows:
[0014] A word segmentation dictionary is preset, and the dictionary includes a plurality of dictionary words. The semantic meaning of the sentence is segmented according to the dictionary words to obtain a plurality of semantic words, and all semantic words containing the same character are classified into a semantic word group corresponding to the character.
[0015] Preferably, each semantic vocabulary group is processed separately to generate a processing vector corresponding to each word as follows:
[0016] The words in the vocabulary group are mapped to vocabulary vectors, and all vocabulary vectors are average-pooled to obtain the processed vector.
[0017] Preferably, generating the final word vector of each word according to the previous sentence vector and the processing vector corresponding to the word is specifically:
[0018] Select a target word in the semantics of this sentence, input the processing vectors corresponding to all the words before the target word into the encoder from front to back, obtain the previous semantic vector, generate a probability coefficient a, a is a real number greater than or equal to 0 and less than or equal to 1, add the previous semantic vector and the previous sentence vector to obtain the sum vector, add a times the sum vector and 1-a times the processing vector to obtain the final word vector of the target word.
[0019] Preferably, the method further comprises: inputting the final word vector into a conditional random field to output a final sentence vector, wherein the conditional random field is used to determine the order of the final word vector.
[0020] Preferably, the method further comprises:
[0021] The final word vector is input into the conditional random field to output the final sentence vector, and the conditional random field is used to determine the order of the final word vector.
[0022] Preferably, the method comprises:
[0023] The steps of obtaining the user's subsequent spoken language information, generating a subsequent sentence vector according to the user's subsequent spoken language information, and generating a final word vector for each word according to the previous sentence vector and the processing vector corresponding to the word specifically include generating a final word vector for each word according to the previous sentence vector, the following sentence vector and the processing vector corresponding to the word.
[0024] As a second aspect of the present invention, the present invention provides a spoken information extraction system, the system comprising an information acquisition module, a vocabulary segmentation module, a vector processing module and a final word vector generation module;
[0025] The information acquisition module is used to obtain the user's previous spoken information and the user's current spoken information, and the current spoken information includes the semantics of the current sentence;
[0026] The vector processing module is used to generate a previous sentence vector according to the user's previous spoken information;
[0027] The vocabulary segmentation module is used to segment the sentence semantics according to the preset word segmentation dictionary and generate semantic vocabulary groups corresponding to each word;
[0028] The word vector generation module is used to generate a final word vector for each word according to the previous sentence vector and the processing vector corresponding to the word.
[0029] As a third aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned spoken information extraction method when executing the computer program.
[0030] As a fourth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method for extracting spoken information as described above is implemented.
[0031] The positive and progressive effects of the present invention are:
[0032] The current spoken information and the previous spoken information are combined for judgment, so that the voice assistant can understand the semantics of the current user more accurately. On the basis of combining the current spoken information with the previous spoken information, the semantics of the sentence is segmented, and the vocabulary in the semantics of the sentence is found as much as possible to eliminate the ambiguity in the semantics of the sentence. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Schematic diagram of the flow of the spoken information extraction method of embodiment 1 of the present invention.
[0034] Figure 2 This is a flow chart of generating a context sentence vector based on the user's context spoken information in the spoken information extraction method of Embodiment 1 of the present invention.
[0035] Figure 3 This is a schematic diagram of generating a context sentence vector based on the user's context spoken information in the spoken information extraction method of embodiment 1 of the present invention.
[0036] Figure 4 This is a flow chart of segmenting the semantics of a sentence according to a preset word segmentation dictionary and generating a semantic vocabulary group corresponding to each word in the spoken information extraction method of embodiment 1 of the present invention.
[0037] Figure 5 This is a schematic diagram of segmenting the semantics of the sentence according to a preset word segmentation dictionary in the spoken information extraction method of embodiment 1 of the present invention to generate a semantic vocabulary group corresponding to each word.
[0038] Figure 6 This is a flow chart of generating a final word vector for each word according to the previous sentence vector and the processing vector corresponding to the word in the spoken information extraction method of embodiment 1 of the present invention.
[0039] Figure 7 This is a schematic diagram of generating a final word vector for each word based on the previous sentence vector and the processing vector corresponding to the word in the spoken information extraction method of embodiment 1 of the present invention.
[0040] Figure 8 This is a flow chart of another solution of the spoken information extraction method of embodiment 1 of the present invention.
[0041] Fig. 9 It is a structural diagram of a spoken information extraction system provided in Example 2 of the present invention.
[0042] Fig.10 It is a structural schematic diagram of an electronic device provided in Example 3 of the present invention. DETAILED DESCRIPTION
[0043] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.
[0044] Example 1
[0045] See also Figure 1 This embodiment provides a method for extracting spoken information, comprising the steps of:
[0046] S1. Obtain the user's previous spoken information and generate a previous sentence vector based on the user's previous spoken information;
[0047] S2, obtaining the user's current spoken information, which includes the semantics of the sentence;
[0048] S3, segmenting the sentence semantics according to a preset word segmentation dictionary, and generating a semantic vocabulary group corresponding to each word;
[0049] S4, processing each semantic vocabulary group separately to generate a processing vector corresponding to each word;
[0050] S5. Generate a final word vector for each word according to the previous sentence vector and the processing vector corresponding to the word.
[0051] In this embodiment, for example, when the user's previous spoken information is "What is the weather in Shanghai today?", and the current spoken information is "I want to go to People's Park." Since there are multiple People's Parks across the country, it can be determined that the destination is People's Park in Shanghai based on the previous spoken information and People's Park. And in actual use, there will be some words that can be divided into multiple phrases. For example, "I want to go to Shanghai Guest House." In "Shanghai Guest House", it can be divided into multiple words "Shanghai", "Welcome", "Welcome Hotel" and "Hotel", and the ambiguity of multiple words can be eliminated through the previous spoken information.
[0052] See also Figure 2 Specifically, step S1 is as follows:
[0053] S11, the spoken information in the previous text includes the semantics of the previous text;
[0054] S12, generating a word vector for the above semantics word by word;
[0055] S13, generating a previous action vector according to the action keywords in the previous spoken information, and generating a previous attention weight according to the previous momentum;
[0056] S14. Generate a previous sentence vector based on the previous text vector, the previous attention weight, and the previous action vector.
[0057] When applying, see Figure 3 , ACTION is the action keyword in the spoken information above, W refers to vectorizing ACTION to obtain the action vector above, and reading the user's dynamic information (a type of spoken information above), inputting the dynamic information into BiLSTM (a type of encoder) to obtain Attention, Attention represents the attention mechanism above, and the five squares on the right represent the sentence vector above. In this embodiment, for example, if the spoken information above is "I want to go to Century Park." It will be recognized that the user needs to go to a place, and the word "Century Park" will be given more weight.
[0058] See also Figure 4 Specifically, step S3 is as follows:
[0059] S31, presetting a word segmentation dictionary, the dictionary including a number of dictionary words;
[0060] S32, segmenting the semantics of the sentence according to dictionary vocabulary to obtain a plurality of semantic vocabulary, and classifying all semantic vocabulary containing the same character into a semantic vocabulary group corresponding to the character.
[0061] See also Figure 5, in this embodiment, the dictionary words include Shanghai, Yingbin Hotel, and Hotel. The words "Shanghai Yingbin Hotel" are split character by character, and for each character, the dictionary words containing that character are found and grouped as a set; for example, in this case, the only dictionary word containing the character "上" is "上海"; <pad>It means that there are no other dictionary words containing "up", so the language vocabulary group of "up" only has "Shanghai". The semantic vocabulary groups of the other characters are the same and will not be elaborated here.
[0062] Specifically, step S4 is specifically as follows:
[0063] S41. Map the words in the vocabulary group to word vectors, and average-pool all the word vectors to obtain a processed vector.
[0064] In Figure 5 , "AVERAGE" represents average pooling. The squares above each character represent the processed vectors corresponding to that character.
[0065] Please refer to Figure 6 , specifically, step S5 is specifically as follows:
[0066] S51. Select a target character in the semantics of this sentence, and input the processed vectors corresponding to all the characters before the target character into the encoder from front to back to obtain a pre-semantic vector;
[0067] S52. Generate a probability coefficient a, where a is a real number greater than or equal to 0 and less than or equal to 1;
[0068] S53. Add the pre-semantic vector and the above-sentence vector to obtain a sum vector;
[0069] S54. Add a times the sum vector and (1 - a) times the processed vector to obtain the final word vector of the target character.
[0070] Please refer to Figure 7 , the five squares in the lower left represent the processed vectors, and the five squares in the lower right represent the pre-semantic vectors.
[0071] In this embodiment, the probability coefficient can be used to determine whether the above-sentence spoken information or the semantics of this sentence is more important, and an accurate final word vector can be obtained.
[0072] Specifically, the method further includes:
[0073] Input the final word vector into a conditional random field to output a final sentence vector;
[0074] The conditional random field is used to determine the order of the final word vectors.
[0075] In this embodiment, the order of the output of each character corresponding to the final word vector is mostly disrupted. In order to keep the output of the final word vector consistent with the semantics of this sentence, it is output to the conditional random field.
[0076] Specifically, please refer to Figure 8 , step S5 specifically includes:
[0077] S501, obtaining the user's subsequent spoken language information, and generating a subsequent sentence vector according to the user's subsequent spoken language information;
[0078] S502 : Generate a final word vector for each word according to the previous sentence vector, the next sentence vector, and the processing vector corresponding to the word.
[0079] In this embodiment, when the following spoken language information is included, a following sentence vector can be generated according to the following spoken language information. The process of generating the following sentence vector is the same as that of generating the preceding sentence vector, and will not be repeated here.
[0080] In this embodiment, a target word in the semantics of this sentence is selected, and the processing vectors corresponding to all the words before the target word are input into the encoder from front to back to obtain a front semantic vector; the processing vectors corresponding to all the words after the target word are also input into the encoder from back to front to obtain a back semantic vector; the front semantic vector, the back semantic vector, the previous sentence vector and the next sentence vector are added to obtain the sum vector in this embodiment; a times the sum vector and 1-a times the processing vector are added to obtain the final word vector of the target word.
[0081] In this embodiment, in the aforementioned embodiment, not only can the preceding spoken language information be compared with the semantics of the current sentence, but the following spoken language information may also be compared with the semantics of the current sentence, thereby obtaining a more accurate final word vector.
[0082] Example 2
[0083] See also Fig. 9 , this embodiment provides a spoken information extraction system, the system includes an information acquisition module 201, a vocabulary segmentation module 202, a vector processing module 203 and a final word vector generation module 204;
[0084] The information acquisition module 201 is used to acquire the user's previous spoken information and the user's current spoken information, wherein the current spoken information includes the semantics of the current sentence;
[0085] The lexical segmentation module 202 is used to segment the sentence semantics according to a preset word segmentation dictionary to generate a semantic vocabulary group corresponding to each word;
[0086] The vector processing module 203 is used to generate a previous sentence vector according to the previous spoken language information of the user;
[0087] The word vector generating module 204 is configured to generate a final word vector for each word according to the previous sentence vector and the processing vector corresponding to the word.
[0088] The operation logic of the spoken language information extraction system of this embodiment corresponds to the spoken language information extraction method in Example 1, and will not be repeated here.
[0089] Example 3
[0090] Fig.10 The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method for extracting spoken information in Example 1 is implemented. Fig.10 The electronic device 30 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0091] like Fig.10 As shown, the electronic device 30 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including the memory 32 and the processor 31).
[0092] The bus 33 includes a data bus, an address bus, and a control bus.
[0093] The memory 32 may include a volatile memory, such as a random access memory (RAM) 321 and / or a cache memory 322 , and may further include a read-only memory (ROM) 323 .
[0094] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, such program modules 324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0095] The processor 31 executes various functional applications and data processing by running the computer programs stored in the memory 32, such as the spoken language information extraction method of embodiment 1 of the present invention.
[0096] The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 35. Furthermore, the model-generated device 30 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 36. As shown, the network adapter 36 communicates with other modules of the model-generated device 30 via a bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (RAID) systems, tape drives, and data backup storage systems.
[0097] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0098] Example 4
[0099] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the spoken language information extraction method of Embodiment 1 are implemented.
[0100] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.
[0101] In a possible implementation manner, the present invention may also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of the spoken language information extraction method of Example 1.
[0102] Among them, the program code for executing the present invention can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.
[0103] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.< / pad>
Claims
1. A method for extracting spoken information, characterized in that: Includes steps: Acquire the user's previous spoken language information, and generate a previous sentence vector according to the user's previous spoken language information; Acquire the user's current spoken language information, wherein the current spoken language information includes the semantics of the current sentence; The semantics of the sentence is segmented according to the preset word segmentation dictionary to generate semantic vocabulary groups corresponding to each word; Process each semantic vocabulary group separately to generate a processing vector corresponding to each word; Generating a final word vector for each word according to the previous sentence vector and the processing vector corresponding to the word; The obtaining of the user's previous spoken language information and generating a previous sentence vector according to the user's previous spoken language information is specifically as follows: The above spoken language information includes the above semantics; Generate a word vector for each word of the above semantics; Generate a previous text action vector according to the action keywords in the previous text spoken information, and generate a previous text attention weight according to the previous text action vector; The previous sentence vector is generated according to the previous word vector, the previous attention weight and the previous action vector.
2. The method for extracting spoken information according to claim 1, wherein: The semantic segmentation of the sentence is performed according to the preset word segmentation dictionary to generate the semantic vocabulary group corresponding to each word: Presetting the word segmentation dictionary, wherein the dictionary includes a plurality of dictionary words; The semantics of the sentence are segmented according to the dictionary vocabulary to obtain a plurality of semantic vocabulary, and all semantic vocabulary containing the same character are classified into a semantic vocabulary group corresponding to the character.
3. The method for extracting spoken information according to claim 1, wherein: Each semantic vocabulary group is processed separately to generate a processing vector corresponding to each word: The words in the vocabulary group are mapped into vocabulary vectors, and all the vocabulary vectors are average-pooled to obtain the processing vector.
4. The method for extracting spoken information according to claim 1, wherein: The method of generating the final word vector of each word according to the previous sentence vector and the processing vector corresponding to the word is specifically as follows: Select a target word in the semantics of this sentence, and input the processing vectors corresponding to all words before the target word into the encoder from front to back to obtain the front semantic vector; Generate a probability coefficient a, where a is a real number greater than or equal to 0 and less than or equal to 1; Add the previous semantic vector and the previous sentence vector to obtain a sum vector; The sum vector times a is added to the processing vector times 1-a to obtain a final word vector of the target word.
5. The method for extracting spoken information according to claim 1, wherein: The method further comprises: Input the final word vector into a conditional random field to output a final sentence vector; The conditional random field is used to determine the order of the final word vectors.
6. The spoken language information extraction method according to claim 1, characterized in that: The method comprises: Acquire the user's subsequent spoken language information, and generate a subsequent sentence vector according to the user's subsequent spoken language information; The step of generating a final word vector for each word according to the previous sentence vector and the processing vector corresponding to the word specifically includes: A final word vector for each word is generated according to the previous sentence vector, the next sentence vector, and a processing vector corresponding to the word.
7. A spoken information extraction system, characterized in that: The system includes an information acquisition module, a vocabulary segmentation module, a vector processing module and a final word vector generation module; The information acquisition module is used to acquire the user's previous spoken information and the user's current spoken information, wherein the current spoken information includes the semantics of the current sentence; the previous spoken information includes the semantics of the previous sentence; The vector processing module is used to generate a previous sentence vector according to the previous spoken language information of the user; Including, generating a text vector from the text semantics word by word; generating a text action vector from the text according to the action keywords in the text spoken information, generating a text attention weight from the text action vector, and generating a text sentence vector from the text vector, the text attention weight and the text action vector; The vocabulary segmentation module is used to segment the sentence semantics according to a preset word segmentation dictionary to generate a semantic vocabulary group corresponding to each word; The final word vector generating module is used to generate a final word vector for each word according to the previous sentence vector and a processing vector corresponding to the word.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the spoken language information extraction method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the spoken language information extraction method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Information processing method and device, electronic equipment and storage medium
CN111783429A
Text intention recognition method and device, electronic equipment and storage medium
CN112183101A