Sound effect adding method and device, storage medium and electronic device

The automatic selection and addition of sound effects through the emotion determination model solves the problems of traditional sound effect addition methods that are time-consuming and labor-intensive and the sound effect repetition rate is high, achieving efficient and automatic sound effect addition and improving the atmosphere of audio text.

CN111767740BActive Publication Date: 2024-10-11DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010583097.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-23
Publication Date
2024-10-11
Estimated Expiration
2040-10-11

AI Technical Summary

Technical Problem

The traditional method of adding sound effects requires a lot of labor costs and is time-consuming and labor-intensive. Moreover, due to the obvious bias in artificial selection of sound effects, the repetition rate of sound effects is high, which affects the quality of the sound effects of audio texts.

Method used

A method based on the emotion determination model is used to determine the sentence emotion labels and paragraph emotion distribution of the text to be processed, and the sound effects that match the text are automatically selected through the emotion offset value and probability distribution, and are added to the corresponding positions to achieve automatic sound effect addition.

Benefits of technology

It improves the efficiency of adding sound effects, reduces manual intervention, reduces costs, improves the atmosphere of audio text, and reduces the repetition rate of sound effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111767740B_ABST
    Figure CN111767740B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method and device for adding sound effects, a storage medium and an electronic device, the method comprising: determining the sentence emotion label of each sentence of a text to be processed based on an emotion judgment model; determining the emotion offset value of the text to be processed based on the label type with the largest number among a plurality of the sentence emotion labels; determining the emotion distribution vector of the paragraph for each paragraph of the text to be processed according to the sentence emotion labels of a plurality of sentences corresponding to the paragraph; determining the emotion probability distribution of the paragraph based on the emotion offset value and the emotion distribution vector corresponding to the paragraph; determining a target sound effect matching the paragraph based on the emotion probability distribution of the paragraph and the sound effect emotion labels of a plurality of sound effects in a sound effect library; and adding the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of text processing, and in particular, to a method and device for adding sound effects, a storage medium, and an electronic device. Background Art

[0002] When converting text into an audiobook, in order to enhance the atmosphere of the audiobook, it is usually necessary to add various sound effects to the audiobook. There are many types of sound effects, and which sound effect should be added to which part of the audiobook depends on the text content.

[0003] The traditional method of adding sound effects requires manual analysis of the plot of the entire text, and selecting sound effects one by one from the sound effects library based on the text content and inserting them into the audiobook. In the case of mass production of audio novels, this method requires a lot of manpower costs, is time-consuming and labor-intensive, and because of the obvious bias in manually selecting sound effects, it often leads to a high repetition rate of sound effects, affecting the sound effect quality of the audio text. Summary of the invention

[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides a method for adding sound effects, comprising: determining a sentence emotion label for each sentence of a text to be processed based on an emotion judgment model; determining an emotion offset value of the text to be processed based on the type of label with the largest number among a plurality of the sentence emotion labels; for each paragraph of the text to be processed, determining an emotion distribution vector of the paragraph according to the sentence emotion labels of a plurality of sentences corresponding to the paragraph; determining an emotion probability distribution of the paragraph based on the emotion offset value and the emotion distribution vector corresponding to the paragraph; determining a target sound effect that matches the paragraph according to the emotion probability distribution of the paragraph and the sound effect emotion labels of a plurality of sound effects in a sound effect library; and adding the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed.

[0006] In a second aspect, the present disclosure provides a device for adding sound effects, including a sentence determination module, which is used to determine the sentence emotion label of each sentence of the text to be processed based on the emotion judgment model. An offset determination module, which is used to determine the emotion offset value of the text to be processed based on the label type with the largest number among the multiple sentence emotion labels. A distribution determination module, which is used to determine the emotion distribution vector of each paragraph of the text to be processed according to the sentence emotion labels of the multiple sentences corresponding to the paragraph. A probability determination module, which is used to determine the emotion probability distribution of the paragraph based on the emotion offset value and the emotion distribution vector corresponding to the paragraph. A sound effect determination module, which is used to determine the target sound effect that matches the paragraph based on the emotion probability distribution of the paragraph and the sound effect emotion labels of the multiple sound effects in the sound effect library. A sound effect adding module, which is used to add the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed.

[0007] According to a third aspect, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processing device, the steps of any one of the methods described in the first aspect of the present disclosure are performed.

[0008] In a fourth aspect, an electronic device is provided, comprising a storage device and a processing device, wherein a computer program is stored in the storage device; and the processing device is used to execute the computer program in the storage device to implement the steps of any one of the methods described in the first aspect of the present disclosure.

[0009] Through the above technical solution, at least the following technical effects can be achieved:

[0010] The sentiment judgment model can be used to identify the sentiment of the entire text and each paragraph, and determine the sound effects that are consistent with the sentiment of the entire text and the paragraph for each paragraph. This can achieve the effect of automatically selecting and adding sound effects, improve the efficiency of adding sound effects, and then add sound effects to audio texts in batches to enhance the atmosphere of audio texts.

[0011] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:

[0013] Figure 1 The figure is a flow chart of a method for adding sound effects according to an exemplary disclosed embodiment.

[0014] Figure 2 The figure is a flow chart of a method for adding sound effects according to an exemplary disclosed embodiment.

[0015] Figure 3 The present invention is a block diagram of a device for adding sound effects according to an exemplary disclosed embodiment.

[0016] Figure 4 It is a block diagram of an electronic device according to an exemplary disclosed embodiment. DETAILED DESCRIPTION

[0017] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0018] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0019] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0020] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0021] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0022] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0023] Figure 1 is a flow chart of a method for adding sound effects according to an exemplary disclosed embodiment. Figure 1 As shown, the sound effect adding method includes the following steps:

