Dialogue character recognition method based on e-book, electronic device and storage medium

By identifying the conversational characters in the e-book, the problem of being unable to distinguish different speakers in speech synthesis is solved, and a more accurate and realistic speech synthesis effect is achieved.

CN112966490BActive Publication Date: 2025-01-07ZHANGYUE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110275632.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-15
Publication Date
2025-01-07
Estimated Expiration
2041-03-15

AI Technical Summary

Technical Problem

The prior art cannot accurately identify dialogue characters in e-books during the speech synthesis process, resulting in the inability to differentiate differentiated processing for different speakers, affecting user understanding and experience.

Method used

By extracting dialogue information in e-book text, the order relationship between the character dialogue content and the dialogue-related content is determined, and a pre-trained dialogue character recognition model is used to identify the speaker, and then differentiated speech synthesis processing is carried out.

Benefits of technology

It improves the accuracy of dialogue character recognition, enhances the authenticity and user experience of speech synthesis, and can perform differentiated processing according to the characteristics of the speaker.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112966490B_ABST
    Figure CN112966490B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for identifying dialogue characters based on an electronic book, an electronic device and a storage medium. The method comprises: obtaining dialogue information contained in an electronic book text, extracting dialogue content and dialogue-related content contained in the dialogue information, and determining the order relationship between the dialogue content and the dialogue-related content; obtaining a dialogue character recognition model that is pre-trained and matches the order relationship between the dialogue content and the dialogue-related content, and inputting the dialogue information into the acquired dialogue character recognition model; and identifying the character entity corresponding to the speaker contained in the dialogue information according to the output result of the dialogue character recognition model. In this way, a dialogue character recognition model that matches the order relationship between the dialogue content and the dialogue-related content is pre-trained, so that the corresponding dialogue character recognition model is called for recognition according to the order relationship, thereby improving the accuracy of the recognition result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to an electronic book-based dialogue character recognition method, electronic equipment and storage medium. Background Art

[0002] At present, with the increasing popularity of audiobooks, more and more users are beginning to switch from reading to listening to books. Accordingly, in the process of making audiobooks, it is necessary to perform text-to-speech operations on e-books.

[0003] Normally, the speech synthesis process is realized by directly calling an open source text-to-speech tool. In the above processing method, a unified process is performed on all the contents in the e-book text. However, the inventor discovered in the process of realizing the present invention that: for e-books containing dialogue content, the emotional tones of the narration content and the dialogue content are different, and the use of the same processing method is not conducive to users quickly understanding the content of the book; and the emotional tones and character sound quality characteristics of multiple dialogue contents corresponding to different speakers are also different, and the use of the same processing method is not conducive to users distinguishing the speakers corresponding to the dialogue content.

[0004] It can be seen that in order to improve the speech synthesis effect, a solution that can accurately identify the dialogue characters in the e-book is urgently needed so as to perform different speech synthesis processing methods for different dialogue characters. Summary of the invention

[0005] In view of the above problems, the present invention is proposed to provide a method, electronic device and storage medium for identifying dialogue characters based on an electronic book, which overcome the above problems or at least partially solve the above problems.

[0006] According to one aspect of the present invention, a method for identifying dialogue characters based on an electronic book is provided, the method comprising:

[0007] Acquire dialogue information contained in the electronic book text, extract character dialogue content and dialogue-related content contained in the dialogue information, and determine the order relationship between the character dialogue content and the dialogue-related content;

[0008] Obtaining a pre-trained dialogue character recognition model that matches the order relationship between the dialogue content of the characters and the dialogue-related content, and inputting the dialogue information into the obtained dialogue character recognition model;

[0009] According to the output result of the dialogue character recognition model, the character entity corresponding to the speaker contained in the dialogue information is identified.

[0010] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0011] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the following operations:

[0012] Acquire dialogue information contained in the electronic book text, extract character dialogue content and dialogue-related content contained in the dialogue information, and determine the order relationship between the character dialogue content and the dialogue-related content;

[0013] Obtaining a pre-trained dialogue character recognition model that matches the order relationship between the dialogue content of the characters and the dialogue-related content, and inputting the dialogue information into the obtained dialogue character recognition model;

[0014] According to the output result of the dialogue character recognition model, the character entity corresponding to the speaker contained in the dialogue information is identified.

[0015] According to another aspect of the present invention, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables the processor to perform the following operations:

[0016] Acquire dialogue information contained in the electronic book text, extract character dialogue content and dialogue-related content contained in the dialogue information, and determine the order relationship between the character dialogue content and the dialogue-related content;

[0017] Obtaining a pre-trained dialogue character recognition model that matches the order relationship between the dialogue content of the characters and the dialogue-related content, and inputting the dialogue information into the obtained dialogue character recognition model;

[0018] According to the output result of the dialogue character recognition model, the character entity corresponding to the speaker contained in the dialogue information is identified.

[0019] In the electronic book-based dialogue character recognition method, electronic device and storage medium provided by the present invention, first, the dialogue information contained in the electronic book text is obtained, the character dialogue content and the dialogue-related content contained in the dialogue information are extracted, and the order relationship between the character dialogue content and the dialogue-related content is determined; then, a dialogue character recognition model that is pre-trained and matches the order relationship between the character dialogue content and the dialogue-related content is obtained, and the character-like entity corresponding to the speaker contained in the dialogue-related content is recognized according to the dialogue character recognition model. It can be seen that this method can pre-train a dialogue character recognition model that matches the order relationship between the character dialogue content and the dialogue-related content, so that the corresponding dialogue character recognition model is called for recognition according to the order relationship between the character dialogue content and the dialogue-related content contained in the dialogue information, thereby improving the accuracy of the recognition result.

