Text processing method and device, electronic equipment and storage medium
By acquiring user feedback and using a text generation model to generate customized program segment texts, the problem of language-based programs failing to meet personalized needs has been solved, enabling personalized program playback and improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MASHANG CONSUMER FINANCE CO LTD
- Filing Date
- 2022-09-15
- Publication Date
- 2026-04-28
AI Technical Summary
The existing language-based programs fail to meet the personalized needs of viewers, resulting in a diminished viewing experience.
By acquiring user feedback, a text generation model is used to generate customized program segment texts, which are then played in a personalized manner based on the user's target actor type and performance style.
It enables customized playback of language-based programs, improves the user's viewing experience and the interactivity between the playback terminal and the user, and meets the user's personalized needs.
Smart Images

Figure CN116127003B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to a text processing method, apparatus, electronic device and storage medium. Background Technology
[0002] Talk shows, sketches, crosstalk, and other language-based programs are the most challenging language activities for human thinking, language comprehension, and creativity, and are becoming increasingly popular.
[0003] However, currently, the content of these programs is pre-created by the creators, and then the broadcasting platform plays these programs according to the pre-created content, which cannot meet the personalized needs of the audience and reduces the audience's viewing experience. Summary of the Invention
[0004] The purpose of this application is to provide a text processing method, apparatus, electronic device, and storage medium that facilitates customized playback of language-based programs, thereby better meeting users' personalized needs.
[0005] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:
[0006] In a first aspect, embodiments of this application provide a text processing method, including:
[0007] Get the text of the currently playing program segment;
[0008] Based on the text of the program segment to be played, the program segment to be played is played, and feedback information from the target user on the program segment to be played is obtained. The feedback information is used to indicate the target user's level of satisfaction with the program segment to be played.
[0009] Based on the target text generation model that matches the target program parameters input by the target user, the fragment text of the currently playing program segment, and the feedback information, the fragment text of the next program segment to be played is generated. The target program parameters include the target actor type and the target performance style.
[0010] After the currently playing program segment has finished playing, the next program segment to be played is played based on the segment text of the next program segment to be played.
[0011] Secondly, embodiments of this application provide a text processing apparatus, including:
[0012] The acquisition unit is used to acquire the text of the program segment to be played.
[0013] The first playback unit is used to play the program segment to be played based on the segment text of the program segment to be played, and to obtain feedback information from the target user on the program segment to be played, wherein the feedback information is used to indicate the target user's level of satisfaction with the program segment to be played.
[0014] The generation unit is used to generate the fragment text of the next program segment to be played based on the target text generation model that matches the target program parameters input by the target user, the fragment text of the currently played program segment, and the feedback information. The target program parameters include the target actor type and the target performance style.
[0015] The second playback unit is used to play the next program segment to be played based on the segment text of the next program segment to be played after the current program segment to be played has finished playing.
[0016] Thirdly, embodiments of this application provide an electronic device, including:
[0017] processor;
[0018] Memory used to store the processor's executable instructions;
[0019] The processor is configured to execute the instructions to implement the method as described in the first aspect.
[0020] Fourthly, embodiments of this application provide a computer-readable storage medium that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the method described in the first aspect.
[0021] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:
[0022] Each time a program segment is played, user feedback is obtained. Then, based on the text generation model, the current segment's text, and the user feedback, the text for the next segment is generated. The next segment is then played according to this text. This ensures that the program segments played better meet user preferences and increases interactivity between the user and the playback device for language-based programs. Furthermore, the text generation model used is matched to target program parameters such as the user's input of the desired actor type and performance style. This allows for customized text generation based on individual user needs, enabling personalized playback of language-based programs, better meeting user preferences, and enhancing the viewing experience. Attached Figure Description
[0023] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0024] Figure 1 A schematic diagram illustrating an application scenario of the text processing method provided in one or more embodiments of this application;
[0025] Figure 2 A flowchart illustrating a text processing method provided in one embodiment of this application;
[0026] Figure 3 A flowchart illustrating a text processing method provided for another embodiment of this application;
[0027] Figure 4 A flowchart illustrating a method for generating segment text of a next program segment to be played, provided as an embodiment of this application;
[0028] Figure 5 A schematic diagram of a playback quality assessment method provided for one embodiment of this application;
[0029] Figure 6 A flowchart illustrating a training method for a target text generation model provided in one embodiment of this application;
[0030] Figure 7 A schematic diagram of the structure of a text processing device provided in one embodiment of this application;
[0031] Figure 8This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0033] The terms "first," "second," etc., used in this specification and claims are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in this specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0034] Explanation of some concepts:
[0035] Natural Language Processing (NLP): NLP is an important field in computer science and artificial intelligence. It studies various theories and methods that enable effective communication between humans and computers using natural language. Currently, NLP theoretical research and model exploration are gradually expanding to broader fields that are increasingly approaching human intelligence. The problems involved are also gradually extending from tasks such as word segmentation, semantic classification and matching, and question answering, showing a trend from easy to difficult.
[0036] Language model perplexity (PPL): This measures the performance of a language model on an unseen string S. For a string S of length N, the language model gives a probability P(S), and the corresponding PPL perplexity is 2^{-(1 / N)log2 P(S)}, where the string length can be in characters or words.
[0037] The Deep Bidirectional Encoder Representation from Transformers (BERT) model is a pre-trained language representation model. It emphasizes that instead of using traditional unidirectional language models or shallow concatenation of two unidirectional language models for pre-training, it employs a novel Masked Language Model (MLM) to generate deep bidirectional language representations.
[0038] Multilingual Text-to-Text Transfer Transformer (mT5) Model: A large-scale multilingual mT5 model, pre-trained on a new Common Crawl dataset covering 101 languages, can be directly applied to multilingual scenarios and demonstrates strong performance on various benchmark sets, unifying Natural Language Understanding (NLU) and Natural Language Generation (NLG).
[0039] The text processing method provided in this application can be applied to the text of segments in language programs. As mentioned above, the content of current language programs is pre-created by the creators and then played by the broadcasting platform according to the pre-created program content, which cannot meet the personalized needs of the audience and reduces the audience's viewing experience.
[0040] In view of this, the embodiments of this application aim to propose a text processing method. Each time a program segment is played, user feedback on the currently played segment is obtained. Then, based on a text generation model, the segment text of the currently played program segment, and the user feedback, the segment text of the next program segment to be played is generated. The next program segment is then played according to its segment text. This not only ensures that the played program segments better meet user preferences but also increases the interactivity between the playback device and the user for language-based programs. Furthermore, the text generation model used is a model that matches target program parameters such as the target actor type and target performance style input by the user. This allows for customization of the text generation model based on the user's individual needs, enabling the generated segment text to better meet those needs. This achieves customized playback of language-based programs, better satisfying user preferences and enhancing the user's viewing experience.
[0041] It should be noted that the language-based programs in this application embodiment may include, for example, stand-up comedy, sketches, sitcoms, crosstalk, debates, etc.
[0042] It should be understood that the text processing method provided in this application embodiment can be executed by an electronic device or software installed in an electronic device. The electronic device referred to herein may include terminal devices, such as smartphones, tablets, laptops, desktop computers, smart voice interaction devices, smartwatches, in-vehicle terminals, etc.; the software installed in the electronic device may include playback software for playing programs, etc.
[0043] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0044] The text processing method provided in one or more embodiments of this application can be applied to Figure 1 In the scenario shown. For example... Figure 1 As shown, the scenario may include a playback client, which refers to the client of a playback application (APP), which is usually installed on the user's electronic device, such as at least one of smartphones, tablets, laptops, desktop computers, smart voice interaction devices, smartwatches, and in-vehicle terminals.
[0045] In this embodiment, a user launches a playback client on an electronic device. After launch, the playback client loads and displays a playback interface, which includes multiple controls, including but not limited to control 1 for user biometric input and control 2 for user selection of program parameters. The user can input their biometrics via control 1, such as, but not limited to, age, gender, education level, language, and occupation. After obtaining the user's biometrics, the playback client can display at least one candidate program parameter for selection, including but not limited to, candidate actor type and candidate performance style. Thus, the user can select a target program parameter from the at least one candidate program parameter displayed by the playback client, specifically, selecting a target actor type from at least one candidate actor type and a target actor type from at least one candidate performance style.
[0046] It should be noted that in practical applications, the actor type and performance style vary depending on the type of language program. For example, if the language program is a talk show, the actor type may include, but is not limited to, feminist actors, highly educated or returned overseas students, and actors with property in first-tier cities. The performance style may include, but is not limited to, dialect medleys, scene-based performances, and imitations. Similarly, if the language program is a crosstalk performance, the actor type may include, but is not limited to, professional and amateur crosstalk performers. The performance style may include, but is not limited to, lead comedians and supporting comedians, or solo crosstalk, duo crosstalk, and group crosstalk. Furthermore, there is a correspondence between actor type, performance style, and biometrics. This correspondence can be preset according to actual needs, and this application embodiment does not limit this. Accordingly, the playback client can determine the actor type corresponding to the user's biometrics as a candidate actor type and the performance style corresponding to the user's biometrics as a candidate performance style based on this correspondence.
[0047] Of course, in some other alternative solutions, users can also directly input the target program parameters through control 2.
[0048] Furthermore, the playback client can customize the playback of language-based programs based on the target program parameters selected by the user, thereby better meeting the user's personalized needs and enhancing the user's viewing experience.
[0049] The text processing method proposed in this application will describe in detail the specific process by which the playback client customizes the playback of language programs based on the target program parameters selected by the user.
[0050] Please see Figure 2 The following is a flowchart illustrating a text processing method according to an embodiment of this application. The method may include the following steps:
[0051] S202, Get the text of the program segment to be played.
[0052] In this embodiment, the first step is to obtain the fragment text of the first program segment and play it based on that text. Then, NLU (Natural Language Understanding) technology is used to understand the fragment text of the first program segment, and NLG (Natural Language Generation) technology is used to generate the fragment text of the second program segment based on the target user's feedback and the fragment text of the first program segment. The second program segment is then played based on this fragment text. This process is repeated until the language program is fully played. This divides the language program into multiple program segments arranged chronologically. These segments are played sequentially, and the fragment text of the next segment depends on the fragment text of the preceding segment and the target user's feedback on that preceding segment. This allows the language program to better meet the user's preferences. The target user refers to the user currently watching the language program.
[0053] In S202 above, the program segment to be played is any one of the multiple program segments arranged in chronological order.
[0054] If the program segment to be played is the first program segment, the segment text of the program segment to be played can be obtained in any appropriate way.
[0055] Optionally, the text of any opening program segment can be selected from a preset opening segment library as the text of the program segment to be played. The opening segment library stores the text of multiple opening program segments.
[0056] Optionally, in order to better meet the personalized needs of users, such as... Figure 3 As shown, the text of an opening program segment that matches the target program parameters input by the target user can be selected from the opening segment library and used as the text of the program segment to be played. The target program parameters include the target actor type and the target performance style.
[0057] For example, each opening program segment stored in the opening segment library has its own corresponding actor type and performance style. Accordingly, based on the segment text of the opening program segments in the opening segment library that meet the preset opening conditions, the segment text of the opening program segment that matches the target parameters can be determined. The preset opening conditions can be that the actor type is the target actor type and the performance style is the target performance style.
[0058] It should be noted that if there is only one text segment of the opening program that meets the preset opening conditions, then the text segment of the opening program that meets the preset opening conditions can be used as the text segment of the opening program that matches the target parameters; if there are multiple text segments of the opening program that meet the preset opening conditions, then any text segment of the opening program that meets the preset opening conditions can be used as the text segment of the opening program that matches the target parameters.
[0059] If the program segment to be played is not the first program segment, NLP technology can be used to generate the segment text of the program segment to be played based on the segment text of the previous program segment that is sequentially adjacent to the program segment to be played and the feedback information of the target user on the previous program segment.
[0060] More specifically, such as Figure 3 As shown, if the program segment to be played is not the first program segment, the segment text of the program segment to be played can be generated based on the target text generation model that matches the target program parameters, the segment text of the previous program segment that is sequentially adjacent to the program segment to be played, and the feedback information of the target user on the previous program segment. It should be noted that this implementation method is similar to the specific implementation method of S206 below. Please refer to the description of S206 below for details, which will not be described in detail here.
[0061] In this application, the target program parameters can be obtained by the user through controls displayed on the current playback interface (such as...). Figure 1 The control shown in section 2) can be specified directly; or the target program parameter can be obtained by the user by selecting from at least one candidate program parameter.
[0062] Optionally, to ensure that the target program parameters match the characteristics of the target user, thereby enabling customized language programs to better meet the personalized needs of the target user, the target program parameters can be obtained through the following methods: obtaining the target user's biometrics; displaying at least one candidate program parameter to the target user based on the target user's biometrics; and determining the target program parameters input by the target user based on the target user's selection of at least one candidate program parameter. The target user's biometrics may include, for example, but not limited to, the target user's age, gender, education level, language, and occupation.
[0063] It should be noted that in practical applications, there is a correspondence between program parameters and biometrics. This correspondence can be preset according to actual needs, and this embodiment does not limit this. For example, if the target user's educational background is a PhD in linguistics, then the program parameters corresponding to this biometric are: actor type is highly educated or returned overseas student, and performance style is dialect medley. Accordingly, after obtaining the target user's biometrics, the program parameters corresponding to the target user's biometrics can be determined as candidate program parameters based on this correspondence for the target user to choose from.
[0064] Furthermore, there can be one or more target users. If there are multiple target users, at least one candidate program parameter can be presented to each target user based on their individual biometric characteristics. For example, the parameter can be based on the mean, median, or weighted sum of the biometric characteristics of each target user. The target program parameter is then determined by combining the selections made by each target user for the at least one candidate program parameter. For instance, the candidate program parameter selected by the majority of these target users can be determined as the target program parameter.
[0065] S204, based on the text of the program segment to be played, play the program segment to be played and obtain feedback information from the target user on the program segment to be played.
[0066] Specifically, the virtual character used to perform language-based programs can be displayed to the user on the current playback interface. By using text-to-speech (TTS) technology, the text of the program segment to be played can be converted into the corresponding speech, and the virtual character can be controlled to play the speech.
[0067] Of course, in other optional implementations, to enhance the vividness of language-based program playback and further improve the user's viewing experience, the virtual character can be controlled to perform physical actions corresponding to the text of the currently playing program segment during the playback of the aforementioned audio. For example, if the text of the currently playing program segment is "Hello, everyone," then the actions corresponding to this text could include bowing, etc.
[0068] Feedback from target users on the currently playing program segment indicates their level of satisfaction. Since user feedback during segment playback can intuitively and accurately reflect user preferences and the quality of the segment, for example, if a segment contains humor and the expected user response is laughter, but no laughter is detected, it indicates the segment does not meet the user's humor needs. Therefore, feedback from target users can be collected during the playback of the currently playing segment to allow for timely adjustments to the playback strategy, ensuring that the next segment meets the user's actual needs as much as possible.
[0069] In this embodiment of the application, the feedback information of the target user to the program segment refers to information that can reflect the target user's reaction to the program segment. Specifically, it may include, but is not limited to, voice information issued by the target user, operations performed by the target user on the current playback interface (such as comments entered through the current playback interface, fast forward operation, rewind operation, etc.), and body movements of the target user during the viewing of the program segment.
[0070] S206, Based on the target text generation model that matches the target program parameters input by the target user, the fragment text of the currently played program segment, and the feedback information, generate the fragment text of the next program segment to be played.
[0071] The next program segment to be played refers to the next program segment that is sequentially adjacent to the currently played program segment.
[0072] Specifically, multiple text generation models can be pre-deployed in a model library, each corresponding to a specific program parameter. Accordingly, based on the target program parameter input by the target user, a text generation model corresponding to the target program parameter can be selected from the model library as the target text generation model matching the target program parameter. Further, based on the target text generation model, the fragment text of the currently playing program segment, and feedback information, the fragment text of the next program segment to be played is generated.
[0073] More specifically, a mapping dictionary can be formed between each text generation model and its corresponding program parameters. After receiving the target program parameters input by the target user, the text generation model corresponding to the target program parameters can be found and loaded based on this mapping dictionary. For example, the following shows an example of such a mapping dictionary:
[0074] {"highly_educated":"D:\job_files\highly_educated_model",
[0075] "poorly_educated":"D:\job_files\poorly_educated_model"}
[0076] Here, "highly_educated" indicates that the actor type is highly educated, and its corresponding text generation model is highly_educated_model; "poorly_educated" indicates that the actor type is not highly educated, and its corresponding text generation model is poorly_educated_model; D:\job_files indicates the storage location of the text generation models highly_educated_model and poorly_educated_model, that is, they are stored in the job_files folder on drive D.
[0077] In one alternative implementation, such as Figure 4 As shown, the above S206 may specifically include the following steps:
[0078] S261, Based on the target text generation model and the fragment text of the currently playing program segment, generate the first candidate fragment text of the next program segment to be played.
[0079] Specifically, the text of the currently playing program segment can be input into the target text generation model to obtain the first candidate text of the next program segment to be played. The target text generation model is trained based on the text of each program segment in the historical programs that match the target program parameters, as well as the text of the next program segment that is sequentially adjacent to each program segment. The training process of the target text generation model will be explained in detail later.
[0080] S262, divide the first candidate fragment text into multiple clauses, and detect whether each clause in the multiple clauses contains preset key information, to obtain multiple first clauses that include preset key information and multiple second clauses that do not include preset key information.
[0081] Specifically, various text segmentation techniques commonly used in this field can be employed, such as one or more combinations of semantic-based text segmentation techniques, punctuation-based text segmentation techniques, and text length-based text segmentation techniques, to divide the first candidate text segment into multiple clauses.
[0082] Furthermore, key information can be detected for each clause separately, yielding a detection result for each clause. The detection result for each clause indicates whether it contains a preset keyword. Thus, multiple first clauses containing preset key information and multiple second clauses not containing preset key information can be obtained.
[0083] The preset key information refers to information designed to enhance user viewing interest. This information can be set based on the type of language-based program and the target program parameters input by the user. For example, if the language-based program is a talk show, the preset key information could be jokes; if it's a debate, the preset key information could be arguments, and so on.
[0084] In practical applications, key information detection for each clause can be achieved using various techniques commonly used in the field. The specific technique can be selected according to actual needs, and this application does not limit the specific techniques used. For example, for each clause, a similarity comparison can be performed between the clause and a sample clause containing preset key information. If the two are similar, it can be determined that the clause contains the preset key information.
[0085] S263, based on the feedback information, determines the key information path corresponding to the next program segment to be played.
[0086] The key information path corresponding to the next program segment to be played indicates the order of clauses containing preset key information in the segment text of the next program segment. Alternatively, the key path information corresponding to the next program segment to be played may also include the expected number of the first clauses containing the preset key information in the segment text of the next program segment.
[0087] For example, the key information path corresponding to the next program segment to be played is [0,0,1,0,1,0,0], where 1 indicates that it contains preset key information and 0 indicates that it does not contain preset key information. Thus, this key information path indicates that in the segment text of the next program segment to be played, the third and fifth clauses contain preset key information, while the first, second, fourth, sixth, and seventh clauses do not contain preset key information.
[0088] After obtaining feedback from target users regarding the currently playing program segment, the user's satisfaction level can be assessed based on this feedback. Furthermore, by combining this feedback with the key information path corresponding to the currently playing segment, the key information path for the next program segment can be determined. This can improve the target user's satisfaction with the next program segment, ensuring that the next segment better meets the user's actual needs and thus enhancing the target user's viewing experience of language-based programs.
[0089] Specifically, S263 may include: based on feedback information, determining the user's satisfaction level with multiple first clauses and multiple second clauses when playing the current program segment to be played; determining a target first clause among the multiple first clauses whose satisfaction level is lower than a first preset threshold, and determining a target second clause among the multiple second clauses whose satisfaction level is lower than a second preset threshold, wherein the number of target first clauses and target second clauses is the same; further, changing the order of the target first clauses and target second clauses to obtain the key information path corresponding to the next program segment to be played.
[0090] For example, when determining the key information path corresponding to the next program segment to be played, if the key information path corresponding to the current program segment indicates that only the first few clauses in the segment text contain preset key information, and the target user's feedback on the program segment indicates that the target user is not satisfied with these first clauses and is not satisfied with the later few second clauses that do not contain preset key information, then in the next program segment to be played, the clauses containing preset key information can be placed at the end, while the clauses not containing preset key information can be placed at the beginning, thus obtaining the key information path corresponding to the next program segment to be played. More specifically, at least one target first clause can be selected from the first clauses with poor satisfaction, and the same number of target second clauses can be selected from the second clauses with poor satisfaction; then, the target first clauses and target second clauses can be swapped, thus obtaining the key information path corresponding to the next program segment to be played.
[0091] Alternatively, when determining the key information path corresponding to the next program segment to be played, the positions of the multiple first clauses in the multiple clauses can be adjusted according to the interval between the multiple first clauses, so that the multiple first clauses are evenly distributed in all clauses, thereby obtaining the key information path.
[0092] If the key information path corresponding to the currently playing program segment indicates that none of the clauses in the segment text contain preset key information, and the target user's feedback on the program segment indicates that the target user is not satisfied with the program segment, then a clause containing preset key information can be added to the segment text of the next program segment to be played, thereby obtaining the key information path corresponding to the next program segment to be played.
[0093] If the key information path corresponding to the currently playing program segment indicates that several clauses in the segment text contain preset key information, and the target user's feedback on the program segment indicates that the target user is relatively satisfied with the program segment, then the preset key information can be added to the later clauses in the next program segment to be played, thereby obtaining the key information path corresponding to the next program segment to be played.
[0094] This document only illustrates one specific implementation of S263 described above. It should be understood that S263 can also be implemented in other ways, and this application embodiment does not limit this implementation.
[0095] S264, based on the key information path, multiple first clauses and multiple second clauses, generates the fragment text of the next program segment to be played.
[0096] Since the detection result of each clause indicates whether each clause contains preset key information, and the aforementioned key information path indicates the order of clauses containing preset key information in the fragment text of the next program segment to be played, the aforementioned multiple clauses can be reordered and concatenated based on the aforementioned key information path and the detection result of each clause in the multiple clauses to obtain the fragment text of the next program segment to be played.
[0097] Optionally, to further improve the target user's satisfaction with the next program segment to be played, and to ensure the logical correctness of the segment text of the next program segment to be played, the above-mentioned S264 can be specifically implemented as follows: Step A1, based on the key information path, multiple first clauses, and multiple second clauses, adjust the arrangement order of each first clause in the first candidate segment text, so that the arrangement order of each first clause in all clauses matches the key information path; Step A2, based on the target arrangement order of the adjusted multiple first clauses and multiple second clauses, concatenate at least the multiple first clauses and multiple second clauses to obtain the second candidate segment text of the next program segment to be played; Step A3, perform logical detection on the second candidate segment text; Step A4, if the second candidate segment text passes the logical detection, then determine the second candidate segment text as the segment text of the next program segment to be played. Optionally, after the above-mentioned step A4, the above-mentioned S264 may further include: if the second candidate segment text fails the logical detection, then repeat the above-mentioned steps A1 to A3 until the obtained second candidate segment text passes the logical detection.
[0098] For example, taking the key information path above as [0,0,1,0,1,0,0] as an example, if the second clause and the fifth clause in the first candidate fragment text both contain preset key information, then the order of the second clause and the other clauses in the first candidate fragment text except for the fifth clause can be adjusted so that after the above multiple clauses are reordered, the clause containing the preset key information is ranked third and fifth respectively.
[0099] Optionally, considering that too few clauses containing preset key information in the second candidate segment text may affect the target user's viewing experience of the next program segment, in order to make the next program segment better meet the actual needs of the target user, if there are enough first clauses containing preset key information in the above-mentioned clauses, the multiple first clauses and multiple second clauses can be spliced together based on the target arrangement order of the multiple first clauses and multiple second clauses to obtain the second candidate segment text of the next program segment to be played.
[0100] Specifically, prior to step A2 above, the text processing method of this application embodiment may further include: determining the number of first clauses. Accordingly, in step A2 above, if the number of first clauses is greater than or equal to the expected number indicated by the key information path, then based on the target arrangement order of the plurality of first clauses and the plurality of second clauses, the plurality of first clauses and the plurality of second clauses are concatenated to obtain the second candidate fragment text.
[0101] For example, taking the key information path above as [0,0,1,0,1,0,0] as an example, the expected number indicated by this key information path is 2. Assuming that clauses 3 and 5 in the above multiple clauses both contain preset key information, and the target arrangement order of each clause in the above multiple clauses is: clause 1-> clause 2-> clause 3-> clause 4-> clause 5, the second candidate fragment text can be obtained as: clause 1[punctuation 1] clause 2[[punctuation 2] clause 3[[punctuation 3] clause 4[[punctuation 4] clause 5[[punctuation 5].
[0102] Further, in step A2 above, if the number of sentences in the first clause is less than the expected number indicated by the key information path, then a target clause that meets the preset splicing conditions is selected from the preset clause library. The preset splicing conditions include that the selected clause contains the preset key information and that the selected clause is different from all the first clauses. Next, based on the key information path and the target clause, the multiple first clauses are updated so that the number of the updated multiple first clauses is greater than or equal to the expected number, and the order of the updated multiple first clauses in all clauses matches the key information path. Further, the updated multiple first clauses and multiple second clauses are spliced together to obtain the second candidate fragment text.
[0103] For example, taking the key information path [0,0,1,0,1,0,0] as an example, the expected number indicated by this key information path is 2. Assuming that only clause 3 contains the preset key information among the above clauses, and the target arrangement order of each clause among the above clauses is: clause 1-> clause 2-> clause 3-> clause 4-> clause 5, then clause 6 that meets the preset splicing conditions can be selected from the preset clause library. Further splicing the above clauses and the selected clause 6 will yield the second candidate fragment text as: clause 1 [punctuation 1] clause 2 [[punctuation 2] clause 3 [[punctuation 3] clause 4 [[punctuation 4] clause 6 [[punctuation 6] clause 5 [[punctuation 5]].
[0104] More specifically, in step A3 above, logical detection is performed on the second candidate text segment. This can be achieved using various text logic detection techniques commonly used in the field, and the specific technique can be selected according to actual needs. This application embodiment does not limit this approach. For example, a pre-trained artificial intelligence model with text logic detection capabilities can be used to perform logical detection on the second candidate text segment, etc.; or, logical detection can be performed on the second candidate text segment based on pre-set logical rules, such as a question usually being followed by an answer, etc.
[0105] Understandably, by using NLP technology, based on a text generation model that matches the parameters of the target program and the fragment text of the currently playing program segment, the first candidate fragment text of the next program segment to be played can be generated. Based on the detection results of whether each clause in the first candidate fragment text contains preset key information and the feedback information of the target user on the currently playing program segment, the fragment text of the next program segment to be played can be generated. This can increase the target user's interest and satisfaction with the next program segment to be played, so that the next program segment to be played can better meet the actual needs of the target user, thereby further improving the target user's viewing experience of language-based programs.
[0106] This document only illustrates one specific implementation of S206 described above. It should be understood that S206 can also be implemented in other ways, and this application embodiment does not limit this implementation. For example, in another optional implementation, a first candidate segment text for the next program segment to be played can be generated based on the target text generation model and the segment text of the currently played program segment; then, based on the feedback information from the target user regarding the currently played program segment, the first candidate segment text is adjusted, such as adjusting the word order, removing redundant characters, adding characters, etc., to obtain the segment text of the next program segment to be played.
[0107] S208: After the current program segment to be played has finished playing, play the next program segment to be played based on the segment text of the next program segment to be played.
[0108] The specific implementation of S208 is similar to that of S204. For details, please refer to the description of S204 above, which will not be repeated here.
[0109] It should be noted that in practical applications, steps S202 to S208 may need to be repeated multiple times until the preset stopping condition is met, thereby completing the customized playback of language programs. The preset stopping condition can be set according to actual needs. For example, the preset training stopping condition may include: the number of played program segments is greater than or equal to a preset number threshold, or the cumulative playback duration is greater than or equal to a preset duration threshold, etc. This application embodiment does not limit this.
[0110] Specifically, such as Figure 3 As shown, prior to S208 above, the text processing method provided in this application embodiment may further include: obtaining playback information of a played program segment, the playback information including the number of played program segments and the cumulative playback duration; if the playback information of a played program segment does not meet the preset stop condition, then S202 to S208 above are executed again, that is, the segment text of the program segment to be played is obtained.
[0111] Therefore, users only need to set the target program parameters and preset stop conditions to achieve customized playback of language programs. This not only simplifies user operation but also enables the language programs played to better meet the user's personalized needs and enhance the user's viewing experience.
[0112] Optionally, to facilitate optimization of the customization process for language-based programs and further improve their playback quality, thereby better meeting users' personalized needs, such as... Figure 3 As shown, after S208 above, the text processing method provided in this application embodiment may further include: if the playback information of the played program segment meets the preset stop condition, then stop playback and display a set of rating items for the played program segment to the target user, wherein the set of rating items includes rating items of multiple dimensions; further, based on the preset quality assessment model, the rating results input by the target user for the set of rating items, and the segment information of the played program segment, determine the playback quality of the played program segment.
[0113] For example, such as Figure 5 As shown, by inputting the rating results of the target user for the set of rating items and the segment information of the played program segments into the preset quality assessment model, the playback quality assessment results of the played program segments can be obtained.
[0114] The scoring items for the aforementioned multiple dimensions can be set according to actual needs, and this application embodiment does not limit this. For example, the scoring item set may include scoring items for the following multiple dimensions: humor value, innovation, content depth, satisfaction, etc.
[0115] The segment information of the played program segment may include, but is not limited to, at least one of the following: the representation vector of the segment text of the played program segment, the sentence label of each clause, the target program parameters, the key information path, the homophony detection result, the language type, the hot topic detection result, the appearance information of the virtual character, the clothing information of the virtual character, the facial expression information of the virtual character, and the speech rate distribution and stress distribution of the speech produced by the virtual character. Among them, the sentence label of each clause can be obtained by using hierarchical guided contrastive learning (HGCLR), that is, by using the mutation method of hierarchical labels, hierarchical text features are obtained, and hierarchical classification is completed for each clause in terms of simple and complex sentences, sentence type, sentence pattern, and sentence structure, so as to obtain the sentence label of each clause. For example, the sentence label can be [simple sentence, declarative sentence, subject-predicate sentence, passive sentence], and there is a hierarchical relationship between the various sub-labels (i.e., "simple sentence", "declarative sentence", "subject-predicate sentence", "passive sentence"). In this embodiment of the application, sentence category refers to the tone category of a sentence, that is, the category divided according to the tone and intonation of the clause. Sentence category may include, but is not limited to: declarative sentence, interrogative sentence, imperative sentence, exclamatory sentence, etc.; sentence pattern is a higher category divided according to the characteristics of the clause; sentence style is a lower category divided according to the local characteristics of the clause. Sentence style may include, but is not limited to: declarative sentence, interrogative sentence, imperative sentence, exclamatory sentence, etc.
[0116] The preset quality assessment model can be selected according to actual needs, and this application embodiment does not limit it. For example, the preset quality assessment model can be one or more combinations of the following classification models: Support Vector Machine (SVM), Naive Bayes model, Decision Tree model, Random Forest model, GBDT model, XGB model, etc. In practical applications, the preset quality assessment model can be trained by using segment information of each program segment in historical language programs and the user's rating results for the set of rating items of historical language programs as training samples, and using the playback quality assessment results of historical language programs as the labels corresponding to the training samples. The specific training method can adopt the training methods of commonly used artificial intelligence models in this field, and this application embodiment does not limit it.
[0117] Based on the above embodiments, Figure 6 A flowchart illustrating a training method for a target text generation model, provided as an embodiment of this application, is shown below. The training method includes the following steps:
[0118] S602, Select historical programs from the historical program collection that match the parameters of the target program as sample programs.
[0119] For each historical program in the historical program collection, if the program parameters of the historical program are the same as those of the target program, the historical program is considered to be a historical program that matches the target program parameters, and thus can be used as a sample program.
[0120] S604 divides the sample program into multiple sample program segments based on temporal arrangement.
[0121] S606, based on the fragment text of each sample program segment in multiple sample program segments and the fragment text of the next sample program segment that is temporally adjacent to each sample program segment, train the text generation model to be trained to obtain a target text generation model that matches the target program parameters.
[0122] Specifically, the text segment of each sample program segment can be used as a training sample, and the text segment of the next sample program segment that is sequentially adjacent to each sample program segment can be used as the label corresponding to the training sample. The text generation model to be trained is iteratively trained until a preset training stopping condition is met, thereby obtaining the target text generation model. It should be noted that the text generation model to be trained can be trained using various artificial intelligence model training methods in this field, such as the backpropagation algorithm, etc., and this application embodiment does not limit this.
[0123] Secondly, the preset training stopping conditions can be set according to actual needs, and this application embodiment does not limit this. For example, the preset training stopping conditions may include: the model loss of the text generation model to be trained is less than a preset loss threshold, or the number of iterations of training reaches a preset number, or the PPL of the text generation model to be trained is less than a preset perplexity threshold, etc.
[0124] Furthermore, the text generation model to be trained can be any appropriate model with text understanding and generation capabilities, such as the BERT model or the mT5 model. Optionally, considering that the mT5 model can be directly applied to multilingual scenarios, the text generation model to be trained can be the mT5 model, which is beneficial for improving the customization effect of language-based programs.
[0125] The text processing method provided in this application obtains user feedback on each program segment played. Then, based on the text generation model, the current program segment's text, and the user's feedback, the next program segment's text is generated. The next program segment is then played according to this text. This not only ensures that the played program segments better meet user preferences but also increases the interactivity between the playback device and the user. Furthermore, the text generation model used is matched to target program parameters such as the user-inputted actor type and performance style. This allows for customization of the text generation model based on the user's individual needs, ensuring that the generated text better meets those needs. This enables customized playback of language programs, better satisfying user preferences and enhancing the viewing experience.
[0126] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0127] In addition, with the above Figure 2 Corresponding to the text processing method shown, this application also provides a text processing apparatus. Please refer to... Figure 7 The diagram below illustrates the structure of a text processing apparatus according to an embodiment of this application. The apparatus 700 may include:
[0128] The acquisition unit 710 is used to acquire the fragment text of the program segment to be played.
[0129] The first playback unit 720 is used to play the program segment to be played based on the segment text of the program segment to be played, and to obtain feedback information from the target user on the program segment to be played, wherein the feedback information is used to indicate the target user's level of satisfaction with the program segment to be played.
[0130] The generation unit 730 is used to generate the fragment text of the next program segment to be played based on the target text generation model that matches the target program parameters input by the target user, the fragment text of the currently played program segment, and the feedback information. The target program parameters include the target actor type and the target performance style.
[0131] The second playback unit 740 is used to play the next program segment to be played based on the segment text of the next program segment to be played after the current program segment to be played has finished playing.
[0132] Optionally, the generation unit generates the fragment text of the next program segment to be played, based on a target text generation model matching the target program parameters input by the target user, the fragment text of the currently played program segment, and the feedback information, including:
[0133] Based on the target text generation model and the fragment text of the current program segment to be played, generate the first candidate fragment text of the next program segment to be played;
[0134] The first candidate fragment text is divided into multiple clauses, and it is detected whether each clause contains preset key information to obtain multiple first clauses including the preset key information and multiple second clauses not including the preset key information.
[0135] Based on the feedback information, the key information path corresponding to the next program segment to be played is determined. The key information path is used to indicate the order of clauses containing the preset key information in the segment text of the next program segment to be played among all clauses.
[0136] Based on the key information path, the plurality of first clauses, and the plurality of second clauses, the fragment text of the next program segment to be played is generated.
[0137] Optionally, the generation unit, based on the feedback information, determines the key information path corresponding to the next program segment to be played, including:
[0138] Based on the feedback information, determine the user's level of satisfaction with the multiple first clauses and the multiple second clauses when playing the currently playing program segment;
[0139] Among the plurality of first clauses, a target first clause with a satisfaction level lower than a first preset threshold is identified, and among the plurality of second clauses, a target second clause with a satisfaction level lower than a second preset threshold is identified, wherein the number of the target first clauses and the number of the target second clauses are the same;
[0140] By changing the order of the first clause and the second clause of the target, the key information path is obtained.
[0141] Optionally, the generation unit generates the segment text of the next program segment to be played, based on the key information path, the plurality of first clauses, and the plurality of second clauses, including:
[0142] Based on the key information path, the plurality of first clauses, and the plurality of second clauses, adjust the order of the plurality of first clauses in the first candidate fragment text so that the order of each first clause in all clauses matches the key information path;
[0143] Based on the adjusted target arrangement order of the plurality of first clauses and the plurality of second clauses, at least the plurality of first clauses and the plurality of second clauses are concatenated to obtain the second candidate segment text of the next program segment to be played;
[0144] Perform logical detection on the second candidate text segment;
[0145] If the second candidate segment text passes the logical detection, then the second candidate segment text is determined as the segment text of the next program segment to be played.
[0146] Optionally, the generation unit, based on the key information path, the plurality of first clauses, and the plurality of second clauses, generates the segment text of the next program segment to be played, further including:
[0147] If the second candidate text fails the logical check, the process of adjusting the order of at least one of the second clauses in the second candidate text is repeated, and the second candidate text after the adjustment is logically checked until the second candidate text passes the logical check.
[0148] Optionally, the key information path also includes the expected number of first clauses containing preset key information in the fragment text of the next program segment to be played;
[0149] The generation unit, based on the adjusted target arrangement order of the plurality of first clauses and the plurality of second clauses, concatenates at least the plurality of first clauses and the plurality of second clauses to obtain the second candidate segment text for the next program segment to be played, including:
[0150] Determine the number of the first clause;
[0151] If the number of the first clauses is greater than or equal to the expected number, then based on the target arrangement order, the plurality of first clauses and the plurality of second clauses are concatenated to obtain the second candidate fragment text.
[0152] Optionally, the generation unit, based on the adjusted target arrangement order of the plurality of first clauses and the plurality of second clauses, concatenates at least the plurality of first clauses and the plurality of second clauses to obtain the second candidate segment text of the next program segment to be played, further includes:
[0153] If the number of the first clauses is less than the expected number, then a target clause that meets the preset splicing conditions is selected from the preset clause library, wherein the preset splicing conditions include that the selected clause contains the preset key information and that the selected clause is different from all of the multiple first clauses;
[0154] Based on the key information path and the target clause, the plurality of first clauses are updated such that the number of the updated plurality of first clauses is greater than or equal to the expected number, and the order of the updated plurality of first clauses in all clauses matches the key information path;
[0155] The updated first clauses and the updated second clauses are concatenated to obtain the second candidate fragment text.
[0156] Optionally, the acquisition unit is further configured to select historical programs that match the target program parameters from the historical program set as sample programs before the generation unit generates the fragment text of the next program segment to be played based on the target text generation model that matches the target program parameters input by the target user, the fragment text of the currently played program segment, and the feedback information.
[0157] The device 700 further includes:
[0158] A partitioning unit is used to divide the sample program into multiple sample program segments based on temporal arrangement.
[0159] The training unit is used to train the text generation model to be trained based on the fragment text of each sample program segment in the plurality of sample program segments and the fragment text of the next sample program segment that is temporally adjacent to each sample program segment, so as to obtain a target text generation model that matches the target program parameters.
[0160] Optionally, the first acquisition unit acquires the text of the program segment to be played, including:
[0161] If the program segment to be played is the first program segment to be played, then the segment text of the opening program segment that matches the target program parameters is selected from the opening segment library and used as the segment text of the program segment to be played.
[0162] If the program segment to be played is not the first program segment to be played, then the segment text of the program segment to be played is generated based on the target text generation model, the segment text of the previous program segment that is sequentially adjacent to the program segment to be played, and the feedback information of the target user on the previous program segment.
[0163] Optionally, the acquisition unit is further configured to acquire the biometric features of the target user before the generation unit generates the fragment text of the next program segment to be played based on the target text generation model that matches the target program parameters input by the target user, the fragment text of the currently played program segment, and the feedback information.
[0164] The device 700 further includes:
[0165] A display unit is used to display at least one candidate program parameter to the target user based on the biometric characteristics;
[0166] The determining unit is configured to determine the target program parameters input by the target user based on the target user's selection operation of the at least one candidate program parameter.
[0167] Optionally, the acquisition unit is further configured to acquire playback information of the played program segments after the second playback unit plays the next program segment to be played, the playback information including the number of played program segments and the cumulative playback duration;
[0168] The second playback unit is further configured to stop playback if the playback information of the already played program segment meets the preset stop condition. The preset stop condition includes: the number of already played program segments is greater than or equal to a preset number threshold, or the cumulative playback duration is greater than or equal to a preset duration threshold.
[0169] The display unit is also used to display a set of rating items for the played program segment to the target user, the set of rating items including rating items of multiple dimensions;
[0170] The determining unit is further configured to determine the playback quality of the played program segment based on a preset quality assessment model, the rating results input by the target user for the set of rating items, and the segment information of the played program segment.
[0171] Obviously, the text processing device provided in this application embodiment can serve as... Figure 2 The execution body of the text processing method shown, for example Figure 2 In the text processing method shown, step S202 can be performed by... Figure 7The acquisition unit in the text processing device shown executes step S204, which can be performed by... Figure 7 The first playback unit in the text processing device 700 shown executes step S206, which can be performed by... Figure 7 The generation unit in the text processing device 700 shown is responsible for executing step S208, which can be performed by... Figure 7 The second playback unit in the text processing device 700 shown is executed.
[0172] According to another embodiment of this application, Figure 7 The text processing apparatus shown can be composed of individual or combined units into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above units are based on logical function division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the text processing apparatus may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.
[0173] According to another embodiment of this application, a general-purpose computing device, such as a computer, including processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), can run an application capable of performing tasks such as... Figure 2 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 7 The text processing apparatus shown herein, and the text processing method for implementing the embodiments of this application, are described. The computer program may be recorded on, for example, a computer-readable storage medium, and may be transferred to and executed in an electronic device via such a medium.
[0174] The text processing device provided in this application obtains user feedback information for each program segment played. Then, based on a text generation model, the current program segment's text, and the user's feedback, it generates the text for the next program segment to be played. The next program segment is then played according to this text. This not only ensures that the played program segments better meet user preferences but also increases the interactivity between the playback device and the user. Furthermore, the text generation model used is matched to target program parameters such as the user-inputted target actor type and performance style. This allows for customization of the text generation model based on the user's individual needs, ensuring that the generated text better meets those needs. This enables customized playback of language programs, better satisfying user preferences and enhancing the viewing experience.
[0175] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 8 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0176] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0177] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0178] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming a text processing device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:
[0179] Get the text of the currently playing program segment;
[0180] Based on the text of the program segment to be played, the program segment to be played is played, and feedback information from the target user on the program segment to be played is obtained. The feedback information is used to indicate the target user's level of satisfaction with the program segment to be played.
[0181] Based on the target text generation model that matches the target program parameters input by the target user, the fragment text of the currently playing program segment, and the feedback information, the fragment text of the next program segment to be played is generated. The target program parameters include the target actor type and the target performance style.
[0182] After the currently playing program segment has finished playing, the next program segment to be played is played based on the segment text of the next program segment to be played.
[0183] The above is as stated in this application. Figure 2The text processing device method disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0184] The electronic device can also perform Figure 2 The method, and implement the text processing device in Figures 2 to 6 The functions of the embodiments shown are not described in detail here.
[0185] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0186] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by a portable electronic device including multiple applications, enable the portable electronic device to perform... Figure 2 The method of the illustrated embodiment is specifically used to perform the following operations:
[0187] Get the text of the currently playing program segment;
[0188] Based on the text of the program segment to be played, the program segment to be played is played, and feedback information from the target user on the program segment to be played is obtained. The feedback information is used to indicate the target user's level of satisfaction with the program segment to be played.
[0189] Based on the target text generation model that matches the target program parameters input by the target user, the fragment text of the currently playing program segment, and the feedback information, the fragment text of the next program segment to be played is generated. The target program parameters include the target actor type and the target performance style.
[0190] After the currently playing program segment has finished playing, the next program segment to be played is played based on the segment text of the next program segment to be played.
[0191] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
[0192] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0193] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0194] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0195] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
Claims
1. A text processing method, characterized in that, include: Get the text of the currently playing program segment; Based on the text of the program segment to be played, the program segment to be played is played, and feedback information from the target user on the program segment to be played is obtained. The feedback information is used to indicate the target user's level of satisfaction with the program segment to be played. Based on the target text generation model that matches the target program parameters input by the target user, the fragment text of the currently playing program segment, and the feedback information, the fragment text of the next program segment to be played is generated. The target program parameters include the target actor type and the target performance style. After the currently playing program segment has finished playing, the next program segment to be played is played based on the segment text of the next program segment to be played.
2. The method according to claim 1, characterized in that, The step of generating the next program segment's segment text based on the target text generation model matching the target program parameters input by the target user, the segment text of the currently played program segment, and the feedback information includes: Based on the target text generation model and the fragment text of the current program segment to be played, generate the first candidate fragment text of the next program segment to be played; The first candidate fragment text is divided into multiple clauses, and it is detected whether each clause contains preset key information to obtain multiple first clauses including the preset key information and multiple second clauses not including the preset key information. Based on the feedback information, the key information path corresponding to the next program segment to be played is determined. The key information path is used to indicate the order of clauses containing the preset key information in the segment text of the next program segment to be played among all clauses. Based on the key information path, the plurality of first clauses, and the plurality of second clauses, the fragment text of the next program segment to be played is generated.
3. The method according to claim 2, characterized in that, The step of determining the key information path corresponding to the next program segment to be played based on the feedback information includes: Based on the feedback information, determine the user's level of satisfaction with the multiple first clauses and the multiple second clauses when playing the currently playing program segment; Among the plurality of first clauses, a target first clause with a satisfaction level lower than a first preset threshold is identified, and among the plurality of second clauses, a target second clause with a satisfaction level lower than a second preset threshold is identified, wherein the number of the target first clauses and the number of the target second clauses are the same; By changing the order of the first clause and the second clause of the target, the key information path is obtained.
4. The method according to claim 2, characterized in that, The step of generating the segment text of the next program segment to be played based on the key information path, the plurality of first clauses, and the plurality of second clauses includes: Based on the key information path, the plurality of first clauses, and the plurality of second clauses, adjust the order of the plurality of first clauses in the first candidate fragment text so that the order of each first clause in all clauses matches the key information path; Based on the adjusted target arrangement order of the plurality of first clauses and the plurality of second clauses, at least the plurality of first clauses and the plurality of second clauses are concatenated to obtain the second candidate segment text of the next program segment to be played; Perform logical detection on the second candidate text segment; If the second candidate segment text passes the logical detection, then the second candidate segment text is determined as the segment text of the next program segment to be played.
5. The method according to claim 4, characterized in that, The step of generating the segment text of the next program segment to be played based on the key information path, the plurality of first clauses, and the plurality of second clauses further includes: If the second candidate fragment text fails the logical check, the process of adjusting the order of at least one of the second clauses in the second candidate fragment text is repeated, and the logical check is performed on the second candidate fragment text after the order is adjusted, until the second candidate fragment text passes the logical check.
6. The method according to claim 4, characterized in that, The key information path also includes the expected number of first clauses containing preset key information in the fragment text of the next program segment to be played; Based on the adjusted target arrangement order of the plurality of first clauses and the plurality of second clauses, at least the plurality of first clauses and the plurality of second clauses are concatenated to obtain the second candidate segment text of the next program segment to be played, including: Determine the number of the first clause; If the number of the first clauses is greater than or equal to the expected number, then based on the target arrangement order, the plurality of first clauses and the plurality of second clauses are concatenated to obtain the second candidate fragment text.
7. The method according to claim 6, characterized in that, The method of concatenating at least the multiple first clauses and the multiple second clauses based on the adjusted target arrangement order to obtain the second candidate segment text of the next program segment to be played further includes: If the number of the first clauses is less than the expected number, then a target clause that meets the preset splicing conditions is selected from the preset clause library, wherein the preset splicing conditions include that the selected clause contains the preset key information and that the selected clause is different from all of the multiple first clauses; Based on the key information path and the target clause, the plurality of first clauses are updated such that the number of the updated plurality of first clauses is greater than or equal to the expected number, and the order of the updated plurality of first clauses in all clauses matches the key information path; The updated first clauses and the updated second clauses are concatenated to obtain the second candidate fragment text.
8. The method according to claim 2, characterized in that, Before generating the fragment text of the next program segment to be played based on the target text generation model matching the target program parameters input by the target user, the fragment text of the currently played program segment, and the feedback information, the method further includes: Select historical programs from the historical program collection that match the parameters of the target program as sample programs; The sample program is divided into multiple sample program segments based on temporal arrangement; Based on the fragment text of each sample program segment in the plurality of sample program segments and the fragment text of the next sample program segment that is temporally adjacent to each sample program segment, the text generation model to be trained is trained to obtain a target text generation model that matches the target program parameters.
9. The method according to claim 1, characterized in that, The step of obtaining the segment text of the program segment to be played includes: If the program segment to be played is the first program segment to be played, then the segment text of the opening program segment that matches the target program parameters is selected from the opening segment library and used as the segment text of the program segment to be played. If the program segment to be played is not the first program segment to be played, then the segment text of the program segment to be played is generated based on the target text generation model, the segment text of the previous program segment that is sequentially adjacent to the program segment to be played, and the feedback information of the target user on the previous program segment.
10. The method according to claim 1, characterized in that, After playing the next program segment to be played, the method further includes: Obtain playback information of the played program segments, the playback information including the number of played program segments and the cumulative playback duration; If the playback information of the already played program segment meets the preset stop conditions, then playback stops. The preset stop conditions include: the number of already played program segments is greater than or equal to a preset number threshold, or the cumulative playback duration is greater than or equal to a preset duration threshold. The target user is shown a set of rating items for the played program segment, the set of rating items including rating items of multiple dimensions; Based on a preset quality assessment model, the rating results input by the target user for the set of rating items, and the segment information of the played program segments, the playback quality of the played program segments is determined.
11. A text processing device, characterized in that, include: The acquisition unit is used to acquire the text of the program segment to be played. The first playback unit is used to play the program segment to be played based on the segment text of the program segment to be played, and to obtain feedback information from the target user on the program segment to be played, wherein the feedback information is used to indicate the target user's level of satisfaction with the program segment to be played. The generation unit is used to generate the fragment text of the next program segment to be played based on the target text generation model that matches the target program parameters input by the target user, the fragment text of the currently played program segment, and the feedback information. The target program parameters include the target actor type and the target performance style. The second playback unit is used to play the next program segment to be played based on the segment text of the next program segment to be played after the current program segment to be played has finished playing.
12. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the text processing method as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the text processing method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Live broadcast content generation method and device
CN114125492A
Natural language generation method and device, equipment, medium and product
CN114239545A