[0024] S11. Determine the sentence sentiment label of each sentence in the text to be processed based on the sentiment judgment model.

[0025] Sentence emotion labels can be first-level labels, and each label is unrelated to each other. For example, label 1 can represent "happiness", label 2 can represent "fear", label 3 can represent "surprise", etc. Sentence emotion labels can also be multi-level labels, and each label has a subordinate relationship. For example, label 1 can represent "boredom", label 2 can represent "disgust", label 3 can represent "hatred", and both label 1 and label 3 can be subordinate to label 2 representing the emotion of "disgust", label 4 can represent "confusion", label 5 can represent "surprise", label 6 can represent "astonishment", and both label 4 and label 6 can be subordinate to label 3 representing the emotion of "surprise". It is worth noting that when it is determined that a sentence has no obvious emotional bias, a label representing "neutral emotion" can be added to it.

[0026] It is worth noting that when the emotion of each sentence in the text to be processed is judged by the emotion judgment model, the input to the emotion judgment model can be the text to be processed itself. The emotion judgment model judges the emotion of the sentence by analyzing the semantics of the text and generates an emotion label. The input to the emotion judgment model can also be an audio file corresponding to the text to be processed that has been vocalized (for example: text reading, novel dubbing, etc.). The emotion judgment model determines the emotion label of the sentence by analyzing the voice emotion of the reciter and / or by judging the semantics of the speech.

[0027] Among them, one sentence can correspond to one sentence emotion label, and can also correspond to multiple sentence emotion labels, and the present disclosure does not impose any limitation on this.

[0028] S12. Determine the sentiment offset value of the text to be processed based on the largest number of label types among the plurality of sentence sentiment labels.

[0029] By determining the majority sentiment label of the full text, the sentiment offset value of the full text can be determined to characterize the sentiment tone of the full text. For example, when the full text has 100 sentences and 100 sentiment labels are determined based on the full text, of which 70 sentiment labels are "sad", 20 sentiment labels are "doubtful", and 10 sentiment labels are "angry", then the majority sentiment label of the full text can be determined to be "sad", which can indicate that the sentiment tone of the full text is "sad".

[0030] Therefore, the emotion offset value can be determined based on the label type with the largest number. The emotion offset value is used to weight the label value of the emotion type in the full text (that is, to weight the emotion label corresponding to the basic emotion of the full text). The specific weighting value can be flexibly set according to the actual application situation. For example, the emotion bias of novel texts is stronger, and the emotion offset value can be set higher to increase the weight of the basic emotion in subsequent steps and make the generated sound effects more in line with the basic emotion of the full text. The emotion bias of document-based texts is weaker, and the emotion offset value can be set lower to avoid over-weighting the content in the document that is not related to the basic emotion, so as to avoid adding inappropriate sound effects.

[0031] S13. For each paragraph of the text to be processed, determine the sentiment distribution vector of the paragraph according to the sentence sentiment labels of the multiple sentences corresponding to the paragraph.

[0032] The whole text has a sentiment bias, and each paragraph may also have its own sentiment bias. For a paragraph, the number of different sentiment labels in the paragraph can be used as the score of the vectorized value to determine the sentiment distribution vector of the paragraph. For example, there are 5 kinds of sentiment labels, and there are 3 "happy" labels, 4 "sad" labels, 2 "angry" labels, 1 "surprised" label and 10 "neutral" labels in the paragraph. Then the sentiment distribution vector of the paragraph can be determined as V1 = [3, 4, 2, 1, 10], where each score represents the number of labels of the label type corresponding to the score position.

[0033] S14. Determine the emotion probability distribution of the paragraph based on the emotion offset value and the emotion distribution vector corresponding to the paragraph.

[0034] The sentiment offset value is used to weight the sentiment distribution vector. For example, when the sentiment offset value is represented as a weighted happy label, the score representing "happiness" in the sentiment distribution vector can be increased.

[0035] In a possible implementation, the sentiment offset value may be superimposed with the score corresponding to the sentiment category corresponding to the sentiment offset value in the sentiment distribution vector corresponding to the paragraph to determine a target sentiment distribution vector.

[0036] For example, the emotion offset value can be "offset = [0.2, 0, 0, 0, 0]", which means adding 0.2 to the first score of the emotion distribution vector (i.e., the score representing happiness), and the target emotion distribution vector V2 = [3, 4, 2, 1, 10] + [0.2, 0, 0, 0, 0] = [3.2, 4, 2, 1, 10] can be obtained.

[0037] After weighting, the weighted sentiment distribution vector can be converted into a sentiment distribution probability. Specifically, the ratio of each score of the weighted sentiment distribution vector to the total score can be used as the distribution probability of the score. For example, the weighted sentiment distribution vector V2 = [3.2, 4, 2, 1, 10], then the distribution probability of the first score is 3.2 / 20.2 = 0.158, the distribution probability of the second score is 4 / 20.2 = 0.198, the distribution probability of the third score is 2 / 20.2 = 0.099, the distribution probability of the fourth score is 1 / 20.2 = 0.05, and the distribution probability of the fifth score is 10 / 20.2 = 0.495. Then the sentiment distribution probability V3 can be determined to be [0.158, 0.198, 0.099, 0.050, 0.495].