[0020] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0022] Figure 1 A flowchart of a method for identifying characters in dialogue based on an e-book provided by an embodiment of the present invention is shown;

[0023] Figure 2 A flowchart of a method for identifying characters in dialogue based on an e-book provided by another embodiment of the present invention is shown;

[0024] Figure 3 A schematic structural diagram of an electronic device according to another embodiment of the present invention is shown. DETAILED DESCRIPTION

[0025] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary 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 limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0026] Embodiment 1

[0027] Figure 1 FIG. 1 is a flow chart of a method for identifying characters in a dialogue based on an e-book provided by an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0028] Step S110: Acquire the dialogue information contained in the electronic book text, extract the character dialogue content and dialogue-related content contained in the dialogue information, and determine the order relationship between the character dialogue content and the dialogue-related content.

[0029] The dialogue information contained in the e-book text refers to: text information containing the dialogue content of the characters, specifically including the specific content of the characters' speech and context information related to the speech content. The dialogue-related content is closely related to the character dialogue content and is adjacent to the character dialogue content. The dialogue scenario information used to explain the character dialogue content specifically includes: scenario information of multiple dimensions such as character scenario, location scenario, and time scenario. Accordingly, by segmenting the character dialogue content and the dialogue-related content, the order relationship between the character dialogue content and the dialogue-related content can be determined, and based on the order relationship, information used to indicate the speaker can be extracted from the dialogue-related content to achieve the purpose of identifying the speaker.

[0030] Among them, the inventors found in the process of implementing the present invention that the order relationship between the characters' dialogue content and the dialogue-related content has an important influence on the identification of the speaker, and the recognition results corresponding to different order relationships may also be different. Therefore, in order to accurately identify the speaker of the dialogue content, in this embodiment, it is necessary to determine the order relationship between the characters' dialogue content and the dialogue-related content. Among them, the order relationship between the characters' dialogue content and the dialogue-related content mainly includes the following two situations:

[0031] In the first case, the character dialogue content is placed before the dialogue-related content. For example, the dialogue information is as follows: "I have thought it through." Li Si said leisurely. Among them, "I have thought it through" is the character dialogue content, and "Li Si said leisurely" is the dialogue-related content. Obviously, the character dialogue content is placed before the dialogue-related content. This method is used to highlight the character dialogue content, so the dialogue-related content is placed at the end.

[0032] In the second case, the character dialogue content is located after the dialogue-related content. For example, the dialogue information is as follows: Zhang San said with a smile: "How come you have time to come here today?" Among them, "How come you have time to come here today" is the character dialogue content, and "Zhang San said with a smile" is the dialogue-related content. Obviously, the character dialogue content is located after the dialogue-related content, and this method is used to highlight the dialogue character.

[0033] In addition to the above two methods, the order relationship between the character dialogue content and the dialogue-related content may be various. For example, the dialogue-related content may be located between two different character dialogue contents, or the character dialogue content may be located between two different dialogue-related contents. The present invention does not limit the specific implementation details.

[0034] Step S120: Obtain a pre-trained dialogue character recognition model that matches the order relationship between the character dialogue content and the dialogue-related content, and input the dialogue information into the obtained dialogue character recognition model.

[0035] The dialogue character recognition model is trained based on the obtained e-book sample content. According to the order relationship between the character dialogue content and the dialogue-related content in the e-book sample content, the e-book sample content is divided into multiple content sets corresponding to various order relationships, and the character recognition models corresponding to various order relationships are trained based on each content set.

[0036] For example, when the character dialogue content is before the dialogue-related content, a first character recognition model corresponding to this situation is trained; when the character dialogue content is after the dialogue-related content, a second character recognition model corresponding to this situation is trained. Since different dialogue character recognition models are trained based on different sample contents, they can accurately recognize the corresponding types of text content.

[0037] Step S130: According to the output result of the dialogue character recognition model, identify the character entity corresponding to the speaker contained in the dialogue information.

[0038] Specifically, the dialogue character recognition model is used to recognize the character entity corresponding to the speaker contained in the dialogue information. Therefore, the speaker can be identified through the dialogue character recognition model, so as to facilitate differentiated speech synthesis processing according to the characteristics of the speaker.

[0039] It can be seen that this method can pre-train a dialogue character recognition model that matches the order relationship between the character dialogue content and the dialogue-related content, so as to call the corresponding dialogue character recognition model for recognition according to the order relationship between the character dialogue content and the dialogue-related content contained in the dialogue information, thereby improving the accuracy of the recognition results.

[0040] Embodiment 2

[0041] Figure 2 FIG. 2 shows a flow chart of a method for identifying characters in a dialogue based on an e-book provided by another embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0042] Step S200: pre-training a dialogue character recognition model that matches the sequence relationship between the character dialogue content and the dialogue-related content.

[0043] Among them, the character dialogue content is the specific speech content, and the dialogue-related content is closely related to the character dialogue content and is located adjacent to the character dialogue content, and is used to explain the dialogue scenario information of the character dialogue content, specifically including: scenario information of multiple dimensions such as character scenario, location scenario, and time scenario. Accordingly, by segmenting the character dialogue content and the dialogue-related content, the order relationship between the character dialogue content and the dialogue-related content can be determined, and based on the order relationship, information used to indicate the speaker can be extracted from the dialogue-related content to achieve the purpose of identifying the speaker.

