Target voice information determination method and device, electronic equipment and storage medium
By determining the target voice text based on the updated preset keywords and using the second preset keyword to recognize the target voice information, the problem of not being able to quickly determine the target voice information in the prior art is solved, and efficient and accurate voice recognition is achieved.
Patent Information
- Application Number
- CN202510052944.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-14
AI Technical Summary
Intelligent voice recognition technology cannot quickly determine the target voice information required by users when there are few data processing resources, low hardware level and low recognition requirements.
By responding to the first determination instruction, the target starting keyword and the target end keyword in the initial speech text are determined based on the updated first preset keyword, thereby intercepting the target speech text. Then, based on the second preset keyword, the first target keyword and its type in the target voice text are determined to quickly identify the target voice information.
This method can quickly reduce the demand for data processing resources, adapt to the ever-changing oral expression methods, accurately identify target voice information, and improve the efficiency and accuracy of voice recognition.
Smart Images

Figure CN119889326A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of speech recognition technology, and in particular to a method, device, electronic device and storage medium for determining target speech information. Background Art
[0002] With the continuous development of intelligent technology, the field of intelligent speech recognition technology has become a hot technology. Intelligent speech recognition technology mainly relies on complex recognition models, which can recognize the entire text of the initial speech, that is, directly translate the entire initial speech into speech text, which obviously requires huge data processing resources and data processing time. Especially when there are few data processing resources, low hardware level, and low recognition requirements, it is impossible to quickly determine the target speech information required by the user. Summary of the invention
[0003] In view of the above problems, the present application provides a method, device, electronic device and storage medium for determining target voice information, which are used to quickly determine the target voice information required by the user.
[0004] According to one aspect of the present application, a method for determining target voice information is provided, the determination method comprising: in response to a first determination instruction, determining a target start keyword and a target end keyword in an initial voice text based on an updated first preset keyword; wherein the target start keyword and the target end keyword are respectively the start keyword that appears for the first time and the end keyword that appears for the last time in the initial voice text, and the updated first preset keyword is a word obtained after updating the original first preset keyword; according to the target start keyword and the target end keyword, determining a target voice text from the initial voice text; according to a second preset keyword, determining a first target keyword in the target voice text and a type to which the first target keyword belongs, so as to determine the target voice information in the target voice text.
[0005] In an optional manner, the determination method also includes: in response to a second determination instruction, determining a second target keyword in the initial voice text and a type to which the second target keyword belongs based on the second preset keyword, so as to determine the target voice information in the initial voice text; wherein the number of the second target keywords is greater than or equal to the number of the first target keywords.
[0006] In an optional manner, the determination method also includes: if the specified keyword in the target voice text fails to match all the second preset keywords, then escaping the specified keyword based on a preset character escape function; if the escaped characters include characters representing time, then determining that the specified keyword is the first target keyword of the time type.
[0007] In an optional manner, the first target keyword in the target voice text and the type to which the first target keyword belongs are determined based on the second preset keyword to determine the target voice information in the target voice text, including: taking the words in the target voice text that match the second preset keyword as the first target keyword, and taking the preset type corresponding to the successfully matched second preset keyword as the type to which the first target keyword belongs; wherein each second preset keyword corresponds to its own preset type; and taking the type to which the first target keyword belongs as the information header of the first target keyword to determine the target voice information in the target voice text.
[0008] In an optional manner, before taking the words in the target voice text that match the second preset keyword as the first target keyword, the determination method also includes: traversing each preset type, and taking the second preset keyword corresponding to the traversed preset type as the target second preset keyword; wherein each preset type corresponds to at least one second preset keyword, and the second preset keywords corresponding to each preset type include spacing characters; matching each word in the target voice text with the target second preset keyword to obtain the words in the target voice text that match the target second preset keyword, so as to obtain the words in the target voice text that match the second preset keyword.
[0009] In an optional manner, the target voice text is determined from the initial voice text based on the target starting keyword and the target ending keyword, including: taking the voice text after the target starting keyword in the initial voice text as the first voice text, and taking the voice text before the target ending keyword in the initial voice text as the second voice text; and determining the overlapping voice text between the first voice text and the second voice text as the target voice text.
[0010] In an optional manner, the first preset keyword includes a preset starting keyword and a preset ending keyword; the target starting keyword and the target ending keyword in the initial voice text are determined based on the updated first preset keyword, including: if the target word successfully matches the preset starting keyword, the target word is determined as the starting keyword in the initial voice text to determine all the starting keywords in the initial voice text; wherein the target word is any word in the initial voice text; if the target word successfully matches the preset ending keyword, the target word is determined as the ending keyword in the initial voice text to determine all the ending keywords in the initial voice text; the starting keyword that appears for the first time in the initial voice text is used as the target starting keyword, and the ending keyword that appears for the last time in the initial voice text is used as the target ending keyword.
[0011] According to another aspect of the present application, a device for determining target voice information is provided, the determination device comprising: a first response module, which responds to a first determination instruction and determines a target start keyword and a target end keyword in an initial voice text based on an updated first preset keyword; wherein the target start keyword and the target end keyword are respectively the start keyword that appears for the first time and the end keyword that appears for the last time in the initial voice text, and the updated first preset keyword is a word obtained after updating the original first preset keyword; a text determination module, which determines a target voice text from the initial voice text according to the target start keyword and the target end keyword; and an information determination module, which determines the first target keyword in the target voice text and the type to which the first target keyword belongs according to a second preset keyword, so as to determine the target voice information in the target voice text.
[0012] According to one aspect of the present application, an electronic device is provided, including: a controller; and a memory for storing one or more programs, wherein when the one or more programs are executed by the controller, the above-mentioned determination method is executed.
[0013] According to one aspect of the present application, a computer-readable storage medium is also provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the above-mentioned determination method.
[0014] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned determination method.
[0015] The present application determines the target start keyword and target end keyword in the initial voice text through the updated first preset keyword, so as to intercept the initial voice text, determine the target voice text, and focus on identifying part of the text in the initial voice text, thereby reducing the demand for data processing resources. Among them, the present application can update the first preset keyword in real time to adapt to the ever-changing spoken expression, so as to better identify the target voice text where the target voice information is located. The present application determines the first target keyword of the corresponding type from the target voice text according to the second preset keyword, and can quickly identify the key voice information, thereby quickly determining the target voice information in the target voice text.
[0016] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 It is a flowchart of a method for determining target voice information shown in an exemplary embodiment of the present application.
[0019] Figure 2 It is a schematic diagram of a function switch setting interface shown in an exemplary embodiment of the present application.
[0020] Figure 3 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for determining target voice information.
[0021] Figure 4 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for determining target voice information.
[0022] Figure 5 is based on Figure 1 , Figure 3 , Figure 4 A flowchart of another method for determining target voice information is shown in any of the exemplary embodiments shown in FIG.
[0023] Figure 6 It is a flowchart of the execution scenario of the method for determining target voice information of the present application.
[0024] Figure 7 It is a structural diagram of a device for determining target voice information shown in an exemplary embodiment of the present application.
[0025] Figure 8 It is a structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0026] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0027] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0028] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0029] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0030] Intelligent speech recognition technology mainly relies on complex recognition models, which can recognize the entire text of the initial speech, that is, directly translate the entire initial speech into speech text. This obviously requires huge data processing resources and data processing time. Especially when there are few data processing resources, low hardware level, and low recognition requirements, it is impossible to quickly determine the target speech information required by the user.
[0031] To this end, one aspect of the present application provides a method for determining target voice information. Figure 1 , Figure 1 FIG. 1 is a flow chart of a method for determining target voice information shown in an exemplary embodiment of the present application. The determination method at least includes S110 to S130, which are described in detail as follows:
[0032] S110: In response to the first determination instruction, a target start keyword and a target end keyword in the initial voice text are determined based on the updated first preset keyword; wherein the target start keyword and the target end keyword are respectively the start keyword that appears for the first time and the end keyword that appears for the last time in the initial voice text, and the updated first preset keyword is a word obtained after updating the original first preset keyword.
[0033] The first confirmation instruction indicates that when the start keyword is recognized, the confirmation function of the target voice information is turned on, and when the end keyword is recognized, the instruction for ending the confirmation of the target voice information is ended. The start keyword is a leading start word that indicates important information, such as "I'll record it", "need to be confirmed", "I'll confirm it", "order information", "detailed information", "transportation information", "information confirmation", "content record" and other keywords; the end keyword is a post-ending word that indicates the end of important information, such as "thank you and goodbye", "all information has been confirmed", "content has been recorded", "summary completed", "everything has been handled" and other keywords.
[0034] The update permission of the first preset keyword is open to users, that is, users can update the first preset keyword in real time through voice input, text input, etc., including but not limited to modification, addition, deletion and other update methods to adapt to different usage scenarios. The updated first preset keyword can be persistently stored, for example, stored in a configuration file named globals.json, to ensure the persistence and consistency of the keyword so that it can be quickly called when needed.
[0035] Exemplarily, the first preset keyword includes a preset starting keyword and a preset ending keyword; S110 includes: if the target word successfully matches the preset starting keyword, the target word is determined as the starting keyword in the initial voice text to determine all the starting keywords in the initial voice text; wherein, the target word is any word in the initial voice text; if the target word successfully matches the preset ending keyword, the target word is determined as the ending keyword in the initial voice text to determine all the ending keywords in the initial voice text; the starting keyword that appears for the first time in the initial voice text is used as the target starting keyword, and the ending keyword that appears for the last time in the initial voice text is used as the target ending keyword.
[0036] For example, based on two different threads, preset starting keywords and preset ending keywords are loaded at the same time, and each word in the initial voice text is matched with the preset starting keyword and the preset ending keyword respectively to determine all starting keywords and ending keywords in the initial voice text, thereby determining the target starting keyword and the target ending keyword. By performing matching operations through parallel threads, the analysis of the initial voice text can be completed quickly, thereby quickly determining the target starting keyword and the target ending keyword, so as to quickly intercept the target voice text. Among them, the target words matched by the two parallel threads at the same time can be the same or different.
[0037] In some embodiments, in order to more quickly determine the target starting keyword and the target ending keyword, the thread for determining the starting keyword matches the words in the initial text based on the positive order (i.e., matches from the starting word of the initial text), and uses the first matched starting keyword as the target starting keyword; the thread for determining the ending keyword matches the words in the initial text based on the reverse order (i.e., matches from the ending word of the initial text), and uses the first matched ending keyword as the target ending keyword.
[0038] In some scenarios, the initial voice text comes from the call voice, which contains at least one starting keyword and at least one ending keyword. The related technology uses a starting keyword and an adjacent ending keyword to intercept the voice text, which will result in the omission of important information. For example, the initial voice text is: "Hello!... I confirm... Everything has been handled. Meet at XX at 9:00. Summary completed." Among them, "I confirm" is the starting keyword, "Everything has been handled" and "Summary completed" are the ending keywords. If the interception method of the related technology is used, when "Everything has been handled" is identified, the recognition of subsequent key information will be stopped, thereby missing the key information of "Meet at XX at 9:00".
[0039] To this end, this embodiment uses the first appearing start keyword and the last appearing end keyword as the intercepted keywords of the target speech, thereby ensuring that key information is not missed. In some embodiments, if the initial speech includes the start keyword but does not include the end keyword, the speech text between the adjacent post-word of the first start keyword (i.e., the target start keyword) and the end word of the text is used as the target speech text, that is, the last word in the initial text is used as the target end keyword by default.
[0040] S120: Determine a target voice text from the initial voice text according to the target start keyword and the target end keyword.
[0041] When the target starting keyword is recognized, all words in the voice information after the word are analyzed; and when the target ending keyword is recognized, the voice analysis is stopped, that is, there is no need to analyze the voice text after the keyword, so that the target starting keyword and the target ending keyword are used as two end value keywords to quickly extract the target voice text from the initial voice text, so as to avoid unnecessary analysis of other parts of the voice text.
[0042] Exemplarily, the speech text after the target start keyword in the initial speech text is taken as the first speech text, and the speech text before the target end keyword in the initial speech text is taken as the second speech text; the overlapping speech text between the first speech text and the second speech text is determined as the target speech text.
[0043] For example, the thread for determining the start keyword matches the words in the initial text based on the positive order, takes the first start keyword obtained by the match as the target start keyword, and takes the voice text after the word as the first voice text. The thread for determining the end keyword matches the words in the initial text based on the reverse order, takes the first end keyword obtained by the match as the target end keyword, and takes the voice text after the word as the second voice text. The first text and the second text are intersected, and the overlapping text is the target voice text.
[0044] S130: Determine the first target keyword in the target voice text and the type to which the first target keyword belongs according to the second preset keyword, so as to determine the target voice information in the target voice text.
[0045] The second preset keywords are words used to determine the substantive information in the target voice text, including but not limited to words representing multiple types of meanings, where the types include: vehicle type, location, transportation status, cargo type, time type, etc., and each type includes at least one second preset keyword. For example, the second preset keywords of the vehicle type include: medium-sized van, truck, moving truck, closed truck, etc.
[0046] In some embodiments, the number of the determined first target keywords is multiple, and each first target keyword and its type can be combined, and the target voice information can be constructed based on the multiple combinations.
[0047] This embodiment determines the target start keyword and target end keyword in the initial voice text through the updated first preset keyword, so as to intercept the initial voice text, determine the target voice text, and focus on identifying part of the text in the initial voice text, thereby reducing the demand for data processing resources. Among them, this embodiment can update the first preset keyword in real time to adapt to the ever-changing oral expression, so as to better identify the target voice text where the target voice information is located. This embodiment determines the first target keyword of the corresponding type from the target voice text according to the second preset keyword, and can quickly identify the key voice information, thereby quickly determining the target voice information in the target voice text.
[0048] In this embodiment, the method for determining the target voice information is triggered only when the relevant first preset keyword is recognized. In order to more flexibly recognize the target voice information, another always-triggered method is also provided, that is, the target voice information is determined without recognizing the first preset keyword. Figure 2 As shown, the function switch is set with three different function activation modes: "always on", "on triggered by the first preset keyword", and "always off", among which the user can adaptively modify the preset starting keyword and the preset ending keyword.
[0049] Please refer to Figure 3 , Figure 3 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for determining target voice information. The determination method is as follows Figure 1 Based on the S110 to S130 shown, at least S310 is also included, which is described in detail as follows:
[0050] S310: In response to the second determination instruction, according to the second preset keyword, determine the second target keyword in the initial voice text and the type of the second target keyword to determine the target voice information in the initial voice text; wherein the number of the second target keywords is greater than or equal to the number of the first target keywords.
[0051] The second determination instruction is an instruction that represents the unconditional triggering of the target voice information determination function, that is, there is no need to match the first preset keyword to the initial voice text, and it starts from the first word of the initial voice text and directly matches with the second preset keyword.
[0052] Exemplarily, the initial voice text is: "Hello!... I confirm... everything has been handled. We will meet at XX at 9:00 and the summary is complete." In response to the second confirmation instruction, starting from "Hello", each word in the initial voice text is matched with the second preset keyword one by one, and the second target keyword in the initial voice text and the type of the second target keyword are directly determined to construct the target voice information.
[0053] Because this determination method directly performs voice information recognition on the initial voice text, all key information in the initial voice text can be determined without omission, thereby making the determined target voice information more complete.
[0054] When identifying time-type keywords, due to the diversity of spoken expressions of time-type keywords, the set second preset keywords cannot cover all time-type keywords, resulting in omissions in the identification of time information.
[0055] To this end, in another exemplary embodiment of the present application, a method for determining a time type keyword is introduced. For details, please refer to Figure 4 , Figure 4 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for determining target voice information. The determination method is as follows Figure 1 Based on the S110 to S130 shown, at least S410 to S420 are also included, which are described in detail as follows:
[0056] S410: If the designated keyword in the target voice text fails to match all the second preset keywords, an escape operation is performed on the designated keyword based on a preset character escape function.
[0057] In one embodiment, the preset character escape function is a reversible function, which can escape a specified keyword into a specified character, or can escape a specified character into a specified keyword, that is, the preset character escape function is a mapping relationship between a specified keyword and a specified character.
[0058] In another embodiment, the preset character escape function is a decryption function, and the designated keyword and the preset key are input into the decryption function to decrypt and obtain the corresponding character.
[0059] S420: If the escaped characters include characters representing time, it is determined that the designated keyword is a first target keyword of the time type.
[0060] For example, if the designated keyword "9:01" does not successfully match any second preset keyword, it is escaped to nine o'clock and one minute, or 09-01 based on the preset character escape function. Among them, "point" and "-" are characters representing time, so "9:01" is determined as the first target keyword of the time type. When outputting the target voice information, "the time is 9:01" can be directly output, or "the time is nine o'clock and one minute", or "09-01" can be output.
[0061] In some embodiments, if the first target keyword of the time type is determined, the first target keyword will be converted into a more accurate expression according to the current time. For example, the current time is 9:00 on December 17, 2024, and the first target keyword is "2:00 p.m.", and the two are combined, that is, "2:00 p.m." is converted into "14:00 on December 17, 2024", thereby unifying the time type keywords in the entire target voice text, so as to facilitate users to quickly extract the corresponding time parameters based on the same time expression standard.
[0062] In another exemplary embodiment of the present application, it is described in detail how to determine the first target keyword in the target voice text and the type of the first target keyword according to the second preset keyword to determine the target voice information in the target voice text. For details, please refer to Figure 5 , Figure 5 is based on Figure 1 , Figure 3 , Figure 4 A flowchart of another method for determining target voice information is shown in any of the exemplary embodiments shown in FIG. The determination method in the above S130 at least further includes S510 to S520, which are described in detail as follows:
[0063] S510: Use the words in the target voice text that match the second preset keyword as the first target keyword, and use the preset type corresponding to the successfully matched second preset keyword as the type to which the first target keyword belongs; wherein each second preset keyword corresponds to its own preset type.
[0064] The preset types corresponding to different second preset keywords can be the same or different, depending on their own meanings. For example, the preset type corresponding to the second preset keyword "in transit" is the transportation status type, the preset type corresponding to the second preset keyword "arrived" is the transportation status type, and the preset type corresponding to the second preset keyword "empty vehicle" is the vehicle status type.
[0065] The target voice text includes multiple words, all of which can be matched with each second preset keyword. The matching process also needs to consider the preset type to which each second preset keyword belongs. The following is an exemplary description of how to determine the words that match the second preset keyword:
[0066] Traverse each preset type, and use the second preset keyword corresponding to the traversed preset type as the target second preset keyword; wherein each preset type corresponds to at least one second preset keyword, and the second preset keywords corresponding to each preset type include spacing characters; match each word in the target voice text with the target second preset keyword to obtain the word in the target voice text that matches the target second preset keyword, so as to obtain the word in the target voice text that matches the second preset keyword.
[0067] By traversing, each word in the target voice text can be matched without omission, so as to match the second preset keywords of the preset type that they traversed one by one, thereby accurately determining all the words in the target voice text that successfully match the traversed second preset keywords, and so on, determine the words in the target voice text that match the second preset keywords.
[0068] S520: Using the type to which the first target keyword belongs as the information header of the first target keyword to determine the target voice information in the target voice text.
[0069] The type to which the first target keyword belongs is a summary of its semantic superordinate, which represents the catalog or collection of categories to which it belongs. For example, the first target keyword "morning" belongs to the time type, that is, "morning" is classified as a time category word; the first target keywords "rainy day", "cloudy day", "sunny day" belong to the weather type.
[0070] Putting the type of the first target keyword in front of the first target keyword can summarize the key information of the adjacent first target keyword. For example, the target voice information is: "Time: 9:10", which can intuitively and concisely express the key information that the target voice information in the target voice text wants to express.
[0071] In another exemplary embodiment of the present application, the execution scenarios of the above-mentioned multiple determination methods are exemplarily described. Figure 6 , Figure 6It is a flowchart of the execution scenario of the method for determining the target voice information of the present application. The execution subject in the execution scenario is a voice recognition program. After the voice recognition program is started, the loading file is determined according to different determination instructions; wherein, it includes a first determination instruction (matching the first preset keyword to turn on), a second determination instruction (always on) and a third determination instruction (always off). If the voice recognition program detects the first determination instruction or the second determination instruction, it will call the updateEnginer function, which is responsible for updating the global rule engine configuration. Inside the function, the previous coroutine job (if it exists) is first canceled, and then a new coroutine is started, and the contents of the corresponding files (filter.json files and / or global.json files) are read using IO stream technology.
[0072] If it is the first determination instruction, two threads in the process of the speech recognition program simultaneously load the filter.json file and the global.json file to quickly load the first preset keyword in the global.json file and the second preset keyword in the filter.json file into the speech recognition program. For example, the FileUtil.openAssets() method is used to read the globals.json file and the filter.json file in the corresponding child thread, wherein the two lists of globals.json are converted into set collections in the code after being read. The exemplary code is as follows:
[0073] val startKeywords = setOf("I record it", "I confirm it", "Need to confirm", "Order information", "Detailed information", "Transportation information", "Information confirmation", "Content record")
[0074] val endKeywords=setOf("Thank you and goodbye","All information has been confirmed","All content has been recorded","Summary completed","Task completed","All information confirmed","Everything has been handled","Handover completed","No other questions","Confirmed","End recording")
[0075] Among them, after reading each list in the fifty.json file, it is converted into a regular expression object in the code, for example:
[0076] valCargo Type =
[0077] Regex("[^。]*?(furniture|appliances|books|clothing|kitchen supplies|office equipment|personal items|cardboard boxes|household items|electronics|clothing boxes|luggage|moving items|heavy equipment|relocation tools|television sets|refrigerators|sofas|mattresses|dining tables|desks|computers|bookcases|audio equipment|kitchen appliances|small appliances|fitness equipment)[^。]*[。]")
[0078] val time =
[0079] Regex("[^。]*?(Morning|Noon|Afternoon|Evening|About to depart|Ready to depart|On time|Delayed|Overtime|Emergency|Time limit|Long distance|Short distance|About to arrive|Estimated arrival time|Cargo loading time|Emergency transportation|Rest during the journey|Peak hours|Off-peak hours|Scheduled delivery time|Vehicle dispatch time)[^。]*[。]")
[0080] Match the words in the initial voice text with the first preset keyword, for example, using the matchGlobals(result:String,globals:GlobalDescript?=null) method for text matching. Where: result represents the initial voice text. Globals represents the data structure (startKeywords, endKeywords) in the start and end rule engine, i.e., the start keyword and the end keyword, which contains a collection of different commands and keywords. The exemplary matching code is as follows:
[0081] val startKeywords = setOf("I record it", "I confirm it", "Need to confirm", "Order information", "Detailed information", "Transportation information", "Information confirmation", "Content record")
[0082] val endKeywords=setOf("Thank you and goodbye","All information has been confirmed","All content has been recorded","Summary completed","Task completed","All information confirmed","Everything has been handled","Handover completed","No other questions","Confirmed","End recording")
[0083] fun extractSubTextWithRegex(text:String,startKeywords:Set <string>,endKeywords:Set <string>):String? {
[0084] / / Build a regular expression to match paragraphs that start with any keyword in startKeywords and end with any keyword in endKeywords
[0085] val startPattern=startKeywords.joinToString("|"){Regex.escape(it)}
[0086] val endPattern=endKeywords.joinToString("|"){Regex.escape(it)}
[0087] val regexPattern="($startPattern).*?($endPattern)"
[0088] val regex=Regex(regexPattern,RegexOption.DOT_MATCHES_ALL)
[0089] / / Find matching paragraphs
[0090] val matchResult=regex.find(text)
[0091] return matchResult?.value
[0092] }
[0093] The two sets of startKeywords and endKeywords include preset start keywords and preset end keywords respectively. For example, startKeywords includes "I record it" and "I confirm it", which can be used as a start mark; endKeywords includes "Thank you and goodbye" and "The information has been confirmed and completed", which can be used as an end mark.
[0094] extractSubTextWithRegex function: The purpose of this function is to extract a part from the passed text, which meets the following conditions: starting from a keyword in startKeywords and ending with a keyword in endKeywords.
[0095] Regular expression construction: startPattern and endPattern are regular expression patterns dynamically constructed based on startKeywords and endKeywords. joinToString("|") will join all elements in startKeywords and endKeywords into a string separated by |, so that any keyword can be matched in the regular expression. Regex.escape(it) is used to escape special characters (such as ., *, etc.) that may be contained therein to ensure the correctness of the regular expression.
[0096] Regular expression matching: The regular expression ($startPattern).*? ($endPattern) will match a string that starts with a keyword in startPattern and ends with a keyword in endPattern. Here, .*? is a non-greedy match, which will match as few characters in the middle as possible to ensure that the first qualifying substring is matched.
[0097] regex.find(text): Use regex.find() to find the first match of the specified condition in text.
[0098] Return result: If matching content is found, return the content. If not found, return "Nomatching subText found.".
[0099] If the match is successful, the target voice text is determined, and it is matched with the second preset keyword to determine the first target keyword in the target voice text and the type of the first target keyword to determine the target voice information in the target voice text.
[0100] If it is the second confirmation instruction, the process of the speech recognition program loads the filter.json file, that is, loads the second preset keyword therein into the speech recognition program, matches the words in the initial voice text with the second preset keyword, determines the second target keyword in the initial voice text, and the type of the second target keyword, so as to determine the target voice information in the initial voice text.
[0101] If it is the third determination instruction, the file is not loaded and the relevant determination steps of the target voice information are not executed.
[0102] Another aspect of the present application also provides a device for determining target voice information, such as Figure 7 As shown, Figure 7 700 is a schematic diagram of a target voice information determination device according to an exemplary embodiment of the present application. The determination device 700 includes:
[0103] The first response module 710, in response to the first determination instruction, determines a target start keyword and a target end keyword in the initial voice text based on the updated first preset keyword; wherein the target start keyword and the target end keyword are the start keyword that appears for the first time and the end keyword that appears for the last time in the initial voice text, respectively, and the updated first preset keyword is a word obtained after the original first preset keyword is updated;
[0104] A text determination module 730 determines a target voice text from the initial voice text according to the target start keyword and the target end keyword;
[0105] The information determination module 750 determines the first target keyword in the target voice text and the type to which the first target keyword belongs according to the second preset keyword, so as to determine the target voice information in the target voice text.
[0106] In another exemplary embodiment, the determining device 700 further includes:
[0107] The second response module, in response to the second determination instruction, determines the second target keyword in the initial voice text and the type of the second target keyword according to the second preset keyword, so as to determine the target voice information in the initial voice text; wherein the number of the second target keywords is greater than or equal to the number of the first target keywords.
[0108] In another exemplary embodiment, the determining device 700 further includes:
[0109] A matching failure module, if the specified keyword in the target voice text fails to match with all the second preset keywords, performs an escape operation on the specified keyword based on a preset character escape function;
[0110] The first target keyword determination module determines that the designated keyword is a first target keyword of the time type if the escaped characters include characters representing time.
[0111] In another exemplary embodiment, the information determination module 750 includes:
[0112] The matching unit uses the words in the target voice text that match the second preset keyword as the first target keyword, and uses the preset type corresponding to the successfully matched second preset keyword as the type to which the first target keyword belongs; wherein each second preset keyword corresponds to its own preset type;
[0113] The determination unit uses the type to which the first target keyword belongs as the information header of the first target keyword to determine the target voice information in the target voice text.
[0114] In another exemplary embodiment, the determining device 700 further includes:
[0115] A traversal module, traversing each preset type, and taking the second preset keyword corresponding to the traversed preset type as the target second preset keyword; wherein each preset type corresponds to at least one second preset keyword, and the second preset keywords corresponding to each preset type include a spacing character;
[0116] The word matching module matches each word in the target voice text with the target second preset keyword to obtain the words in the target voice text that match the target second preset keyword, so as to obtain the words in the target voice text that match the second preset keyword.
[0117] In another exemplary embodiment, the text determination module 730 includes:
[0118] A text determination unit, which uses the speech text after the target start keyword in the initial speech text as the first speech text, and uses the speech text before the target end keyword in the initial speech text as the second speech text;
[0119] The target voice text determination unit determines the voice text that overlaps the first voice text and the second voice text as the target voice text.
[0120] In another exemplary embodiment, the first preset keyword includes a preset start keyword and a preset end keyword; the first response module 710 includes:
[0121] The initial keyword matching success unit determines the target word as the initial keyword in the initial voice text if the target word matches the preset initial keyword successfully, so as to determine all the initial keywords in the initial voice text; wherein the target word is any word in the initial voice text;
[0122] The end keyword matching success unit determines the target word as the end keyword in the initial voice text if the target word matches the preset end keyword successfully, so as to determine all the end keywords in the initial voice text;
[0123] The target keyword determination unit takes the start keyword that appears for the first time in the initial voice text as the target start keyword, and takes the end keyword that appears for the last time in the initial voice text as the target end keyword.
[0124] The determination device of the present application determines the target starting keyword and the target ending keyword in the initial voice text through the updated first preset keyword, so as to intercept the initial voice text, determine the target voice text, and focus on identifying part of the text in the initial voice text, thereby reducing the demand for data processing resources. Among them, the determination device of the present application can update the first preset keyword in real time to adapt to the ever-changing oral expression, so as to better identify the target voice text where the target voice information is located. The determination device of the present application determines the first target keyword of the corresponding type from the target voice text according to the second preset keyword, and can quickly identify the key voice information, thereby quickly determining the target voice information in the target voice text.
[0125] It should be noted that the determination device provided in the above embodiment and the determination method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0126] Another aspect of the present application provides an electronic device, including: a controller; and a memory for storing one or more programs, which, when executed by the controller, executes the above-mentioned determination method.
[0127] See also Figure 8 , Figure 8 1 is a schematic diagram of the structure of a computer system of an electronic device shown in an exemplary embodiment of the present application, which shows a schematic diagram of the structure of a computer system of an electronic device suitable for implementing an embodiment of the present application.
[0128] It should be noted that Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0129] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method in the above embodiment. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, ROM 802 and RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0130] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.
[0131] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 809, and / or installed from a removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, various functions defined in the system of the present application are executed.
[0132] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0133] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0134] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0135] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above determination method is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0136] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the determination method provided in each of the above embodiments.
[0137] According to one aspect of an embodiment of the present application, a computer system is also provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. In RAM, various programs and data required for system operation are also stored. CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0138] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.
[0139] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.< / string> < / string>
Claims
1. A method for determining target voice information, characterized in that: The determination method comprises: In response to the first determination instruction, a target start keyword and a target end keyword in the initial voice text are determined based on the updated first preset keyword; wherein the target start keyword and the target end keyword are the start keyword that appears for the first time and the end keyword that appears for the last time in the initial voice text, respectively, and the updated first preset keyword is a word obtained after the original first preset keyword is updated; Determining a target voice text from the initial voice text according to the target starting keyword and the target ending keyword; According to the second preset keyword, a first target keyword in the target voice text and a type to which the first target keyword belongs are determined to determine the target voice information in the target voice text.
2. The determination method according to claim 1, characterized in that: The determination method further comprises: In response to a second determination instruction, the second target keyword in the initial voice text and the type of the second target keyword are determined according to the second preset keyword to determine the target voice information in the initial voice text; wherein the number of the second target keywords is greater than or equal to the number of the first target keywords.
3. The determination method according to claim 1, characterized in that: The determination method further comprises: If the specified keyword in the target voice text fails to match all the second preset keywords, performing an escape operation on the specified keyword based on a preset character escape function; If the escaped characters include characters representing time, it is determined that the designated keyword is the first target keyword of the time type.
4. The determination method according to claim 1, characterized in that: The step of determining, based on the second preset keyword, a first target keyword in the target voice text and a type to which the first target keyword belongs, so as to determine target voice information in the target voice text includes: The words in the target voice text that match the second preset keyword are used as the first target keyword, and the preset type corresponding to the successfully matched second preset keyword is used as the type to which the first target keyword belongs; wherein each second preset keyword corresponds to its own preset type; The type to which the first target keyword belongs is used as the information header of the first target keyword to determine the target voice information in the target voice text.
5. The determination method according to claim 4, characterized in that: Before taking the word in the target voice text that matches the second preset keyword as the first target keyword, the determination method further includes: Traversing each preset type, and taking the second preset keyword corresponding to the traversed preset type as the target second preset keyword; wherein each preset type corresponds to at least one second preset keyword, and the second preset keywords corresponding to each preset type include a spacing character; Each word in the target voice text is matched with the target second preset keyword to obtain the words in the target voice text that match the target second preset keyword, so as to obtain the words in the target voice text that match the second preset keyword.
6. The determination method according to any one of claims 1 to 5, characterized in that: The step of determining a target voice text from the initial voice text according to the target start keyword and the target end keyword includes: The speech text after the target start keyword in the initial speech text is used as the first speech text, and the speech text before the target end keyword in the initial speech text is used as the second speech text; The overlapping speech text between the first speech text and the second speech text is determined as the target speech text.
7. The determination method according to any one of claims 1 to 5, characterized in that: The first preset keyword includes a preset start keyword and a preset end keyword; The step of determining a target start keyword and a target end keyword in the initial voice text based on the updated first preset keyword includes: If the target word successfully matches the preset starting keyword, the target word is determined as the starting keyword in the initial voice text to determine all the starting keywords in the initial voice text; wherein the target word is any word in the initial voice text; If the target word successfully matches the preset end keyword, the target word is determined as the end keyword in the initial voice text, so as to determine all the end keywords in the initial voice text; The start keyword that appears for the first time in the initial voice text is used as the target start keyword, and the end keyword that appears for the last time in the initial voice text is used as the target end keyword.
8. A device for determining target voice information, characterized in that: The determining device comprises: A first response module, in response to a first determination instruction, determines a target start keyword and a target end keyword in the initial voice text based on the updated first preset keyword; wherein the target start keyword and the target end keyword are the start keyword that appears for the first time and the end keyword that appears for the last time in the initial voice text, respectively, and the updated first preset keyword is a word obtained after updating the original first preset keyword; A text determination module, which determines a target voice text from the initial voice text according to the target start keyword and the target end keyword; The information determination module determines the first target keyword in the target voice text and the type to which the first target keyword belongs according to the second preset keyword, so as to determine the target voice information in the target voice text.
9. An electronic device, characterized in that: include: Controller; A memory for storing one or more programs, which, when executed by a controller, enables the controller to implement the determination method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the determination method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Program endpoint time detection apparatus and method and program information retrieval system
CN102073635A
Voice keyword screening method and device, travel terminal, equipment and medium
CN111009240A
Voice information processing method and device, equipment and medium
CN113470636A
Voice processing method and device and electronic equipment
CN113838467A
Speech recognition method, device, equipment, storage medium and computer program product
CN114255761A