[0038] S15. Determine a target sound effect that matches the paragraph according to the emotion probability distribution of the paragraph and the sound effect emotion tags of multiple sound effects in a sound effect library.

[0039] After determining the emotion distribution probability, the sentence emotion label with the highest probability in the emotion distribution probability can be determined as the target label, and a sound effect with the same sound effect emotion label as the target label can be found in the sound effect library as the sound effect of the paragraph.

[0040] In a possible implementation, sampling can also be performed in the sound effect library based on the emotion distribution probability. For example, when the distribution probability of "happy" is 0.5, the distribution probability of "expectation" is 0.4, and the distribution probability of "surprise" is 0.1, the sampling results of the sound effects have a 50% probability of being a sound effect with a sound effect emotion label of "happy", a 40% probability of being a sound effect with a sound effect emotion label of "expectation", and a 10% probability of being a sound effect with a sound effect emotion label of "surprise".

[0041] It is worth noting that there may be multiple sound effects in the sound effect library corresponding to one sound effect emotion label. When selecting a sound effect under a certain sound effect emotion label, one sound effect can be randomly extracted from multiple sound effects with the same sound effect emotion label as the target sound effect, so that the selection of sound effects is not restricted by human preferences and is more enriched.

[0042] In a possible implementation, a sound effect whose length matches the text length and whose sound effect emotion label conforms to the emotion distribution probability can also be determined in the sound effect library. For example, when the sound effect with the emotion label with the highest distribution probability is taken, and the sound effect length corresponding to the length of the current paragraph is 10 seconds, the sound effect emotion label can be determined from the sound effect library to be consistent with the emotion label with the highest distribution probability, and the sound effect with the length closest to 10 seconds is the target sound effect.

[0043] Among them, the matching audio length can be determined according to the number of words in the paragraph; when the input into the emotion judgment model is an audio file, the time axis sampled to the paragraph can be directly determined and the corresponding audio length can be calculated.

[0044] S16. Add the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed.

[0045] For example, if the timeline corresponding to the paragraph is "00:01:11~00:02:01", the target sound effect can be inserted into the timeline of the audio file. It can be any optional position such as the beginning, end, or middle of the timeline. The specific insertion position is not limited in this disclosure.

[0046] Through the above technical solution, at least the following technical effects can be achieved:

[0047] The sentiment judgment model can be used to identify the sentiment of the entire text and each paragraph, and determine the sound effects that are consistent with the sentiment of the entire text and the paragraph for each paragraph. This can achieve the effect of automatically selecting and adding sound effects, improve the efficiency of adding sound effects, and then add sound effects to audio texts in batches to enhance the atmosphere of audio texts.

[0048] Figure 2 is a flow chart of a method for adding sound effects according to an exemplary disclosed embodiment. Figure 2 As shown, the sound effect adding method includes the following steps:

[0049] S21. Determine the sentence sentiment label of each sentence in the text to be processed based on the sentiment judgment model.

[0050] Sentence emotion labels can be first-level labels, and each label is unrelated to each other. For example, label 1 can represent "happiness", label 2 can represent "fear", label 3 can represent "surprise", etc. Sentence emotion labels can also be multi-level labels, and each label has a subordinate relationship. For example, label 1 can represent "boredom", label 2 can represent "disgust", label 3 can represent "hatred", and both label 1 and label 3 can be subordinate to label 2 representing the emotion of "disgust", label 4 can represent "confusion", label 5 can represent "surprise", label 6 can represent "astonishment", and both label 4 and label 6 can be subordinate to label 3 representing the emotion of "surprise". It is worth noting that when it is determined that a sentence has no obvious emotional bias, a label representing "neutral emotion" can be added to it.

[0051] It is worth noting that when the emotion of each sentence in the text to be processed is judged by the emotion judgment model, the input to the emotion judgment model can be the text to be processed itself. The emotion judgment model judges the emotion of the sentence by analyzing the semantics of the text and generates an emotion label. The input to the emotion judgment model can also be an audio file corresponding to the text to be processed that has been vocalized (for example: text reading, novel dubbing, etc.). The emotion judgment model determines the emotion label of the sentence by analyzing the voice emotion of the reciter and / or by judging the semantics of the speech.

[0052] Among them, one sentence can correspond to one sentence emotion label, and can also correspond to multiple sentence emotion labels, and the present disclosure does not impose any limitation on this.

[0053] S22. Determine the sentiment offset value of the text to be processed based on the largest number of label types among the plurality of sentence sentiment labels.

[0054] By determining the majority sentiment label of the full text, the sentiment offset value of the full text can be determined to characterize the sentiment tone of the full text. For example, when the full text has 100 sentences and 100 sentiment labels are determined based on the full text, of which 70 sentiment labels are "sad", 20 sentiment labels are "doubtful", and 10 sentiment labels are "angry", then the majority sentiment label of the full text can be determined to be "sad", which can indicate that the sentiment tone of the full text is "sad".

[0055] Therefore, the emotion offset value can be determined based on the label type with the largest number. The emotion offset value is used to weight the label value of the emotion type in the full text (that is, to weight the emotion label corresponding to the basic emotion of the full text). The specific weighting value can be flexibly set according to the actual application situation. For example, the emotion bias of novel texts is stronger, and the emotion offset value can be set higher to increase the weight of the basic emotion in subsequent steps and make the generated sound effects more in line with the basic emotion of the full text. The emotion bias of document-based texts is weaker, and the emotion offset value can be set lower to avoid over-weighting the content in the document that is not related to the basic emotion, so as to avoid adding inappropriate sound effects.