[0044] The dialogue character recognition model that matches the order relationship between the character dialogue content and the dialogue-related content includes at least: a first recognition model in which the character dialogue content is located before the dialogue-related content, and a second recognition model in which the character dialogue content is located after the dialogue-related content. The first recognition model is trained by a first training sample in which the character dialogue content is located before the dialogue-related content, and the second recognition model is trained by a second training sample in which the character dialogue content is located after the dialogue-related content.

[0045] In the specific implementation, dialogue information is extracted from a large number of electronic books in advance as training samples, wherein the training samples whose characters' dialogue content is before the dialogue-related content are used as the first training samples to train the first recognition model whose characters' dialogue content is before the dialogue-related content; the training samples whose characters' dialogue content is after the dialogue-related content are used as the second training samples to train the second recognition model whose characters' dialogue content is after the dialogue-related content. The speakers included in the training samples are annotated in advance so as to train the dialogue character recognition model according to the annotated results.

[0046] Step S210: Acquire the dialogue information contained in the electronic book text, extract the character dialogue content and dialogue-related content contained in the dialogue information, and determine the order relationship between the character dialogue content and the dialogue-related content.

[0047] The dialogue information contained in the e-book text refers to text information containing the dialogue content of characters, including the specific content of the characters' speech and context information related to the speech content. In a specific implementation, the dialogue information contained in the e-book text can be extracted by using preset punctuation marks. The preset punctuation marks include quotation marks, colons, etc. Specifically, first, the dialogue content of the characters is extracted by using the preset punctuation marks. Then, the corresponding dialogue-related content is determined based on the context of the dialogue content of the characters.

[0048] By segmenting the character dialogue content and the dialogue-related content, the order relationship between the character dialogue content and the dialogue-related content can be determined, and based on the order relationship, information used to indicate the speaker can be extracted from the dialogue-related content and / or the character dialogue content to achieve the purpose of identifying the speaker.

[0049] Considering that the order relationship between the character's dialogue content and the dialogue-related content has an important influence on the identification of the speaker, the recognition results corresponding to different order relationships may also be different. Therefore, in order to accurately identify the speaker of the dialogue content, in this embodiment, it is necessary to determine the order relationship between the character's dialogue content and the dialogue-related content. Among them, the order relationship between the character's dialogue content and the dialogue-related content includes at least the following two situations: In the first situation, the character's dialogue content is located before the dialogue-related content. In the second situation, the character's dialogue content is located after the dialogue-related content. In addition to the above two methods, the order relationship between the character's dialogue content and the dialogue-related content may also be various situations.

[0050] In addition, the inventors found in the process of implementing the present invention that the dialogue information in actual situations may include multiple consecutive character dialogue contents or multiple consecutive dialogue-related contents. For example, the above situation often occurs in the case of a continuous dialogue between characters. In order to accurately identify the speaker in the above situation, in this embodiment, the following processing is further performed: when the extracted character dialogue contents are at least two, and / or the extracted dialogue-related contents are at least two, the adjacent character dialogue contents and dialogue-related contents are determined as an associated order combination, and at least two associated order combinations contained in the dialogue information are obtained, thereby respectively determining the order relationship between the character dialogue contents and dialogue-related contents in each associated order combination.

[0051] For example, suppose a dialogue message includes dialogue content between two characters (the dialogue content D1 of the first character and the dialogue content D2 of the second character) and dialogue-related content T between the two characters. Then the dialogue information is expressed as follows: D1TD2. Accordingly, the dialogue content of the first character and the dialogue-related content are taken as the first association order combination D1T, and the dialogue-related content and the dialogue content of the second character are taken as the second association order combination TD2. It can be seen that the first association order combination D1T belongs to the combination situation where the dialogue content of the characters is located before the dialogue-related content, and the second association order combination TD2 belongs to the combination situation where the dialogue content of the characters is located after the dialogue-related content. Accordingly, in the subsequent steps, each association order combination needs to be processed separately.

[0052] It can be seen that by dividing the associated order combinations, each adjacent group of character dialogue content and dialogue-related content can be determined as an associated order combination, thereby dividing the dialogue information containing multiple character dialogue content and dialogue-related content into multiple associated order combinations, thereby facilitating the use of the above-mentioned first recognition model or second recognition model to achieve accurate recognition in the subsequent process.

[0053] Step S220: Obtain a pre-trained dialogue character recognition model that matches the order relationship between the character dialogue content and the dialogue-related content, and input the dialogue information into the obtained dialogue character recognition model.

[0054] Specifically, in this step, it is necessary to select a dialogue character recognition model that matches the order relationship according to the order relationship between the character dialogue content and the dialogue-related content determined in step S210. When the number of extracted character dialogue contents is at least two, and / or the number of extracted dialogue-related contents is at least two, respectively obtain dialogue character recognition models corresponding to the order relationship between the character dialogue content and the dialogue-related content in each associated order combination, and obtain an output result corresponding to the associated order combination. For example, still taking the above example, since the first associated order combination D1T belongs to the combination situation where the character dialogue content is located before the dialogue-related content, the first associated order combination D1T is input into the above-mentioned first recognition model; and the second associated order combination TD2 belongs to the combination situation where the character dialogue content is located after the dialogue-related content, therefore, the second associated order combination TD2 is input into the above-mentioned second recognition model.

[0055] Step S230: According to the output result of the dialogue character recognition model, identify the character entity corresponding to the speaker contained in the dialogue information.

