Voice processing method, device, electronic device and storage medium
By identifying the text information of user voice data in the smart device and using the regression model of slots and matching degrees, the problem of user voice command ambiguity is solved, and the accurate identification of user intentions and accurate playback of media resources is achieved.
Patent Information
- Application Number
- CN202210010835.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-06
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-01-06
Smart Images

Figure CN114550724B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of speech recognition technology, and in particular to a speech processing method, device, electronic device and storage medium. Background Art
[0002] In the field of smart devices, users can control them through voice. For example, users can use voice to control smart devices to turn on and off, play programs, etc. In general, smart devices can directly select content of interest to users based on the voice data they receive.
[0003] However, there are cases where the same sentence structure and phraseology can be used across multiple domains. For example, "play A (A is a person)" creates the ambiguity of playing A's songs or A's movies. In related art, if A is defined as a singer, the song can be played directly. However, if A is defined as both a singer and an actor, it will be impossible to accurately select content of interest to the user. Summary of the Invention
[0004] In order to solve the above technical problems, the present application provides a speech processing method, device, electronic device and storage medium.
[0005] According to a first aspect of the present application, a speech processing method is provided, comprising:
[0006] Receive voice data input by the user, perform voice recognition on the voice data, and obtain corresponding text information;
[0007] For each media resource vertical category in the plurality of media resource vertical categories, determining, based on the slots in the media resource vertical category, whether the text information has a corresponding slot in the media resource vertical category;
[0008] If the text information has a corresponding slot in the media resource vertical category, determining the media resource vertical category as a candidate media resource vertical category;
[0009] If there are multiple candidate media resource vertical categories, the target media resource vertical category corresponding to the text information is determined based on the slots corresponding to the text information in the multiple candidate media resource vertical categories.
[0010] Optionally, determining the target media resource vertical category corresponding to the text information according to the slots corresponding to the text information in the plurality of candidate media resource vertical categories includes:
[0011] The target media resource vertical category corresponding to the text information is determined based on the number of slots corresponding to the text information in the multiple candidate media resource vertical categories and / or the popularity of the slots corresponding to the text information in the multiple candidate media resource vertical categories.
[0012] Optionally, the method further includes:
[0013] Determining the matching degree between the text information and multiple candidate media resource vertical categories respectively;
[0014] The determining, based on the slots corresponding to the text information in the plurality of candidate media resource vertical categories, a target media resource vertical category corresponding to the text information includes:
[0015] The target media resource vertical category corresponding to the text information is determined based on the slots corresponding to the text information in the multiple candidate media resource vertical categories and the matching degrees between the text information and the multiple candidate media resource vertical categories.
[0016] Optionally, determining the target media resource vertical category corresponding to the text information according to the slots corresponding to the text information in the plurality of candidate media resource vertical categories and the matching degrees between the text information and the plurality of candidate media resource vertical categories includes:
[0017] Obtain slot weights and matching weights from the pre-trained regression model;
[0018] For a single candidate media resource vertical category, determine a slot value according to a slot corresponding to the text information in the candidate media resource vertical category, and perform a product operation on the slot value and the slot weight to obtain a first value;
[0019] Performing a product operation on the matching degree between the text information and the candidate media resource vertical category and the matching degree weight to obtain a second value;
[0020] Determine the sum of the first value and the second value as the target value of the candidate media resource vertical category;
[0021] The candidate media resource vertical category with the largest corresponding target value among the multiple candidate media resource vertical categories is determined as the target media resource vertical category.
[0022] Optionally, determining the matching degree between the text information and the plurality of candidate media resource vertical categories respectively includes:
[0023] For a single candidate media resource vertical category, determining the number of media resources included in the text information in the candidate media resource vertical category;
[0024] Based on the quantity, determine the matching degree between the text information and the candidate media resource vertical category; wherein the matching degree is positively correlated with the quantity.
[0025] Optionally, the training method of the regression model includes:
[0026] Acquire multiple sample data, each of which includes: sample text information and a media resource vertical category corresponding to the sample text information;
[0027] According to the slots in the multiple media resource vertical categories, determining the slots corresponding to the sample text information in the multiple media resource vertical categories;
[0028] Determine the matching degree between the sample text information and each media resource vertical category respectively;
[0029] Performing a regression calculation based on the slots corresponding to the sample text information in the multiple media resource vertical categories, the matching degree between the sample text information and each media resource vertical category, and the media resource vertical category corresponding to the sample text information to obtain the regression model;
[0030] The regression model includes the slot weight and the matching weight.
[0031] Optionally, the method further includes:
[0032] After determining the target media resource vertical category corresponding to the text information, media resources related to the text information in the target media resource vertical category are played.
[0033] According to a second aspect of the present application, there is provided a speech processing device, comprising:
[0034] A speech recognition module is used to receive speech data input by a user, perform speech recognition on the speech data, and obtain corresponding text information;
[0035] A slot determination module is configured to determine, for each media resource vertical category in a plurality of media resource vertical categories, whether the text information has a corresponding slot in the media resource vertical category according to the slots in the media resource vertical category;
[0036] a candidate media resource vertical category determination module, configured to determine the media resource vertical category as a candidate media resource vertical category if the text information has a corresponding slot in the media resource vertical category;
[0037] The target media resource vertical category determination module is used to determine the target media resource vertical category corresponding to the text information based on the slots corresponding to the text information in the multiple candidate media resource vertical categories if there are multiple candidate media resource vertical categories.
[0038] Optionally, the target media resource vertical category determination module is specifically used to determine the target media resource vertical category corresponding to the text information based on the number of slots corresponding to the text information in the multiple candidate media resource vertical categories and / or the popularity of the slots corresponding to the text information in the multiple candidate media resource vertical categories if there are multiple candidate media resource vertical categories.
[0039] Optionally, the speech processing device further includes:
[0040] A matching degree determination module, configured to determine the matching degree between the text information and a plurality of candidate media resource vertical categories respectively;
[0041] The target media resource vertical category determination module is specifically used to determine the target media resource vertical category corresponding to the text information based on the slots corresponding to the text information in the multiple candidate media resource vertical categories and the matching degree between the text information and the multiple candidate media resource vertical categories if there are multiple candidate media resource vertical categories.
[0042] Optionally, the target media resource vertical category determination module is specifically used to obtain slot weights and matching weights from a pre-trained regression model if there are multiple candidate media resource vertical categories; for a single candidate media resource vertical category, determine the slot value according to the slot corresponding to the text information in the candidate media resource vertical category, multiply the slot value and the slot weight to obtain a first value; multiply the matching degree between the text information and the candidate media resource vertical category by the matching weight to obtain a second value; determine the sum of the first value and the second value as the target value of the candidate media resource vertical category; and determine the candidate media resource vertical category with the largest corresponding target value among the multiple candidate media resource vertical categories as the target media resource vertical category.
[0043] Optionally, the matching degree determination module is specifically used to determine, for a single candidate media resource vertical category, the number of media resources contained in the text information in the candidate media resource vertical category; based on the number, determine the matching degree between the text information and the candidate media resource vertical category; wherein the matching degree is positively correlated with the number.
[0044] Optionally, the speech processing device further includes:
[0045] A regression model training module is used to obtain multiple sample data, each of which includes: sample text information and a media resource vertical category corresponding to the sample text information; based on the slots in the multiple media resource vertical categories, determining the slots to which the sample text information corresponds respectively; determining the matching degree between the sample text information and each media resource vertical category respectively; performing regression calculation based on the slots to which the sample text information corresponds respectively in the multiple media resource vertical categories, the matching degree between the sample text information and each media resource vertical category, and the media resource vertical category corresponding to the sample text information, to obtain the regression model; wherein, the regression model includes the slot weight and the matching degree weight.
[0046] Optionally, the speech processing device further includes:
[0047] The media resource playback module is used to play the media resources related to the text information in the target media resource vertical category after determining the target media resource vertical category corresponding to the text information.
[0048] According to a third aspect of the present application, an electronic device is provided, comprising: a processor, wherein the processor is configured to execute a computer program stored in a memory, wherein the computer program implements the method described in the first aspect when executed by the processor.
[0049] According to a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in the first aspect is implemented.
[0050] According to a fifth aspect of the present application, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the method described in the first aspect.
[0051] The technical solution provided by the embodiments of the present application has the following advantages compared with the prior art:
[0052] After recognizing the voice data input by the user and obtaining the corresponding text information, determine whether the text information has a corresponding slot in the multiple media resource vertical categories based on the slots in each media resource vertical category in the multiple media resource vertical categories. If the text information has a corresponding slot in the media resource vertical category, the media resource vertical category is determined as a candidate media resource vertical category; if there are multiple candidate media resource vertical categories, the slots corresponding to the text information in the multiple candidate media resource vertical categories can reflect the degree of matching between the text information and the multiple candidate media resource vertical categories. Therefore, according to the slots corresponding to the text information in the multiple candidate media resource vertical categories, the target media resource vertical category corresponding to the text information, that is, the media resource vertical category that the user is more interested in, can be determined, which can improve the accuracy of determining the target media resource vertical category, thereby improving the accuracy of identifying the user's intention. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0054] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0055] Figure 1 A schematic diagram of an application scenario of the speech processing method in an embodiment of the present application;
[0056] Figure 2 A flow chart of the speech processing method in an embodiment of the present application;
[0057] Figure 3 This is another flow chart of the speech processing method in the embodiment of the present application;
[0058] Figure 4 A flow chart of the training method of the regression model in the embodiment of the present application;
[0059] Figure 5 This is a structural diagram of a speech processing device in an embodiment of the present application;
[0060] Figure 6 This is a structural diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0061] In order to more clearly understand the above-mentioned objectives, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein can be combined with each other.
[0062] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application can also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present application, not all of the embodiments.
[0063] The speech processing method of the embodiment of the present application can be applied to smart devices (such as smart TVs, smart speakers, etc.), and users can control the smart devices through voice signals. After receiving the user's voice signal, the smart device can accurately identify the user's intention and respond accurately.
[0064] Figure 1 Schematic diagram of an application scenario of the speech processing method in the embodiment of the present application. Figure 1 As shown, users can control smart TVs through voice commands. For example, they can shout "Power on" or "Power off" to turn the smart TV on or off. They can also shout "Play B (B is a program)" to have the smart TV play program B. When the content a user wants to play corresponds to multiple different domains, the text information corresponding to the user's voice input can be analyzed to accurately identify the user's intent and play the correct content for the user.
[0065] See also Figure 2 , Figure 2 This is a flow chart of the speech processing method in an embodiment of the present application, which may include the following steps:
[0066] Step S210: receiving voice data input by the user, performing voice recognition on the voice data, and obtaining corresponding text information.
[0067] To control a smart device through voice control, a user can enable the voice control function and input voice data into the smart device. For example, for a smart TV, the user can enable the voice control function through the remote control and input voice data into the remote control. The remote control can then send the voice data to the smart TV. The smart TV can then use voice recognition technology to recognize the voice data and obtain the corresponding text information.
[0068] Step S220: For each media resource vertical category in the plurality of media resource vertical categories, determine whether the text information has a corresponding slot in the media resource vertical category based on the slot in the media resource vertical category.
[0069] Multiple media resource vertical categories can be pre-set media resource vertical categories, and multiple media resource vertical categories specifically refer to multiple vertical fields of media resources, such as music, video, images, etc. For each media resource vertical category, at least one slot can be pre-set, and the slot points to the key information collected by the user. For example, for the video vertical category, the corresponding slots may include: actors, movies, TV series, etc.; for the music vertical category, the corresponding slots may include singers, songs, etc. In an embodiment of the present application, it is possible to determine whether the text information has a corresponding slot in the media resource vertical category based on the slots in each media resource vertical category in the multiple media resource vertical categories, so as to accurately identify the user's intention through the slots.
[0070] For example, suppose the text information is "Play F (F is the name of the actor, and F is also the singer)", the slot corresponding to the text information in the video vertical category is actor, and the slot information of the slot is F, which can be expressed as "actor = F"; the slot corresponding to the text information in the music vertical category is singer, and the slot information of the slot is F, which can be expressed as "singer = F".
[0071] For example, if the text message is "Play D (D is the actor's name)'s work E (E is the movie title)", the corresponding slots for this text message in the video vertical category are actors and movies. The slot information for the actor is D, which can be expressed as "actor = D", and the slot information for the movie is E, which can be expressed as "movie = E". If D is not a singer, then the slot for this text message in the music vertical category is empty, that is, the text message does not have a corresponding slot in the music vertical category.
[0072] Step S230: If the text information has a corresponding slot in the media resource vertical category, the media resource vertical category is determined as a candidate media resource vertical category.
[0073] If the text information does not have a corresponding vertical category in any media resource vertical category, that is, the number of candidate media resource vertical categories is 0. For example, the text information is "shut down", and the smart device can be directly shut down according to the text information. Alternatively, if the text information has a corresponding slot in a media resource vertical category, that is, the number of candidate media resource vertical categories is 1. For example, the text information is "play C (C is the name of the actor, and C is not a singer)", at this time, C's film and television works can be directly played. For another example, the text information is "play D (D is the name of the actor)'s work E (E is the name of the movie)", and movie E can be directly played.
[0074] Step S240: If there are multiple candidate media resource vertical categories, determine the target media resource vertical category corresponding to the text information based on the slots corresponding to the text information in the multiple candidate media resource vertical categories.
[0075] In an embodiment of the present application, if there are multiple candidate media resource vertical categories, for example, the text information is "Play F (F is the name of the actor, and F is also a singer)", at this time, if F's film and television works are played directly, or F's music works are played directly, it may not satisfy the user. The user may perform further voice control on the smart device to get the result the user wants. Since the slots corresponding to the text information in multiple candidate media resource vertical categories can reflect the degree of matching between the text information and the multiple candidate media resource vertical categories, the target media resource vertical category corresponding to the text information can be determined according to the slots corresponding to the text information in multiple candidate media resource vertical categories.
[0076] It is understood that the more slots a text message has in a media resource vertical category, the more closely it matches that media resource vertical category. For example, if the slot corresponding to a text message in a media resource is empty, it indicates that the text message does not match that media resource vertical category. If the number of slots corresponding to a text message in a media resource is three, it indicates that the text message is relatively closely matched with that media resource vertical category.
[0077] Furthermore, when users search for content on smart devices, they typically choose content with high search popularity. Therefore, the popularity of the slot corresponding to the text information in the media resource vertical category can also be used to identify the user's intent. The higher the popularity of the slot corresponding to the text information in the media resource vertical category, the more likely the text information is to be matched with that media resource vertical category.
[0078] In some embodiments, the target media resource vertical category corresponding to the text information is determined based on the number of slots corresponding to the text information in multiple candidate media resource vertical categories and / or the popularity of the slots corresponding to the text information in multiple candidate media resource vertical categories. That is, the number of slots corresponding to the text information in each candidate media resource vertical category can be considered separately, or the popularity of the slots corresponding to the text information in each candidate media resource vertical category can be considered separately to determine the target media resource vertical category. The target media resource vertical category can also be determined by simultaneously considering the number of slots corresponding to the text information in each candidate media resource vertical category and the popularity of the slots corresponding to the text information in each candidate media resource vertical category.
[0079] For example, different weights can be pre-set for the number of slots and the popularity of the slots. Of course, the number of slots and the popularity of the slots can have different weights for different slots. The number of slots corresponding to the text information in a single candidate media resource vertical category and the popularity of the slots corresponding to the text information in a single candidate media resource vertical category are weighted averaged, and the candidate media resource vertical category corresponding to the maximum value is determined as the target media resource vertical category. The popularity of the slots can be quantified, and the higher the popularity, the larger the value.
[0080] The voice processing method of the embodiment of the present application, after recognizing the voice data input by the user and obtaining the corresponding text information, determines whether the text information has a corresponding slot in multiple media resource vertical categories based on the slots in each media resource vertical category in the multiple media resource vertical categories. If the text information has a corresponding slot in the media resource vertical category, the media resource vertical category is determined as a candidate media resource vertical category; if there are multiple candidate media resource vertical categories, the slots corresponding to the text information in the multiple candidate media resource vertical categories can reflect the degree of matching between the text information and the multiple candidate media resource vertical categories. For example, the more slots the text information corresponds to in the candidate media resource vertical category and the higher the popularity, the more the text information matches the candidate media resource vertical category. Therefore, the target media resource vertical category corresponding to the text information, that is, the media resource vertical category that the user is more interested in, can be determined based on the slots corresponding to the text information in the multiple candidate media resource vertical categories, which can improve the accuracy of determining the target media resource vertical category, thereby improving the accuracy of identifying the user's intention.
[0081] See also Figure 3 , Figure 3 This is another flow chart of the speech processing method in the embodiment of the present application, which may include the following steps:
[0082] Step S310: receiving voice data input by the user, performing voice recognition on the voice data, and obtaining corresponding text information.
[0083] Step S320: For each media resource vertical category in the plurality of media resource vertical categories, determine whether the text information has a corresponding slot in the media resource vertical category based on the slot in the media resource vertical category.
[0084] Step S330: If the text information has a corresponding slot in the media resource vertical category, the media resource vertical category is determined as a candidate media resource vertical category.
[0085] The above steps S310 to S330 are Figure 2 Steps S210 to S230 in the embodiment are the same, see Figure 2 The description in the embodiment is sufficient and will not be repeated here.
[0086] Step S340: If there are multiple candidate media resource vertical categories, determine the matching degree between the text information and the multiple candidate media resource vertical categories respectively.
[0087] In an embodiment of the present application, if there are multiple candidate media resource vertical categories, the degree of match between the text information and the candidate media resource vertical categories can also be determined. In this way, the target media resource vertical category can be further determined based on the degree of match. In some embodiments, for a single candidate media resource vertical category, the number of media resources contained in the text information in the candidate media resource vertical category can be determined, and based on this number, the degree of match between the text information and the candidate media resource vertical category is determined; wherein the degree of match is positively correlated with the number.
[0088] For example, assuming the text information includes the aforementioned actor F, who is also a singer, we can determine the first number of film and television works corresponding to F in the video vertical category, and the second number of music works corresponding to F in the music vertical category. We can directly use the first number as the matching degree between the text information and the video vertical category, and the second number as the matching degree between the text information and the music vertical category, or we can use a simple transformation of the first and second numbers as the matching degree.
[0089] Step S350: Determine the target media resource vertical category corresponding to the text information based on the slots corresponding to the text information in the multiple candidate media resource vertical categories and the matching degree between the text information and the multiple candidate media resource vertical categories.
[0090] In some embodiments, the slot weight and the matching weight can be obtained from a pre-trained regression model, wherein the slot weight and the matching weight are obtained when the regression model is trained and generated.
[0091] For a single candidate media resource vertical category, determine the slot value based on the slot corresponding to the text information in the candidate media resource vertical category. Multiply the slot value and the slot weight to obtain a first value; multiply the matching degree between the text information and the candidate media resource vertical category and the matching degree weight to obtain a second value; determine the sum of the first value and the second value as the target value of the candidate media resource vertical category. The candidate media resource vertical category with the largest corresponding target value among multiple candidate media resource vertical categories is determined as the target media resource vertical category. As mentioned above, the slot value can be determined based on the number and / or popularity of the slots corresponding to the text information in the media resource vertical category. The more slots the text information corresponds to in the media resource vertical category and the higher the popularity, the greater the slot value.
[0092] See also Figure 4 , Figure 4 A flowchart of a method for training a regression model in an embodiment of the present application may include the following steps:
[0093] Step S410: Acquire multiple sample data, where a single sample data includes: sample text information and a media resource vertical category corresponding to the sample text information.
[0094] To improve the accuracy of regression model training, the diversity of sample data can be maximized. For example, sample text information can include text information corresponding to one media resource vertical category, as well as text information corresponding to multiple media resource vertical categories. The media resource vertical categories corresponding to the sample text information can also be manually annotated media resource vertical categories.
[0095] Step S420: Determine the slots corresponding to the sample text information in the multiple media resource vertical categories according to the slots in the multiple media resource vertical categories.
[0096] Step S430: Determine the matching degree between the sample text information and each media resource vertical category.
[0097] The processing of steps S420 to S430 is similar to that of the aforementioned steps S320 to S330 and will not be repeated here.
[0098] Step S440 , performing regression calculation based on the slots corresponding to the sample text information in multiple media resource vertical categories, the matching degree between the sample text information and each media resource vertical category, and the media resource vertical category corresponding to the sample text information, to obtain a regression model.
[0099] Among them, the slots corresponding to the sample text information in multiple media resource vertical categories, the matching degree between the sample text information and each media resource vertical category are used as input data, and the media resource vertical category corresponding to the sample text information is used as the output result. Regression calculation (for example, regression calculation can be performed through a linear regression algorithm) can be used to obtain a regression model; wherein, the regression model includes slot weights and matching degree weights.
[0100] Step S360: play the media resources related to the text information in the target media resource vertical category.
[0101] After determining the target media resource vertical category, media resources related to the text information in the target media resource vertical category can be played for the user. That is, after identifying the user's intention, the corresponding media resources are provided for the user to watch, thereby improving the user experience.
[0102] The voice processing method of the embodiment of the present application, after recognizing the voice data input by the user and obtaining the corresponding text information, determines whether the text information has a corresponding slot in multiple media resource vertical categories based on the slots in each media resource vertical category in the multiple media resource vertical categories. If the text information has a corresponding slot in the media resource vertical category, the media resource vertical category is determined as a candidate media resource vertical category. If there are multiple candidate media resource vertical categories, determine the slots corresponding to the text information in the multiple candidate media resource vertical categories, as well as the matching degree between the text information and the multiple candidate media resource vertical categories. Determine the target media resource vertical category corresponding to the text information based on the slots corresponding to the text information in the multiple candidate media resource vertical categories and the matching degree between the text information and the multiple candidate media resource vertical categories. That is, determine the media resource vertical category that the user is more interested in, thereby improving the accuracy of user intent recognition, providing users with accurate media resources, and improving user experience.
[0103] Corresponding to the above method embodiment, the present application embodiment also provides a speech processing device, see Figure 5 , the speech processing device 500 includes:
[0104] The speech recognition module 510 is used to receive speech data input by the user, perform speech recognition on the speech data, and obtain corresponding text information;
[0105] A slot determination module 520 is configured to determine, for each media resource vertical category in the plurality of media resource vertical categories, whether the text information has a corresponding slot in the media resource vertical category based on the slots in the media resource vertical category;
[0106] A candidate media resource vertical category determination module 530 is configured to determine a media resource vertical category as a candidate media resource vertical category if the text information has a corresponding slot in the media resource vertical category;
[0107] The target media resource vertical category determination module 540 is used to determine the target media resource vertical category corresponding to the text information based on the slots corresponding to the text information in the multiple candidate media resource vertical categories if there are multiple candidate media resource vertical categories.
[0108] Optionally, the target media resource vertical category determination module 540 is specifically used to determine the target media resource vertical category corresponding to the text information based on the number of slots corresponding to the text information in the multiple candidate media resource vertical categories and / or the popularity of the slots corresponding to the text information in the multiple candidate media resource vertical categories if there are multiple candidate media resource vertical categories.
[0109] Optionally, the speech processing device 500 further includes:
[0110] A matching degree determination module is used to determine the matching degree between the text information and multiple candidate media resource vertical categories respectively;
[0111] The target media resource vertical category determination module 540 is specifically used to determine the target media resource vertical category corresponding to the text information based on the slots corresponding to the text information in the multiple candidate media resource vertical categories and the matching degree between the text information and the multiple candidate media resource vertical categories if there are multiple candidate media resource vertical categories.
[0112] Optionally, the target media resource vertical category determination module 540 is specifically used to obtain the slot weight and matching weight from the pre-trained regression model if there are multiple candidate media resource vertical categories; for a single candidate media resource vertical category, determine the slot value according to the slot corresponding to the text information in the candidate media resource vertical category, multiply the slot value and the slot weight to obtain a first value; multiply the matching degree between the text information and the candidate media resource vertical category by the matching weight to obtain a second value; determine the sum of the first value and the second value as the target value of the candidate media resource vertical category; and determine the candidate media resource vertical category with the largest corresponding target value among multiple candidate media resource vertical categories as the target media resource vertical category.
[0113] Optionally, a matching degree determination module is specifically used to determine, for a single candidate media resource vertical category, the number of media resources contained in the text information in the candidate media resource vertical category; based on the number, determine the matching degree between the text information and the candidate media resource vertical category; wherein the matching degree is positively correlated with the number.
[0114] Optionally, the speech processing device 500 further includes:
[0115] The regression model training module is used to obtain multiple sample data, and a single sample data includes: sample text information and the media resource vertical category corresponding to the sample text information; based on the slots in the multiple media resource vertical categories, determine the slots corresponding to the sample text information in the multiple media resource vertical categories; determine the matching degree between the sample text information and each media resource vertical category; perform regression calculation based on the slots corresponding to the sample text information in the multiple media resource vertical categories, the matching degree between the sample text information and each media resource vertical category, and the media resource vertical category corresponding to the sample text information to obtain a regression model; wherein the regression model includes slot weights and matching degree weights.
[0116] Optionally, the speech processing device 500 further includes:
[0117] The media resource playback module is used to play the media resources related to the text information in the target media resource vertical category after determining the target media resource vertical category corresponding to the text information.
[0118] The specific details of each module or unit in the above device have been described in detail in the corresponding method, so they will not be repeated here.
[0119] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0120] In an exemplary embodiment of the present application, an electronic device is further provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the above-mentioned voice processing method in this exemplary embodiment.
[0121] Figure 6 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. It should be noted that, Figure 6 The electronic device 600 shown is only an example and should not limit the functions and scope of use of the embodiments of the present application.
[0122] like Figure 6 As shown, electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in read-only memory (ROM) 602 or the program loaded from storage portion 608 into random access memory (RAM) 603. Various programs and data required for system operation are also stored in RAM 603. Central processing unit 601, ROM 602 and RAM 603 are connected to each other via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0123] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, and the like; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a local area network (LAN) card or a modem. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like, is installed in the drive 610 as needed, so that a computer program read therefrom can be installed into the storage section 608 as needed.
[0124] 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 contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609 and / or installed from a removable medium 611. When the computer program is executed by the central processing unit 601, the various functions defined in the apparatus of the present application are performed.
[0125] In an embodiment of the present application, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned speech processing method is implemented.
[0126] It should be noted that the computer-readable storage medium shown in this application can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. 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, a read-only memory, an erasable programmable read-only memory (EPROM or 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 thereof. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, radio frequency, etc., or any suitable combination thereof.
[0127] In an embodiment of the present application, a computer program product is further provided. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned speech processing method.
[0128] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0129] The foregoing description is intended only to provide specific embodiments of the present application, which will enable those skilled in the art to understand and implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments described herein, but is intended to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. A speech processing method, characterized in that: The method comprises: Receive voice data input by the user, perform voice recognition on the voice data, and obtain corresponding text information; For each media resource vertical category in the plurality of media resource vertical categories, determining, based on the slots in the media resource vertical category, whether the text information has a corresponding slot in the media resource vertical category; If the text information has a corresponding slot in the media resource vertical category, determining the media resource vertical category as a candidate media resource vertical category; If there are multiple candidate media resource vertical categories, determine the target media resource vertical category corresponding to the text information based on the slots corresponding to the text information in the multiple candidate media resource vertical categories; The determining, based on the slots corresponding to the text information in the plurality of candidate media resource vertical categories, a target media resource vertical category corresponding to the text information includes: The target media resource vertical category corresponding to the text information is determined based on the number of slots corresponding to the text information in the multiple candidate media resource vertical categories and / or the popularity of the slots corresponding to the text information in the multiple candidate media resource vertical categories.
2. The method according to claim 1, characterized in that The method further comprises: Determining the matching degree between the text information and multiple candidate media resource vertical categories respectively; The determining, based on the slots corresponding to the text information in the plurality of candidate media resource vertical categories, a target media resource vertical category corresponding to the text information includes: The target media resource vertical category corresponding to the text information is determined based on the slots corresponding to the text information in the multiple candidate media resource vertical categories and the matching degrees between the text information and the multiple candidate media resource vertical categories.
3. The method according to claim 2, characterized in that The determining, based on the slots corresponding to the text information in the plurality of candidate media resource vertical categories and the matching degrees between the text information and the plurality of candidate media resource vertical categories, a target media resource vertical category corresponding to the text information includes: Obtain slot weights and matching weights from the pre-trained regression model; For a single candidate media resource vertical category, determine a slot value according to a slot corresponding to the text information in the candidate media resource vertical category, and perform a product operation on the slot value and the slot weight to obtain a first value; Performing a product operation on the matching degree between the text information and the candidate media resource vertical category and the matching degree weight to obtain a second value; Determine the sum of the first value and the second value as the target value of the candidate media resource vertical category; The candidate media resource vertical category with the largest corresponding target value among the multiple candidate media resource vertical categories is determined as the target media resource vertical category.
4. The method according to claim 2, characterized in that Determining the matching degree between the text information and the plurality of candidate media resource vertical categories respectively includes: For a single candidate media resource vertical category, determining the number of media resources included in the text information in the candidate media resource vertical category; Determine the degree of matching between the text information and the candidate media resource vertical category based on the number of media resources contained in the candidate media resource vertical category by the text information; wherein the degree of matching between the text information and the candidate media resource vertical category is positively correlated with the number of media resources contained in the text information in the candidate media resource vertical category.
5. The method according to claim 3, characterized in that The training method of the regression model includes: Acquire multiple sample data, each of which includes: sample text information and a media resource vertical category corresponding to the sample text information; According to the slots in the multiple media resource vertical categories, determining the slots corresponding to the sample text information in the multiple media resource vertical categories; Determine the matching degree between the sample text information and each media resource vertical category respectively; Performing a regression calculation based on the slots corresponding to the sample text information in the multiple media resource vertical categories, the matching degree between the sample text information and each media resource vertical category, and the media resource vertical category corresponding to the sample text information to obtain the regression model; The regression model includes the slot weight and the matching weight.
6. The method according to claim 1, characterized in that The method further comprises: After determining the target media resource vertical category corresponding to the text information, media resources related to the text information in the target media resource vertical category are played.
7. A speech processing device, characterized in that: The device comprises: A speech recognition module is used to receive speech data input by a user, perform speech recognition on the speech data, and obtain corresponding text information; A slot determination module is configured to determine, for each media resource vertical category in a plurality of media resource vertical categories, whether the text information has a corresponding slot in the media resource vertical category according to the slots in the media resource vertical category; a candidate media resource vertical category determination module, configured to determine the media resource vertical category as a candidate media resource vertical category if the text information has a corresponding slot in the media resource vertical category; a target media resource vertical category determination module, configured to determine a target media resource vertical category corresponding to the text information based on the slots corresponding to the text information in the plurality of candidate media resource vertical categories if there are multiple candidate media resource vertical categories; The target media resource vertical category determination module is specifically used to determine the target media resource vertical category corresponding to the text information based on the number of slots corresponding to the text information in multiple candidate media resource vertical categories and / or the popularity of the slots corresponding to the text information in multiple candidate media resource vertical categories.
8. An electronic device, characterized in that: include: A processor, wherein the processor is configured to execute a computer program stored in a memory, wherein the computer program, when executed by the processor, implements the speech processing method according to any one of claims 1 to 6.
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 speech processing method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Data analysis method, apparatus and electronic apparatus
CN109508441A
Intention recognition method and device, server and storage medium
CN112069301A
Voice instruction response method and device and terminal equipment
CN112581944A