[0056] S23. For each paragraph of the text to be processed, determine the sentiment distribution vector of the paragraph according to the sentence sentiment labels of the multiple sentences corresponding to the paragraph.

[0057] The whole text has a sentiment bias, and each paragraph may also have its own sentiment bias. For a paragraph, the number of different sentiment labels in the paragraph can be used as the score of the vectorized value to determine the sentiment distribution vector of the paragraph. For example, there are 5 kinds of sentiment labels, and there are 3 "happy" labels, 4 "sad" labels, 2 "angry" labels, 1 "surprised" label and 10 "neutral" labels in the paragraph. Then the sentiment distribution vector of the paragraph can be determined as V1 = [3, 4, 2, 1, 10], where each score represents the number of labels of the label type corresponding to the score position.

[0058] S24. Determine the emotion probability distribution of the paragraph based on the emotion offset value and the emotion distribution vector corresponding to the paragraph.

[0059] The sentiment offset value is used to weight the sentiment distribution vector. For example, when the sentiment offset value is represented as a weighted happy label, the score representing "happiness" in the sentiment distribution vector can be increased.

[0060] In a possible implementation, the sentiment offset value may be superimposed with the score corresponding to the sentiment category corresponding to the sentiment offset value in the sentiment distribution vector corresponding to the paragraph to determine a target sentiment distribution vector.

[0061] For example, the emotion offset value can be "offset = [0.2, 0, 0, 0, 0]", which means adding 0.2 to the first score of the emotion distribution vector (i.e., the score representing happiness), and the target emotion distribution vector V2 = [3, 4, 2, 1, 10] + [0.2, 0, 0, 0, 0] = [3.2, 4, 2, 1, 10] can be obtained.

[0062] After weighting, the weighted sentiment distribution vector can be converted into a sentiment distribution probability. Specifically, the ratio of each score of the weighted sentiment distribution vector to the total score can be used as the distribution probability of the score. For example, the weighted sentiment distribution vector V2 = [3.2, 4, 2, 1, 10], then the distribution probability of the first score is 3.2 / 20.2 = 0.158, the distribution probability of the second score is 4 / 20.2 = 0.198, the distribution probability of the third score is 2 / 20.2 = 0.099, the distribution probability of the fourth score is 1 / 20.2 = 0.05, and the distribution probability of the fifth score is 10 / 20.2 = 0.495. Then the sentiment distribution probability V3 can be determined to be [0.158, 0.198, 0.099, 0.050, 0.495].

[0063] S25. Divide the text to be processed into a plurality of structural segments according to the number of types of the sentence emotion tags and a preset number threshold, wherein the sound effects in the sound effect library are classified according to the types of the structural segments.

[0064] The text may have different structures, such as foreshadowing, main body, climax, transition, ending, etc. Each structure may include multiple paragraphs, and one or more paragraphs belonging to the same structure are a structural segment. The text can be divided into different structural segments according to the number of emotions. For example, the number of 10 types of sentence emotion tags can be used as a threshold. Starting from the starting paragraph of the text, multiple consecutive paragraphs that include at least 10 sentence emotion tags are used as a designated structural segment (such as a foreshadowing segment), and starting from the next paragraph, multiple consecutive paragraphs that include at least 10 sentence emotion tags are used as another designated structural segment (such as a main body segment); or, different thresholds can be set for different structural segments. For example, the emotion type threshold of the foreshadowing segment can be 5, the emotion type threshold of the main body segment can be 7, and the emotion type threshold of the climax segment can be 15. Then, starting from the starting paragraph of the text, multiple consecutive paragraphs that include at least 5 sentence emotion tags can be used as the foreshadowing segment, and starting from the next paragraph, multiple consecutive paragraphs that include at least 7 sentence emotion tags can be used as the main body segment, and starting from the next paragraph, multiple consecutive paragraphs that include at least 15 sentence emotion tags can be used as the climax segment.

[0065] It is worth noting that the above threshold for dividing the structural segments can be set according to the number of types of sentence sentiment tags in the full text, so as to divide the structural segments more efficiently.

[0066] The sound effects in the sound effect library have two attribute labels, one is the sound effect emotion label, which is the label type corresponding to the sentence emotion label, and the other is the structure label, which indicates the text structure in which the sound effect is applied.

[0067] S26. For each structural segment, add the emotion category with the largest probability value in the emotion probability distribution of each paragraph in the structural segment and the probability value corresponding to the emotion category to the emotion list of the structural segment.

[0068] Considering that the emotion of the text is continuous and there are emotional associations between paragraphs, separating the paragraphs to judge the emotion may cause abrupt sound effects. Therefore, an emotion list can be set based on the structural segment to express the emotional bias in a structural segment.