[0056] Specifically, the dialogue character recognition model is used to recognize the character entity corresponding to the speaker contained in the dialogue information. Therefore, the speaker can be identified through the dialogue character recognition model, so as to facilitate differentiated speech synthesis processing according to the characteristics of the speaker.

[0057] When there are at least two extracted character dialogue contents and / or at least two extracted dialogue-related contents, in this step, it is necessary to obtain multiple output results corresponding to each association order combination, and determine the character-like entity corresponding to the speaker contained in the dialogue-related content according to the confidence of the multiple output results. Still taking the above example, the first recognition result corresponding to the first association order combination D1T output by the first recognition model and the second recognition result corresponding to the second association order combination TD2 output by the second recognition model are respectively obtained. Next, each recognition result can be evaluated and scored by an evaluation mechanism, and the confidence of each recognition result is determined according to the scoring result, so as to determine the character-like entity corresponding to the speaker contained in the dialogue-related content according to the recognition result with high confidence. Among them, when multiple recognition results are the same, it means that the character-like entity corresponding to the speaker is accurately recognized; when multiple recognition results are different, the character-like entity corresponding to the speaker is determined according to the confidence of each recognition result.

[0058] In addition, in addition to identification through the recognition model, in this embodiment, the person entity corresponding to the speaker can also be identified flexibly by means of multiple methods.

[0059] For example, in the first optional implementation method, in this step, the character-type candidate entities contained in the conversation-related content and the context information corresponding to the character-type candidate entities are further identified; the context information is matched with a preset set of sentence feature words; and the character-type entity corresponding to the speaker contained in the conversation information is identified in combination with the matching results.

[0060] Among them, the candidate entity of the person type refers to the entity class noun used to refer to a person. In specific implementation, the named entities included in the e-book text can be first identified. Since the named entities include various types such as time, place, and person, correspondingly, the candidate entities of the person type are further screened from the named entities. Among them, the candidate entities of the person type usually have the characteristics of high occurrence frequency and often appearing in the same sentence with predicate components such as verbs in the e-book. Therefore, according to the above characteristics, information such as the occurrence frequency of each word segment in the e-book text and the number of collocations with verbs is counted, and then the word segments belonging to the person type are used as the candidate entities of the person type. In a specific implementation manner, the candidate entities of the person type included in the dialogue-related content are identified through the following method: First, the occurrence frequency of each word unit included in the e-book text and / or the number of verbs corresponding to each word unit are counted; then, the word units with an occurrence frequency greater than the first frequency threshold and / or the number of verbs greater than the second quantity threshold are identified as the candidate entities of the person type. Among them, the word unit refers to: a text combination composed of multiple sequentially appearing characters. It can be seen that the word unit is composed of two or more characters, and by "sequentially appearing" it means that there is a fixed order relationship among the characters within the word unit, and no other irrelevant characters are mixed within the word unit. For example, assuming that the e-book text contains the candidate entity of the person type "Xia Tian", the following two points should be noted when counting the occurrence frequency of the word unit "Xia Tian": First, the order of the characters in the word unit cannot be reversed, such as "Tian Xia" is not counted; second, no irrelevant characters can appear within the word unit, such as "Xia Yi Tian" is not counted. In addition to determining the candidate entities of the person type according to the occurrence frequency, the candidate entities of the person type can also be determined according to the number of verbs corresponding to each word unit: Usually, for any person name, it necessarily corresponds to multiple different verbs, such as "walk" in "Xia Tian walks over" and "smile" in "Xia Tian smiles slightly", etc. By counting the number of combinations between the word unit and different verbs, it can be determined whether the word unit is a person entity. In addition, when counting the occurrence frequency of each word unit included in the e-book text, in order to reduce memory and improve processing speed, the counting is performed by constructing a dictionary tree. Specifically, according to each sentence included in the e-book text, a dictionary tree corresponding to the word unit in the sentence is constructed; according to the constructed dictionary tree, the occurrence frequency of each word unit included in the e-book text is counted. Among them, the dictionary tree includes: a prefix tree and / or a suffix tree, and the number of characters included in the word unit does not exceed a preset unit threshold. Considering that a person name usually does not exceed four characters, the preset unit threshold can be set to 4, so as to only count the word units with no more than 4 characters, thereby reducing the amount of data to be processed.The prefix tree is a dictionary tree constructed from multiple sentences with the same beginning, which is suitable for the case where a person's name appears at the beginning of a sentence; the suffix tree is a dictionary tree constructed from multiple sentences with the same ending, which is suitable for the case where a person's name appears at the end of a sentence. Considering that most names appear at the beginning of a sentence, the prefix tree can be used to count the frequency of names appearing at the beginning of a sentence.

[0061] In addition, the context information corresponding to the person-class candidate entity is used to describe the description content related to the person-class candidate entity, and this part of the description content can be used to determine whether the person-class candidate entity is a speaker. In order to facilitate judgment, in this embodiment, a sentence feature word set is pre-set to store sentence feature words related to the speaking action. Among them, the sentence feature words stored in the sentence feature word set can be a single word, or a combination of two or more words. In addition, the sentence feature word set further includes: a first sentence feature word set used to indicate that the person-class candidate entity is a speaker, and a second sentence feature word set used to indicate that the person-class candidate entity is not a speaker. For example, the first sentence feature word set stores words such as "said, shouted, asked" that clearly indicate that the person-class candidate entity is a speaker. The second sentence feature word set stores words such as "being... scolded, being... shouted" that clearly indicate that the person-class candidate entity is not a speaker. Correspondingly, when identifying the character-like entity corresponding to the speaker contained in the dialogue information in combination with the matching results, if the context information successfully matches the first sentence feature word set, the character-like candidate entity is determined to be the character-like entity corresponding to the speaker; if the context information successfully matches the second sentence feature word set, it is determined that the character-like candidate entity is not the character-like entity corresponding to the speaker.

[0062] For example, in the second optional implementation, when identifying the character-like entity corresponding to the speaker contained in the dialogue information according to the output result of the dialogue character recognition model, the character-like candidate entity contained in the character dialogue content and the title word information corresponding to the character-like candidate entity are further extracted; the character-like candidate entity and the title word information contained in the character dialogue content are combined to identify the character-like entity corresponding to the speaker contained in the dialogue information. This method mainly identifies the character-like candidate entity contained in the character dialogue content. Among them, the method for determining the character-like candidate entity can refer to the corresponding description in the first implementation. In addition, the title word mainly includes personal pronouns such as "I", "you", and "he". Accordingly, the speaker can be judged with the help of the title word. For example, if the content "I am Zhang San" appears in the character dialogue content, it can be determined that the character-like entity corresponding to the speaker is "Zhang San".

[0063] It can be seen that the first optional implementation method mentioned above mainly determines the speaker based on the dialogue-related content in the dialogue information, while the second optional implementation method mainly determines the speaker based on the character dialogue content in the dialogue information.

[0064] The above methods can be used alone or in combination. When several methods are used in combination, the priority can be set according to the accuracy of each method, so that the method with a high priority is used for identification first. If the method with a high priority fails to identify successfully, other methods with a lower priority are used for identification. For example, considering that the accuracy of the first optional implementation method and the second optional implementation method is high, the first optional implementation method and / or the second optional implementation method can be used for identification first. If the identification is not successful, the dialogue character recognition model is used for identification.

[0065] Step S240: Determine the speaker's character intonation information based on the identified character entity corresponding to the speaker, and perform text-to-speech processing based on the character intonation information to obtain a speech synthesis result corresponding to the character's dialogue content.

[0066] Specifically, based on the context information corresponding to the character entity, the character attribute information of the character entity and the character intonation information matching the character attribute information are determined; the intonation feature label corresponding to the character intonation information is added to the character dialogue content corresponding to the character entity; based on the intonation feature label of the character dialogue content, text-to-speech processing is performed to obtain a speech synthesis result corresponding to the character dialogue content.

[0067] Among them, the character attribute information includes at least one of the following attribute dimensions: gender dimension, age dimension, role type dimension, and emotion type dimension. The character attribute information can be specifically determined by analyzing the context in which the character is located. And, when a voice playback instruction triggered by the user is received, the voice playback processing is performed according to the voice synthesis result. Since there is a fixed corresponding relationship between the character attribute information and the character intonation information, the character intonation information that matches the dialogue text information can be accurately identified based on the character attribute information, thereby facilitating subsequent voice synthesis operations and improving the sound quality of the synthesized voice. The intonation feature label is used to indicate the intonation feature of the corresponding content. The intonation feature specifically includes various contents such as timbre, volume, emotion, etc. Specifically, the intonation feature label includes at least one of the following categories: emotion label, gender label, age label, and role label. Among them, each type of label can be further subdivided into multiple categories, for example, emotion labels are further subdivided into: joy, anger, sorrow, happiness, impatience, not impatient and other categories; gender labels are further subdivided into: male labels and female labels; age labels are further subdivided into: old labels, young labels, young labels, etc. Role labels are further subdivided into: decent labels, villain labels, etc. Among them, when the voice playback instruction triggered by the user is received, the voice playback processing is performed according to the voice synthesis result. It can be seen that the intonation feature label in this embodiment is used to provide TTS (Text To Speech, from text to speech) software to realize voice synthesis processing. Considering that the machine-synthesized voice has the defects of rigid pronunciation and difference from the real way of speaking, in order to improve the sound quality of the synthesized voice, the intonation of the synthesized voice is matched with the feature label through the intonation feature label, thereby improving the authenticity of the synthesized voice and making the emotion of the synthesized voice richer and more delicate.

[0068] In summary, this method can pre-train a dialogue character recognition model that matches the order relationship between the character dialogue content and the dialogue-related content, so as to call the corresponding dialogue character recognition model for recognition according to the order relationship between the character dialogue content and the dialogue-related content contained in the dialogue information, thereby improving the accuracy of the recognition result. In addition, this embodiment can further identify the speaker in combination with the sentence feature word set and the title word, thereby significantly improving the accuracy of recognition. On the basis of identifying the speaker, the corresponding intonation feature can be further determined based on the attribute characteristics of the speaker, thereby making the synthesized speech more realistic in the subsequent speech synthesis stage.

[0069] Embodiment 3

[0070] An embodiment of the present application provides a non-volatile computer storage medium, which stores at least one executable instruction. The computer executable instruction can execute the e-book-based dialogue character recognition method in any of the above method embodiments.

[0071] The executable instructions may be specifically used to cause the processor to perform the following operations:

[0072] Acquire dialogue information contained in the electronic book text, extract character dialogue content and dialogue-related content contained in the dialogue information, and determine the order relationship between the character dialogue content and the dialogue-related content;

[0073] Obtaining a pre-trained dialogue character recognition model that matches the order relationship between the dialogue content of the characters and the dialogue-related content, and inputting the dialogue information into the obtained dialogue character recognition model;