[0069] For example, there are 5 paragraphs in a certain structure segment, among which the sentiment probability distribution of paragraph 1 is [0.5, 0.1, 0.1, 0.1, 0.1], the sentiment probability distribution of paragraph 2 is [0.1, 0.21, 0.1, 0.29, 0.1], the sentiment probability distribution of paragraph 3 is [0.1, 0.5, 0.1, 0.1, 0.1], the sentiment probability distribution of paragraph 4 is [0.1, 0.1, 0.4, 0.2, 0.1], and the sentiment probability distribution of paragraph 5 is [0.1, 0.1, 0.4, 0.15, 0.15]. The types of emotional labels represented by the value position are [happy, sad, surprised, moved, disgusted]. Then we can extract "happy: 0.5" from paragraph 1 and add it to the emotion list, extract "moved: 0.29" from paragraph 2 and add it to the emotion list, extract "sad: 0.5" from paragraph 3 and add it to the emotion list, extract "surprised: 0.4" from paragraph 4 and add it to the emotion list, and extract "surprised: 0.4" from paragraph 5 and add it to the emotion list. The final emotion list is "happy: 0.5, sad: 0.5, surprised: 0.8, moved: 0.29, disgusted: 0".

[0070] S27. According to the emotion list, determine a plurality of target sound effects that match the emotion list from the categories corresponding to the structure segments in the sound effect library.

[0071] A plurality of target sound effects may be determined from a plurality of sound effects corresponding to the structure segment based on the emotion list, wherein the number of target sound effects may be related to the number of paragraphs in the structure segment, or may be the number of sound effects preset for the structure segment.

[0072] In a possible implementation, each structural segment also corresponds to a preset number of sound effects, and according to the multiple emotion types in the emotion list and the probability values ​​corresponding to the emotion types, based on preset matching conditions, multiple target sound effects are determined from the categories corresponding to the structural segment in the sound effect library, wherein the number of target sound effects is consistent with the preset number of sound effects.

[0073] For example, when the number of target sound effects is set to 3, when the emotion list is "happy: 0.5, sad: 0.5, surprised: 0.8, touched: 0.29, disgusted: 0", the sound effects corresponding to the first three emotion labels with the highest probability values ​​can be selected as the target sound effects, that is, the sound effects corresponding to the three emotion labels of surprised, happy, and sad can be selected as the target sound effects.

[0074] In a possible implementation, the sampling rate of the emotion labels in the emotion list can also be determined according to the probability values ​​in the emotion list. For example, when the emotion list is "happy: 0.5, sad: 0.5, surprised: 0.8, moved: 0.29, disgust: 0", the ratio of the probability value corresponding to each emotion label to the sum of all probability values ​​can be used as the sampling rate of the emotion label to obtain a new emotion list of "happy: 0.24, sad: 0.24, surprised: 0.38, moved: 0.14, disgust: 0", and sample from the sound effect corresponding to the structure segment according to the sampling rate. There is a 24% probability of sampling a sound effect labeled "happy", a 24% probability of sampling a sound effect labeled "sad", a 38% probability of sampling a sound effect labeled "surprised", a 14% probability of sampling a sound effect labeled "moved", and no sound effect labeled "disgusted" will be sampled. Combined with the preset number of sound effects (for example, 3), it can be determined that the expected value of the sound effect labeled "happy" is 0.72, the expected value of the sound effect labeled "sad" is 0.72, the expected value of the sound effect labeled "surprised" is 1.14, the expected value of the sound effect labeled "touched" is 0.42, and the expected value of the sound effect labeled "disgusted" is 0.

[0075] S28. Add the multiple target sound effects to the audio position corresponding to the structure segment in the audio file corresponding to the text to be processed.

[0076] For example, if the timeline corresponding to the structure segment is "00:01:11~00:13:01", the target sound effect can be inserted into the timeline of the audio file, which can be any optional position such as the beginning, end, or middle of the timeline. The specific insertion position is not limited in this disclosure.

[0077] In a possible implementation, the sound effect emotion tag of the target sound effect may be matched with the emotion tags of each paragraph stored in the emotion list, so that the target sound effect is added to the audio file corresponding to the paragraph that best matches its emotion tag.

[0078] In a possible implementation, for each target sound effect, the sound effect length of the target sound effect can be determined, and a target paragraph whose text length matches the sound effect length of the target sound effect can be determined from the structure segment; the target sound effect can be added to the audio position corresponding to the target paragraph in the audio file.

[0079] In a possible implementation, the emotion list also includes the text length of each paragraph. When determining the target sound effect, in addition to considering the structural label and emotion label of the sound effect, the length of the sound effect is also considered to determine the sound effect that matches the text length of the paragraph corresponding to the sampled emotion label. When adding sound effects to the audio file, for each target sound effect, determine the paragraph whose text length matches the sound effect length of the target sound effect, and add the target sound effect to the audio position corresponding to the paragraph in the audio file.

[0080] Based on the above technical solution, at least the following technical effects can be achieved:

[0081] The sentiment judgment model can be used to identify the sentiment of the text as a whole and of each paragraph, and the text can be divided into structural segments. Based on the emotional coherence of the structural segments, sound effects that are consistent with the sentiment of the entire text and the paragraph can be determined for each paragraph. This can achieve the effect of automatically selecting and adding sound effects, improve the efficiency of adding sound effects, and then add sound effects to audio texts in batches to enhance the atmosphere of the audio texts.

[0082] Figure 3 is a block diagram of a device for adding sound effects according to an exemplary disclosed embodiment. Figure 3 As shown, the device 300 includes a sentence determination module 310, an offset determination module 320, a distribution determination module 330, a probability determination module 340, a sound effect determination module 350 and a sound effect adding module 360.

[0083] The sentence determination module 310 is used to determine the sentence emotion label of each sentence in the text to be processed based on the emotion determination model.

[0084] The offset determination module 320 is used to determine the sentiment offset value of the text to be processed based on the largest number of label types among the plurality of sentence sentiment labels.

[0085] The distribution determination module 330 is used to determine, for each paragraph of the text to be processed, a sentiment distribution vector of the paragraph according to the sentence sentiment labels of a plurality of sentences corresponding to the paragraph.

[0086] The probability determination module 340 is used to determine the emotion probability distribution of the paragraph based on the emotion offset value and the emotion distribution vector corresponding to the paragraph.

[0087] The sound effect determination module 350 is used to determine a target sound effect that matches the paragraph according to the emotion probability distribution of the paragraph and the sound effect emotion tags of multiple sound effects in the sound effect library.

[0088] The sound effect adding module 360 ​​is used to add the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed.

[0089] Optionally, the device also includes a segmentation module, which is used to divide the text to be processed into multiple structural segments according to the number of types of the sentence emotion tags and a preset number threshold, wherein the sound effects in the sound effect library are classified according to the type of the structural segment; the sound effect determination module is used to add, for each structural segment, the emotion type with the largest probability value in the emotion probability distribution of each paragraph in the structural segment, and the probability value corresponding to the emotion type, to the emotion list of the structural segment; according to the emotion list, determine multiple target sound effects that match the emotion list from the categories corresponding to the structural segment in the sound effect library.

[0090] Optionally, each of the structural segments also corresponds to a preset number of sound effects, and the sound effect determination module is further used to determine multiple target sound effects from the categories corresponding to the structural segments in the sound effect library based on preset matching conditions according to the multiple emotion types in the emotion list and the probability values ​​corresponding to the emotion types, wherein the number of target sound effects is consistent with the preset number of sound effects.

[0091] Optionally, the probability determination module is used to superimpose the emotion offset value and the score corresponding to the emotion type corresponding to the emotion offset value in the emotion distribution vector corresponding to the paragraph to determine the target emotion distribution vector; based on a preset conversion rule, convert the target emotion distribution vector into the emotion probability distribution of the paragraph.

[0092] Optionally, the sound effect adding module is used to add the multiple target sound effects to the audio position corresponding to the structure segment in the audio file corresponding to the text to be processed.

[0093] Optionally, the sound effect adding module is also used to determine the sound effect length of the target sound effect for each target sound effect, and determine a target paragraph whose text length matches the sound effect length of the target sound effect from the structure segment; and add the target sound effect to the audio position corresponding to the target paragraph in the audio file.

[0094] Optionally, the emotion list also includes the text length of the paragraph, and the audio length of the target sound effect matches the text length of the paragraph; the sound effect adding module is also used to determine, for each target sound effect, a paragraph whose text length matches the sound effect length of the target sound effect, and add the target sound effect to the audio position corresponding to the paragraph in the audio file.

[0095] Through the above technical solution, at least the following technical effects can be achieved:

[0096] The sentiment judgment model can be used to identify the sentiment of the entire text and each paragraph, and determine the sound effects that are consistent with the sentiment of the entire text and the paragraph for each paragraph. This can achieve the effect of automatically selecting and adding sound effects, improve the efficiency of adding sound effects, and then add sound effects to audio texts in batches to enhance the atmosphere of audio texts.

[0097] The sentiment determination model mentioned in the above embodiment can determine the sentiment label of a sentence by the words and word frequency in the sentence, wherein the sentiment determination model can be trained in the following manner:

[0098] Prepare a large amount of text and hand it over to professional annotators for sentiment labeling. Use the word segmentation model to segment the annotated text and obtain a word list, which contains all the words and their frequency in each sentiment label. The probability of each word appearing in each sentiment is calculated through the word frequency and total word frequency, and the probability variance of each word is calculated through the probability. Set a threshold, record the words whose variance exceeds the threshold in a new word list according to the probability, and for the word segmentation results of the annotated text, take the top words in the word list from the target sentence and its preceding and following sentences to form a multi-dimensional word sequence. After the word sequence is vectorized, the position information and sentence number in the original sentence are added. The above vectorization results are used as the model input features during training and inference, and the manually annotated sentiment labels are used as learning targets to train the sentiment discrimination model, so that the sentiment discrimination model can determine the sentiment label of the sentence through the words and word frequency in the sentence.

[0099] Reference below Figure 4 , which shows an electronic device (eg, Figure 1 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 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 disclosure.

[0100] like Figure 4As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0101] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0102] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory 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 the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0103] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, 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 may 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 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 of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0104] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0105] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0106] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains at least two Internet Protocol addresses; sends a node evaluation request including the at least two Internet Protocol addresses to a node evaluation device, wherein the node evaluation device selects an Internet Protocol address from the at least two Internet Protocol addresses and returns it; receives the Internet Protocol address returned by the node evaluation device; wherein the obtained Internet Protocol address indicates an edge node in a content distribution network.

[0107] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: receives a node evaluation request including at least two Internet Protocol addresses; selects an Internet Protocol address from the at least two Internet Protocol addresses; and returns the selected Internet Protocol address; wherein the received Internet Protocol address indicates an edge node in a content distribution network.

[0108] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0109] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the 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 implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart 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.

[0110] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, the first acquisition module may also be described as a "module for acquiring at least two Internet Protocol addresses".

[0111] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0112] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), 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 of the foregoing.