[0074] According to the output result of the dialogue character recognition model, the character entity corresponding to the speaker contained in the dialogue information is identified.

[0075] In an optional implementation, the pre-trained dialogue character recognition model that matches the order relationship between the character dialogue content and the dialogue-related content includes:

[0076] A first recognition model in which the character dialogue content is located before the dialogue-related content, and a second recognition model in which the character dialogue content is located after the dialogue-related content;

[0077] Among them, the first recognition model is trained by a first training sample whose characters' dialogue content is pre-acquired and located before the dialogue-related content; the second recognition model is trained by a second training sample whose characters' dialogue content is pre-acquired and located after the dialogue-related content.

[0078] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0079] When the number of characters' dialogues extracted is at least two, and / or the number of dialogue-related contents extracted is at least two,

[0080] Adjacent character dialogue contents and dialogue-related contents are determined as a correlation order combination to obtain at least two correlation order combinations contained in the dialogue information, and the order relationship between the character dialogue contents and dialogue-related contents in each correlation order combination is determined respectively.

[0081] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0082] Respectively obtaining dialogue character recognition models corresponding to the dialogue contents of the characters in each association order combination and the order relationship between the dialogue association contents, and obtaining output results corresponding to the association order combination;

[0083] A plurality of output results corresponding to each association order combination are obtained, and a character entity corresponding to the speaker contained in the dialogue association content is determined according to the confidence of the plurality of output results.

[0084] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0085] Identifying candidate person entities contained in the conversation-related content and context information corresponding to the candidate person entities;

[0086] Matching the context information with a preset sentence feature word set;

[0087] The character entity corresponding to the speaker contained in the dialogue information is identified in combination with the matching result.

[0088] In an optional implementation, the sentence feature word set includes: a first sentence feature word set for indicating that the person-type candidate entity is a speaker, and a second sentence feature word set for indicating that the person-type candidate entity is not a speaker;

[0089] The executable instructions cause the processor to perform the following operations:

[0090] If the context information successfully matches the first sentence feature word set, determining the person-type candidate entity as the person-type entity corresponding to the speaker;

[0091] If the context information successfully matches the second sentence feature word set, it is determined that the person-class candidate entity is not the person-class entity corresponding to the speaker.

[0092] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0093] Counting the occurrence frequency of each word unit contained in the electronic book text and / or the number of verbs corresponding to each word unit;

[0094] Word units whose occurrence frequency is greater than a first frequency threshold and / or whose verb quantity is greater than a second quantity threshold are identified as candidate entities of the person class.

[0095] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0096] Determining character attribute information of the character entity and character intonation information matching the character attribute information according to context information corresponding to the character entity;

[0097] Adding a tone feature tag corresponding to the character's tone information to the character dialogue content corresponding to the character entity;

[0098] The character attribute information includes at least one of the following attribute dimensions: gender dimension, age dimension, role type dimension, and emotion type dimension.

[0099] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0100] Performing text-to-speech processing according to the intonation feature labels of the character's dialogue content to obtain a speech synthesis result corresponding to the character's dialogue content;

[0101] When a voice playback instruction triggered by a user is received, voice playback processing is performed according to the voice synthesis result.

[0102] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0103] Extracting candidate character entities contained in the character dialogue content and title word information corresponding to the candidate character entities;

[0104] The candidate character entities contained in the character dialogue content and the title word information are combined to identify the character entity corresponding to the speaker contained in the dialogue information.

[0105] Embodiment 4

[0106] Figure 3 A schematic structural diagram of an electronic device according to another embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.

[0107] like Figure 3 As shown, the electronic device may include: a processor (processor) 302 , a communication interface (Communications Interface) 304 , a memory (memory) 306 , and a communication bus 308 .

[0108] The processor 302, the communication interface 304, and the memory 306 communicate with each other via the communication bus 308. The communication interface 304 is used to communicate with other devices such as a client or a network element of another server. The processor 302 is used to execute the program 310, which can specifically execute the relevant steps in the embodiment of the above-mentioned method for identifying characters in dialogue based on an e-book.

[0109] Specifically, the program 310 may include program codes, which include computer operation instructions.

[0110] The processor 302 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0111] The memory 306 is used to store the program 310. The memory 306 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0112] The program 310 may be specifically configured to enable the processor 302 to perform the following operations:

[0113] Acquire dialogue information contained in the electronic book text, extract character dialogue content and dialogue-related content contained in the dialogue information, and determine the order relationship between the character dialogue content and the dialogue-related content;

[0114] Obtaining a pre-trained dialogue character recognition model that matches the order relationship between the dialogue content of the characters and the dialogue-related content, and inputting the dialogue information into the obtained dialogue character recognition model;

[0115] According to the output result of the dialogue character recognition model, the character entity corresponding to the speaker contained in the dialogue information is identified.

[0116] In an optional implementation, the pre-trained dialogue character recognition model that matches the order relationship between the character dialogue content and the dialogue-related content includes:

[0117] A first recognition model in which the character dialogue content is located before the dialogue-related content, and a second recognition model in which the character dialogue content is located after the dialogue-related content;

[0118] Among them, the first recognition model is trained by a first training sample whose characters' dialogue content is pre-acquired and located before the dialogue-related content; the second recognition model is trained by a second training sample whose characters' dialogue content is pre-acquired and located after the dialogue-related content.

[0119] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0120] When the number of characters' dialogues extracted is at least two, and / or the number of dialogue-related contents extracted is at least two,

[0121] Adjacent character dialogue contents and dialogue-related contents are determined as a correlation order combination to obtain at least two correlation order combinations contained in the dialogue information, and the order relationship between the character dialogue contents and dialogue-related contents in each correlation order combination is determined respectively.

[0122] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0123] Respectively obtaining dialogue character recognition models corresponding to the dialogue contents of the characters in each association order combination and the order relationship between the dialogue association contents, and obtaining output results corresponding to the association order combination;

[0124] A plurality of output results corresponding to each association order combination are obtained, and a character entity corresponding to the speaker contained in the dialogue association content is determined according to the confidence of the plurality of output results.

[0125] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0126] Identifying candidate person entities contained in the conversation-related content and context information corresponding to the candidate person entities;

[0127] Matching the context information with a preset sentence feature word set;

[0128] The character entity corresponding to the speaker contained in the dialogue information is identified in combination with the matching result.

[0129] In an optional implementation, the sentence feature word set includes: a first sentence feature word set for indicating that the person-type candidate entity is a speaker, and a second sentence feature word set for indicating that the person-type candidate entity is not a speaker;

[0130] The executable instructions cause the processor to perform the following operations:

[0131] If the context information successfully matches the first sentence feature word set, determining the person-type candidate entity as the person-type entity corresponding to the speaker;

[0132] If the context information successfully matches the second sentence feature word set, it is determined that the person-class candidate entity is not the person-class entity corresponding to the speaker.

[0133] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0134] Counting the occurrence frequency of each word unit contained in the electronic book text and / or the number of verbs corresponding to each word unit;

[0135] Word units whose occurrence frequency is greater than a first frequency threshold and / or whose verb quantity is greater than a second quantity threshold are identified as candidate entities of the person class.

[0136] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0137] Determining, according to the context information corresponding to the character entity, character attribute information of the character entity and character intonation information matching the character attribute information;

[0138] Adding a tone feature tag corresponding to the character's tone information to the character dialogue content corresponding to the character entity;

[0139] The character attribute information includes at least one of the following attribute dimensions: gender dimension, age dimension, role type dimension, and emotion type dimension.

[0140] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0141] Performing text-to-speech processing according to the intonation feature labels of the character's dialogue content to obtain a speech synthesis result corresponding to the character's dialogue content;

[0142] When a voice playback instruction triggered by a user is received, voice playback processing is performed according to the voice synthesis result.

[0143] In an optional implementation, the executable instruction causes the processor to perform the following operations:

[0144] Extracting candidate character entities contained in the character dialogue content and title word information corresponding to the candidate character entities;

[0145] The candidate character entities contained in the character dialogue content and the title word information are combined to identify the character entity corresponding to the speaker contained in the dialogue information.

[0146] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0147] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0148] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0149] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0150] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0151] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

Claims

1. A method for identifying characters in dialogue based on an e-book, wherein: The method comprises: Acquire dialogue information contained in the electronic book text, extract character dialogue content and dialogue-related content contained in the dialogue information, and determine the order relationship between the character dialogue content and the dialogue-related content; There are at least two extracted character dialogue contents and / or at least two extracted dialogue-related contents, adjacent character dialogue contents and dialogue-related contents are determined as a correlation order combination, at least two correlation order combinations included in the dialogue information are obtained, and the order relationship between the character dialogue contents and dialogue-related contents in each correlation order combination is determined respectively; Respectively obtain pre-trained dialogue character recognition models corresponding to the dialogue contents of characters in each association order combination and the order relationship between the dialogue association contents, and input the association order combination into the obtained corresponding dialogue character recognition model; The pre-trained dialogue character recognition model includes: a first recognition model in which the dialogue content of the characters is located before the dialogue-related content, and a second recognition model in which the dialogue content of the characters is located after the dialogue-related content; the first recognition model is trained by a first training sample in which the dialogue content of the characters is located before the dialogue-related content; the second recognition model is trained by a second training sample in which the dialogue content of the characters is located after the dialogue-related content; According to the output result of the dialogue character recognition model, identifying the character entity corresponding to the speaker contained in the dialogue information; The step of identifying the character-like entities corresponding to the speaker contained in the dialogue information based on the output results of the dialogue character recognition model further includes: obtaining multiple output results corresponding to each association order combination, and determining the character-like entities corresponding to the speaker contained in the dialogue association content based on the confidence levels of the multiple output results.

2. The method according to claim 1, wherein: The step of identifying the character entity corresponding to the speaker contained in the dialogue information according to the output result of the dialogue character recognition model further comprises: Identifying candidate person entities contained in the conversation-related content and context information corresponding to the candidate person entities; Matching the context information with a preset sentence feature word set; The character entity corresponding to the speaker contained in the dialogue information is identified in combination with the matching result.

3. The method according to claim 2, wherein: The sentence feature word set includes: a first sentence feature word set for indicating that the person-type candidate entity is a speaker, and a second sentence feature word set for indicating that the person-type candidate entity is not a speaker; Then the step of identifying the character entity corresponding to the speaker contained in the dialogue information in combination with the matching result includes: If the context information successfully matches the first sentence feature word set, determining the person-type candidate entity as the person-type entity corresponding to the speaker; If the context information successfully matches the second sentence feature word set, it is determined that the person-class candidate entity is not the person-class entity corresponding to the speaker.

4. The method according to claim 2, wherein: The step of identifying candidate person entities included in the conversation-related content includes: Counting the occurrence frequency of each word unit contained in the electronic book text and / or the number of verbs corresponding to each word unit; Word units whose occurrence frequency is greater than a first frequency threshold and / or whose verb quantity is greater than a second quantity threshold are identified as candidate entities of the person class.