[0113] According to one or more embodiments of the present disclosure, Example 1 provides a method for adding sound effects, including determining a sentence emotion label for each sentence of a text to be processed based on an emotion judgment model; determining an emotion offset value of the text to be processed based on the type of label with the largest number among a plurality of the sentence emotion labels; for each paragraph of the text to be processed, determining an emotion distribution vector of the paragraph based on the sentence emotion labels of a plurality of sentences corresponding to the paragraph; determining an emotion probability distribution of the paragraph based on the emotion offset value and the emotion distribution vector corresponding to the paragraph; determining a target sound effect that matches the paragraph based on the emotion probability distribution of the paragraph and the sound effect emotion labels of a plurality of sound effects in a sound effect library; and adding the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed.

[0114] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, which further includes: dividing the text to be processed into multiple structural segments according to the number of types of sentence emotion tags and a preset number threshold, wherein the sound effects in the sound effect library are classified according to the types of structural segments; determining the target sound effects that match the paragraph according to the emotion probability distribution of the paragraph and the sound effect emotion tags of the multiple sound effects in the sound effect library, including: for each structural segment, adding the emotion category with the largest probability value in the emotion probability distribution of each paragraph in the structural segment and the probability value corresponding to the emotion category to the emotion list of the structural segment; according to the emotion list, determining multiple target sound effects that match the emotion list from the categories corresponding to the structural segment in the sound effect library.

[0115] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein each of the structural segments also corresponds to a preset number of sound effects, and according to the emotion list, a plurality of target sound effects that match the emotion list are determined from the category in the sound effects library that corresponds to the structural segment, including: according to a plurality of emotion types in the emotion list and probability values ​​corresponding to the emotion types, based on preset matching conditions, a plurality of target sound effects are determined from the category in the sound effects library that corresponds to the structural segment, wherein the number of target sound effects is consistent with the preset number of sound effects.

[0116] According to one or more embodiments of the present disclosure, Example 4 provides the method of Examples 1-3, which determines the emotion probability distribution of the paragraph based on the emotion offset value and the emotion distribution vector corresponding to the paragraph, including: superimposing the emotion offset value with the score corresponding to the emotion type corresponding to the emotion offset value in the emotion distribution vector corresponding to the paragraph to determine the target emotion distribution vector; and converting the target emotion distribution vector into the emotion probability distribution of the paragraph based on a preset conversion rule.

[0117] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 2 or 3, wherein adding the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed includes: adding the multiple target sound effects to the audio position corresponding to the structure segment in the audio file corresponding to the text to be processed.

[0118] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein adding the multiple target sound effects to the audio position corresponding to the structure segment in the audio file corresponding to the text to be processed includes: for each target sound effect, determining the sound effect length of the target sound effect, and determining from the structure segment a target paragraph whose text length matches the sound effect length of the target sound effect; adding the target sound effect to the audio position corresponding to the target paragraph in the audio file.

[0119] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 5, wherein the emotion list also includes the text length of the paragraph, and the audio length of the target sound effect matches the text length of the paragraph; adding the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed includes: for each target sound effect, determining a paragraph whose text length matches the sound effect length of the target sound effect, and adding the target sound effect to the audio position corresponding to the paragraph in the audio file.

[0120] According to one or more embodiments of the present disclosure, Example 8 provides a sound effect adding device, including a sentence determination module, for determining the sentence emotion label of each sentence of the text to be processed based on the emotion judgment model. An offset determination module, for determining the emotion offset value of the text to be processed based on the label type with the largest number among the multiple sentence emotion labels. A distribution determination module, for determining the emotion distribution vector of each paragraph of the text to be processed according to the sentence emotion labels of the multiple sentences corresponding to the paragraph. A probability determination module, for determining the emotion probability distribution of the paragraph based on the emotion offset value and the emotion distribution vector corresponding to the paragraph. A sound effect determination module, for determining the target sound effect matching the paragraph based on the emotion probability distribution of the paragraph and the sound effect emotion labels of the multiple sound effects in the sound effect library. A sound effect adding module, for adding the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed.

[0121] According to one or more embodiments of the present disclosure, Example 9 provides the device of Example 8, wherein the device also includes a segmentation module for dividing the text to be processed into multiple structural segments according to the number of types of the sentence emotion tags and a preset number threshold, wherein the sound effects in the sound effect library are classified according to the types of the structural segments; the sound effect determination module is used to, for each structural segment, add the emotion type with the largest probability value in the emotion probability distribution of each paragraph in the structural segment, and the probability value corresponding to the emotion type, to the emotion list of the structural segment; and according to the emotion list, determine multiple target sound effects that match the emotion list from the categories corresponding to the structural segment in the sound effect library.

[0122] According to one or more embodiments of the present disclosure, Example 10 provides the device of Example 9, wherein each of the structural segments also corresponds to a preset number of sound effects, and the sound effect determination module is further used to determine a plurality of target sound effects from the categories corresponding to the structural segments in the sound effect library based on preset matching conditions according to the plurality of emotion types in the emotion list and the probability values ​​corresponding to the emotion types, wherein the number of the target sound effects is consistent with the preset number of sound effects.

[0123] According to one or more embodiments of the present disclosure, Example 11 provides the device of Examples 8-10, wherein the probability determination module is used to superimpose the emotion offset value and the score corresponding to the emotion type corresponding to the emotion offset value in the emotion distribution vector corresponding to the paragraph to determine the target emotion distribution vector; based on a preset conversion rule, convert the target emotion distribution vector into the emotion probability distribution of the paragraph.