5. The method according to any one of claims 1 to 3, wherein: After identifying the character entity corresponding to the speaker contained in the dialogue information, the method further includes: Determining, according to the context information corresponding to the character entity, character attribute information of the character entity and character intonation information matching the character attribute information; Adding a tone feature tag corresponding to the character's tone information to the character dialogue content corresponding to the character entity; The character attribute information includes at least one of the following attribute dimensions: gender dimension, age dimension, role type dimension, and emotion type dimension.

6. The method according to claim 5, wherein: After adding the intonation feature tag corresponding to the intonation information of the character to the character dialogue content corresponding to the character entity, the method further includes: Performing text-to-speech processing according to the intonation feature labels of the character's dialogue content to obtain a speech synthesis result corresponding to the character's dialogue content; When a voice playback instruction triggered by a user is received, voice playback processing is performed according to the voice synthesis result.

7. The method according to any one of claims 1 to 3, wherein: The step of identifying the character entity corresponding to the speaker contained in the dialogue information according to the output result of the dialogue character recognition model includes: Extracting candidate character entities contained in the character dialogue content and title word information corresponding to the candidate character entities; The candidate character entities contained in the character dialogue content and the title word information are combined to identify the character entity corresponding to the speaker contained in the dialogue information.

8. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the following operations: Acquire dialogue information contained in the electronic book text, extract character dialogue content and dialogue-related content contained in the dialogue information, and determine the order relationship between the character dialogue content and the dialogue-related content; There are at least two extracted character dialogue contents and / or at least two extracted dialogue-related contents, adjacent character dialogue contents and dialogue-related contents are determined as a correlation order combination, at least two correlation order combinations included in the dialogue information are obtained, and the order relationship between the character dialogue contents and dialogue-related contents in each correlation order combination is determined respectively; Respectively obtain pre-trained dialogue character recognition models corresponding to the dialogue contents of characters in each association order combination and the order relationship between the dialogue association contents, and input the association order combination into the obtained corresponding dialogue character recognition model; The pre-trained dialogue character recognition model includes: a first recognition model in which the dialogue content of the characters is located before the dialogue-related content, and a second recognition model in which the dialogue content of the characters is located after the dialogue-related content; the first recognition model is trained by a first training sample in which the dialogue content of the characters is located before the dialogue-related content; the second recognition model is trained by a second training sample in which the dialogue content of the characters is located after the dialogue-related content; According to the output result of the dialogue character recognition model, identifying the character entity corresponding to the speaker contained in the dialogue information; The step of identifying the character-like entities corresponding to the speaker contained in the dialogue information based on the output results of the dialogue character recognition model further includes: obtaining multiple output results corresponding to each association order combination, and determining the character-like entities corresponding to the speaker contained in the dialogue association content based on the confidence levels of the multiple output results.

9. The electronic device according to claim 8, wherein: The executable instructions cause the processor to perform the following operations: Identifying candidate person entities contained in the conversation-related content and context information corresponding to the candidate person entities; Matching the context information with a preset sentence feature word set; The character entity corresponding to the speaker contained in the dialogue information is identified in combination with the matching result.

10. The electronic device according to claim 9, wherein: The sentence feature word set includes: a first sentence feature word set for indicating that the person-type candidate entity is a speaker, and a second sentence feature word set for indicating that the person-type candidate entity is not a speaker; The executable instructions cause the processor to perform the following operations: If the context information successfully matches the first sentence feature word set, determining the person-type candidate entity as the person-type entity corresponding to the speaker; If the context information successfully matches the second sentence feature word set, it is determined that the person-class candidate entity is not the person-class entity corresponding to the speaker.

11. The electronic device according to claim 9, wherein: The executable instructions cause the processor to perform the following operations: Counting the occurrence frequency of each word unit contained in the electronic book text and / or the number of verbs corresponding to each word unit; Word units whose occurrence frequency is greater than a first frequency threshold and / or whose verb quantity is greater than a second quantity threshold are identified as candidate entities of the person class.

12. The electronic device according to any one of claims 8 to 10, wherein: The executable instructions cause the processor to perform the following operations: Determining, according to the context information corresponding to the character entity, character attribute information of the character entity and character intonation information matching the character attribute information; Adding a tone feature tag corresponding to the character's tone information to the character dialogue content corresponding to the character entity; The character attribute information includes at least one of the following attribute dimensions: gender dimension, age dimension, role type dimension, and emotion type dimension.

13. The electronic device according to claim 12, wherein: The executable instructions cause the processor to perform the following operations: Performing text-to-speech processing according to the intonation feature labels of the character's dialogue content to obtain a speech synthesis result corresponding to the character's dialogue content; When a voice playback instruction triggered by a user is received, voice playback processing is performed according to the voice synthesis result.

14. The electronic device according to any one of claims 8 to 10, wherein: The executable instructions cause the processor to perform the following operations: Extracting candidate character entities contained in the character dialogue content and title word information corresponding to the candidate character entities; The candidate character entities contained in the character dialogue content and the title word information are combined to identify the character entity corresponding to the speaker contained in the dialogue information.

15. A computer storage medium for displaying an object display page, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for generating audio for plain text document

    CN110491365A

  • Chinese novel dialogue character recognition method

    CN112131343A

  • RPA and AI combined data processing method and device, equipment and storage medium

    CN112233648A