[0124] According to one or more embodiments of the present disclosure, Example 12 provides the apparatus of Example 9 or 10, wherein the sound effect adding module is used to add the multiple target sound effects to the audio positions corresponding to the structure segments in the audio file corresponding to the text to be processed.

[0125] According to one or more embodiments of the present disclosure, Example 13 provides the device of Example 12, wherein the sound effect adding module is further used to determine, for each target sound effect, the sound effect length of the target sound effect, and determine, from the structure segment, a target paragraph whose text length matches the sound effect length of the target sound effect; and add the target sound effect to the audio position in the audio file corresponding to the target paragraph.

[0126] According to one or more embodiments of the present disclosure, Example 14 provides the device of Example 12, wherein the emotion list also includes the text length of the paragraph, and the audio length of the target sound effect matches the text length of the paragraph; the sound effect adding module is also used to determine, for each target sound effect, a paragraph whose text length matches the sound effect length of the target sound effect, and add the target sound effect to the audio position corresponding to the paragraph in the audio file.

[0127] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0128] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0129] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A method for adding sound effects, characterized in that: The method comprises: Based on the sentiment determination model, determine the sentence sentiment label of each sentence in the text to be processed; Determine the sentiment offset value of the text to be processed based on the largest number of label types among the plurality of sentence sentiment labels, wherein the sentiment offset value is used to characterize the sentiment tone of the text to be processed; For each paragraph of the text to be processed, determining a sentiment distribution vector of the paragraph according to the sentence sentiment labels of a plurality of sentences corresponding to the paragraph, wherein the sentiment distribution vector is used to characterize the number of different sentiment labels in the paragraph; The emotion offset value is superimposed with the score corresponding to the emotion type corresponding to the emotion offset value in the emotion distribution vector corresponding to the paragraph to determine a target emotion distribution vector; Based on a preset conversion rule, converting the target sentiment distribution vector into a sentiment probability distribution of the paragraph; Determine a target sound effect that matches the paragraph according to the emotion probability distribution of the paragraph and the sound effect emotion tags of multiple sound effects in the sound effect library; The target sound effect is added to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed.

2. The method according to claim 1, characterized in that The method further comprises: According to the number of types of the sentence emotion tags and a preset number threshold, the text to be processed is divided into a plurality of structural segments, wherein the sound effects in the sound effect library are classified according to the types of the structural segments; Determining a target sound effect matching the paragraph according to the emotion probability distribution of the paragraph and the sound effect emotion tags of a plurality of sound effects in a sound effect library comprises: For each structural segment, the emotion category with the largest probability value in the emotion probability distribution of each paragraph in the structural segment and the probability value corresponding to the emotion category are added to the emotion list of the structural segment; According to the emotion list, a plurality of target sound effects matching the emotion list are determined from the categories corresponding to the structure segments in the sound effect library.

3. The method according to claim 2, characterized in that Each of the structural segments also corresponds to a preset number of sound effects. The step of determining, according to the emotion list, a plurality of target sound effects matching the emotion list from the categories corresponding to the structure segments in the sound effect library comprises: According to the multiple emotion types in the emotion list and the probability values ​​corresponding to the emotion types, based on preset matching conditions, multiple target sound effects are determined from the categories corresponding to the structure segments in the sound effect library, wherein the number of the target sound effects is consistent with the number of preset sound effects.

4. The method according to any one of claims 2 or 3, characterized in that: The step of adding the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed comprises: The multiple target sound effects are added to the audio positions corresponding to the structure segments in the audio file corresponding to the text to be processed.

5. The method according to claim 4, characterized in that The step of adding the multiple target sound effects to the audio position corresponding to the structure segment in the audio file corresponding to the text to be processed includes: For each target sound effect, determining the sound effect length of the target sound effect, and determining a target paragraph whose text length matches the sound effect length of the target sound effect from the structure segment; The target sound effect is added to the audio position corresponding to the target segment in the audio file.

6. The method according to claim 4, characterized in that The emotion list also includes the text length of the paragraph, and the audio length of the target sound effect matches the text length of the paragraph; The step of adding the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed comprises: For each target sound effect, a paragraph whose text length matches the sound effect length of the target sound effect is determined, and the target sound effect is added to the audio position corresponding to the paragraph in the audio file.

7. A sound effect adding device, characterized in that: The device comprises: A sentence determination module is used to determine the sentence emotion label of each sentence in the text to be processed based on the emotion determination model; An offset determination module, used to determine the sentiment offset value of the text to be processed based on the largest number of label types among the plurality of sentence sentiment labels, wherein the sentiment offset value is used to characterize the sentiment tone of the text to be processed; A distribution determination module, for determining, for each paragraph of the text to be processed, a sentiment distribution vector of the paragraph according to the sentence sentiment labels of a plurality of sentences corresponding to the paragraph, wherein the sentiment distribution vector is used to characterize the number of different sentiment labels in the paragraph; A probability determination module, used to superimpose the emotion offset value and the score corresponding to the emotion type corresponding to the emotion offset value in the emotion distribution vector corresponding to the paragraph, determine a target emotion distribution vector, and convert the target emotion distribution vector into an emotion probability distribution of the paragraph based on a preset conversion rule; A sound effect determination module, configured to determine a target sound effect matching the paragraph according to the emotion probability distribution of the paragraph and the sound effect emotion tags of a plurality of sound effects in a sound effect library; The sound effect adding module is used to add the target sound effect to the audio position corresponding to the paragraph in the audio file corresponding to the text to be processed.

8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 6 are implemented.

9. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 6.