Training sample generation method and apparatus, and electronic device
By constructing a training sample generation method to generate summary information of truncated text, and combining scores of consistency, illusion, and conciseness dimensions, the problem of information loss under the character limit of electronic device message notifications is solved, and the accuracy and conciseness of notification summaries are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- VIVO MOBILE COMM CO LTD
- Filing Date
- 2026-03-18
- Publication Date
- 2026-06-26
Smart Images

Figure CN122286296A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence technology, specifically relating to a training sample generation method, apparatus, and electronic device. Background Technology
[0002] Currently, with the development of communication technology, the notification bar of electronic devices has become the entry point for displaying message notifications from various applications on electronic devices, so that users can know the messages received by various applications through the notification bar of electronic devices.
[0003] In related technologies, electronic devices impose strict character limits on message notifications to maintain a consistent user experience in the notification bar. Typically, the maximum message length is 128 characters. If this limit is exceeded, the electronic device will automatically truncate the message notification to ensure the simplicity of the message notification displayed in the notification bar.
[0004] However, in the above method, because electronic devices truncate message notifications that exceed the character limit, it may lead to problems such as loss of key content and incomplete semantic expression in the notification information. Summary of the Invention
[0005] The purpose of this application is to provide a training sample generation method, apparatus, and electronic device that can improve the accuracy of electronic devices displaying message notifications based on messages exceeding character limits.
[0006] In a first aspect, embodiments of this application provide a training sample generation method, which includes: generating second information corresponding to each training data based on truncated text and first information corresponding to each training data; the information dimension corresponding to the first information includes at least one: subject dimension, event dimension, time dimension, and conclusion dimension; the second information is summary information of the truncated text, and the first information includes information of at least one information dimension corresponding to the truncated text; determining a summary text from the second information corresponding to each training data based on a first score corresponding to the second information of each training data; the scoring dimension of the first score includes a consistency dimension, an illusion dimension, and a conciseness dimension; and using the summary text and the truncated text corresponding to the summary text as training samples for a notification message summary model.
[0007] Secondly, embodiments of this application provide a training sample generation apparatus, comprising: a generation module, a determination module, and a processing module. The generation module is used to generate second information corresponding to each training data point based on the truncated text and first information corresponding to each training data point; the information dimensions corresponding to the first information include at least one: subject dimension, event dimension, time dimension, and conclusion dimension; the second information is a summary of the truncated text. The determination module is used to determine a summary text from the second information corresponding to each training data point based on a first score; the scoring dimensions of the first score include consistency dimension, illusion dimension, and conciseness dimension. The processing module is used to use the summary text and the truncated text corresponding to the summary text as training samples for a notification message summary model.
[0008] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0009] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0010] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0011] In a sixth aspect, embodiments of this application provide a computer program / program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.
[0012] In this embodiment, a four-layer comparative sample is constructed, consisting of source text, truncated text, core content, and summary text, combined with verification in terms of illusion, conciseness, and consistency. This allows the model to learn the complete semantic information of the original text through the truncated text, thereby summarizing the notification message based on the complete semantic information. This improves the accuracy of electronic devices in outputting notification summary information based on truncated messages in notification summary scenarios. Attached Figure Description
[0013] Figure 1 This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0014] Figure 2This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0015] Figure 3 This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0016] Figure 4 This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0017] Figure 5 This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0018] Figure 6 This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0019] Figure 7 This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0020] Figure 8 This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0021] Figure 9 This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0022] Figure 10 These are example diagrams of a notification interface provided in some embodiments of this application;
[0023] Figure 11 This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0024] Figure 12 This is a flowchart of a training sample generation method provided by some embodiments of this application;
[0025] Figure 13 This is a schematic diagram of the structure of a training sample generation device provided in some embodiments of this application;
[0026] Figure 14 This is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of this application;
[0027] Figure 15 This is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of this application. Detailed Implementation
[0028] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0029] The terms "first," "second," etc., used in this application's specification are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects. For example, a first object can be one or more, where "more" means at least two. Furthermore, in the specification, "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.
[0030] The terms "at least one" and "at least one of" in this application's specification refer to any one, any two, or a combination of two or more of the included objects. For example, "at least one of a, b, and c" can mean "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple, and multiple means at least two. Similarly, "at least two" means two or more, and its meaning is similar to "at least one". The identifiers in this application are text, symbols, images, etc., used to indicate information, and can use controls or other containers as carriers for displaying information, including but not limited to text identifiers, symbol identifiers, and image identifiers.
[0031] The terminology used in the implementation section of this application is only for explaining specific embodiments of this application and is not intended to limit this application. The terminology involved in the embodiments of this application is explained below.
[0032] Large Language Model (LLM): A large language model is a deep learning model based on the Transformer architecture, which is pre-trained and post-trained on large-scale text data and has the ability to understand and generate natural language. Its parameter scale usually reaches one billion or more and can complete a variety of natural language processing tasks such as text generation, summarization, translation, and question answering.
[0033] On-Device Large Language Model (OD-LLM): An on-device large language model refers to a large language model that has been lightweight and optimized, including but not limited to model pruning, quantization, and knowledge distillation, and can be deployed and run locally on a terminal device. This model does not rely on a cloud server and can independently complete tasks such as natural language understanding, generation, and reasoning on the device, with the characteristics of low latency and high privacy.
[0034] Notification Summary: Notification summary refers to the process of using a large-scale on-device model to extract content, remove redundancy, and semantically integrate multiple notification messages received by a terminal device, including application pushes, system reminders, and message notifications, ultimately generating a concise and readable text summary. Its goal is to reduce the cost of information retrieval for users and improve notification browsing efficiency.
[0035] Supervised Fine-Tuning (SFT): Supervised fine-tuning refers to the process of fine-tuning and optimizing the parameters of a large language model using a well-labeled, high-quality supervised dataset, based on a pre-trained large language model. This is the post-training stage of the large language model. Through this process, the large language model can be adapted to the output requirements of a specific task, thereby improving the accuracy of task execution.
[0036] Illusion: In the field of large language models, this refers to the phenomenon where the output generated by the model deviates significantly from objective facts, input context, or known knowledge, and the model itself does not label or indicate this deviation. Illusions can be divided into two categories: factual illusions, such as fabricating non-existent people, events, data, or documents, and logical illusions, such as contradictions in reasoning, errors in causal relationships, and failure of contextual relevance.
[0037] The training sample generation method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0038] The training sample generation method provided in this application embodiment can be applied to scenarios where notification messages are displayed.
[0039] The training sample generation method provided in this application is executed by a training sample generation device, which can be an electronic device, or a functional module or entity within an electronic device. This application does not limit the specific implementation of this method. The following will use an electronic device as an example to illustrate the training sample generation method provided in this application.
[0040] This application provides a method for generating training samples. Figure 1 A flowchart of a training sample generation method provided in an embodiment of this application is shown. Figure 1As shown, the training sample generation method provided in this application embodiment may include the following steps 201 to 203.
[0041] Step 201: The electronic device generates the second information corresponding to each training data based on the truncated text and the first information corresponding to each training data.
[0042] In some embodiments of this application, the information dimension corresponding to the first information mentioned above includes at least one of the following: subject dimension, event dimension, time dimension, and conclusion dimension; the second information mentioned above is the summary information of the truncated text, and the first information mentioned above includes information of at least one information dimension corresponding to the truncated text.
[0043] For example, electronic devices can collect training data for meeting minutes scenarios and call transcription scenarios.
[0044] In some embodiments of this application, the electronic device can extract information from the truncated text based on the information dimension corresponding to the first information to obtain the second information corresponding to each training data.
[0045] It should be noted that the specific implementation process of step 201 above can be found in the following embodiments, and will not be repeated here to avoid repetition.
[0046] Optionally, in this embodiment of the application, the electronic device can perform data cleaning on the initial training dataset to obtain a training dataset, and then identify the domain to which each training data in the training dataset belongs.
[0047] For example, electronic devices can filter the initial training dataset according to preset data cleaning rules, mainly targeting excessively long, repetitive, and meaningless text and excessively short text, i.e., training data less than 50 characters, which is too short to extract effective summary content.
[0048] Then, the electronic device can identify the domain to which each training data in the training dataset belongs based on the preset domain labels and the domain labeling model.
[0049] For example, the above-mentioned domain labels may include at least one of the following: 56 distinctive domains such as current affairs, people's livelihood, medical care, and mathematics.
[0050] For example, electronic devices can construct domain labeling models. Since LLM (Local Level Model) data labeling is slow and unsuitable for large-scale data labeling, BERT (Browser Expert Provider) models are faster and achieve the desired results. Therefore, based on training data from a notification scenario, LLM is used for domain labeling to obtain a small amount of domain training data, for example, 5600 entries. Then, a BERT classification model is trained using this small amount of domain training data to obtain a trained BERT classification model. Finally, based on the obtained BERT classification model, each training sample is used as input to the BERT model, and the output of the BERT model is used as the specific domain label to label the sample domain, thus obtaining the specific domain to which the training data in the notification scenario belongs.
[0051] For example, such as Figure 2 As shown, the above-mentioned domain labeling process can be implemented through steps 1 to 3 as described below.
[0052] Step 1: The electronic device is pre-loaded with 56 domain labels.
[0053] Step 2: Construct a domain annotation model for electronic devices.
[0054] Step 3: The electronic device outputs the domain to which each training data belongs through the domain labeling model.
[0055] For example, such as Figure 3 As shown, the training process of the above domain labeling model is achieved through steps 4 to 8 below.
[0056] Step 4: Establish a clear domain labeling system for electronic devices.
[0057] For example, the aforementioned electronic device's domain labeling system can have 56 preset domain labels.
[0058] Step 5: The electronic device constructs labeled training data based on the LLM model using the original data.
[0059] Step 6: The electronic device trains the BERT model based on the labeled training data to obtain the trained BERT model.
[0060] Step 7: The electronic device outputs the domain identifier through the trained BERT model and performs a domain identifier consistency check.
[0061] Step 8: The electronic device determines whether they are consistent.
[0062] In the example system, if the electronic devices determine that the results are consistent, step 6 is executed; if the electronic devices determine that the results are inconsistent, step 5 is executed.
[0063] In this way, by expanding the scope of training data, electronic devices can break through the limitations of existing solutions that only focus on two specific scenarios: meetings and calls. They can comprehensively expand the scope of training data and accurately cover various sub-scenarios involved in notification scenarios, such as social communication, office collaboration, information content, and life services.
[0064] Step 202: The electronic device determines the summary text from the second information corresponding to each training data based on the first score corresponding to the second information of each training data.
[0065] In some embodiments of this application, the scoring dimensions of the first score mentioned above include consistency dimension, illusion dimension, and simplicity dimension.
[0066] In some embodiments of this application, step 202 described above can be implemented by step 202a as follows.
[0067] Step 202a: The electronic device determines the second information that meets the first condition as the summary text.
[0068] In some embodiments of this application, the first condition is: the consistency dimension score corresponding to the second information is greater than or equal to the second threshold, the illusion dimension score is less than or equal to the third threshold, and the simplicity dimension score is greater than or equal to the fourth threshold.
[0069] In some embodiments of this application, the electronic device can use an LMM model to determine the second information that satisfies the first condition as summary text.
[0070] For example, electronic devices can use LLM to score consistency based on truncated text, core content, and candidate summary content. Samples with low consistency scores are removed. The scoring criteria are: 1 point, extremely inconsistent: core information has significant deviations, repetitions, and redundancies; formatting and expression logic are chaotic, only a few elements barely correspond, and overall there is no consistency. 2 points, partially inconsistent: core information is basically identifiable, but there is redundant and irrelevant information; some elements are inconsistently expressed; formatting and logic have obvious flaws; consistency is poor. 3 points, basically consistent: core information is accurate, with no significant redundancy or irrelevant content; most elements, formatting, and expression are consistent; only a few details have slight inconsistencies that do not affect core understanding. 4 points, highly consistent: language is concise, with no redundancy, repetition, or irrelevant information; core content is clear and accurate; all elements, formatting, and expression are highly consistent; only a few details can be optimized. 5 points, completely consistent: language is extremely concise and efficient; core information is accurate and unbiased; there is no redundancy, repetition, or irrelevant content; elements, formatting, expression, and logic are completely consistent; there is no room for optimization.
[0071] Electronic devices use LLM (Limited Language Management) to determine hallucinations based on truncated text, core content, and candidate summary content. If a hallucination is detected in a candidate summary, the sample is discarded. Scoring criteria are as follows: 0 points, hallucination exists, unacceptable: output contains fabricated content, false facts, unfounded inferences, contradictory information from the original text, or adds irrelevant content not mentioned in the original text, containing any form of false / deviant expression. 1 point, no hallucination, acceptable: output content is entirely based on the given input / context, contains no fabricated information, false facts, unfounded inferences, all expressions are consistent with the core information of the original text, and there is no added irrelevant / erroneous content.
[0072] Finally, the electronic devices, combined with the prior scoring, perform data availability screening to select high-quality samples.
[0073] In this way, electronic devices can ensure the accuracy and conciseness of candidate summary content through dual constraints at both the format and semantic levels.
[0074] Step 203: The electronic device uses the summary text and the truncated text corresponding to the summary text as training samples for the notification message summary model.
[0075] In some embodiments of this application, the electronic device can associate and store the summary text and the corresponding truncated text to obtain training samples for the notification message summary model.
[0076] This application provides a training sample generation method. An electronic device generates second information corresponding to each training data point based on truncated text and first information. The first information includes at least one dimension: subject dimension, event dimension, time dimension, and conclusion dimension. The second information is a summary of the truncated text. Then, based on a first score corresponding to the second information of each training data point, a summary text is determined from the second information. The first score includes consistency, illusion, and conciseness dimensions. Finally, the summary text and its corresponding truncated text are used as training samples for a notification message summary model. This solution constructs a four-layer comparison sample system (source text, truncated text, core content, and summary text) and combines verification based on illusion, conciseness, and consistency. This allows the model to learn the complete semantic information of the original text through the truncated text, thereby summarizing the notification message using the complete semantic information. This improves the accuracy of the electronic device outputting notification summary information based on truncated messages in notification summary scenarios.
[0077] In some embodiments of this application, prior to step 201 above, the training sample generation method provided in this application further includes steps 301 and 302 as described below.
[0078] Step 301: The electronic device splits each training data point into M sub-texts based on the segmentation characters contained in each training data point in the text training dataset.
[0079] In some embodiments of this application, each of the above training data corresponds to at least two sub-texts, and the number of characters in each of the M sub-texts is greater than a first threshold, where M is a positive integer greater than 1.
[0080] In some embodiments of this application, the aforementioned first threshold can be user-defined or preset by the electronic device. The specific threshold can be determined according to actual usage needs, and this application does not impose any limitations.
[0081] For example, the first threshold mentioned above can be 8.
[0082] In some embodiments of this application, the electronic device splits each training data into texts based on the segmentation characters contained in each training data in the text training dataset, discarding texts with a character count less than or equal to a first threshold, to obtain M sub-texts.
[0083] For example, the above text training dataset may include: Pumpkin: Teacher Huo, what a coincidence. / n Mystery: Blocked? / n Ni: Is there a replay? / n Huang Xin: Teacher Wang, what a coincidence. / n, User A: Landlord direct rental: Rent a single room with one bedroom and one bathroom on the 4th floor, cooking allowed, location: Area A, B Zhuang Xiyuan Second District, near Metro Line 2, price: 800 / month including property management fee and internet fee, discounts available for long-term rentals, short-term rentals possible. Payment method: one month's rent as deposit, one month's rent in advance, monthly payment; Remarks: 4th floor single room, private bathroom, cooking allowed. Fully furnished with appliances and furniture. Private message to view the room. After splitting the above text training dataset using segmentation, a subtext is obtained: User A: Landlord direct rental: Rent a single room with one bedroom and one bathroom on the 4th floor, cooking allowed, location: Area A, B Zhuang Xiyuan Second District, near Metro Line 2, price: 800 / month including property management fee and internet fee, discounts available for long-term rentals, short-term rentals possible. Payment terms: one month's rent as deposit, monthly payment; Note: Single room on the 4th floor, private bathroom, cooking allowed. Fully furnished with appliances and furniture.
[0084] Where / n is the segmentation character.
[0085] Step 302: The electronic device truncates each subtext based on the number of characters in each subtext to obtain the truncated text corresponding to each training data.
[0086] It should be noted that the specific implementation process of step 302 above can be found in the following embodiments. To avoid repetition, it will not be described again here.
[0087] For example, such as Figure 4 As shown, the specific process of truncating the text described above can be achieved through steps 10 to 12 below.
[0088] Step 10: The electronic device splits the training data into multiple independent data sets.
[0089] Step 11: The electronic device constructs truncated candidate samples based on independent messages.
[0090] Step 12: The electronic device obtains multiple truncated training samples by arranging and combining the truncated candidate samples.
[0091] In some embodiments of this application, step 302 can be implemented by step 302a or step 302b as described below.
[0092] Step 302a: If the number of characters in the first sub-text is within the first range, use the first sub-text as the truncated data corresponding to the first training data.
[0093] In some embodiments of this application, the first sub-text is any one of M sub-texts; the first training data is the training data corresponding to the first sub-text.
[0094] In some embodiments of this application, the aforementioned first quantity range can be user-defined; or, it can be preset by the electronic device. The specific range can be determined according to actual usage needs, and this application does not impose any limitations.
[0095] For example, the first quantity range mentioned above can be 8-128.
[0096] In some embodiments of this application, the electronic device may directly add a first subtext within a first quantity range to the truncated text candidate set.
[0097] Step 302b: When the number of characters in the first sub-text is greater than the maximum value of the first number range, the electronic device truncates the first sub-text according to at least one truncation ratio to obtain at least one candidate training text, and obtains the truncated text corresponding to the first training data based on the at least one candidate training text, so as to obtain the truncated text corresponding to each training data.
[0098] In some embodiments of this application, each of the at least one cutoff ratio described above can be preset by the electronic device; or, it can be user-defined. The specific cutoff ratio can be determined according to actual usage requirements, and this application does not impose any limitations.
[0099] For example, taking the above-mentioned at least one cutoff ratio as three, the three cutoff ratios can be: 20%, 50% and 80%.
[0100] In some embodiments of this application, the step 302b above, "obtaining the truncated text corresponding to the first training data based on at least one candidate training text", can be specifically implemented through the following steps 302b1 or 302b2.
[0101] Step 302b1: If the number of characters in the first candidate training text is greater than the maximum value of the first number range, the electronic device truncates the first candidate training text according to the number of characters corresponding to the maximum value, and obtains the truncated text corresponding to the first training data.
[0102] In some embodiments of this application, the first candidate training text is any one of at least one candidate training text.
[0103] Step 302b2: If the number of characters in the first candidate training text is within a first range, the electronic device uses the first candidate training text as the truncated text corresponding to the first training data.
[0104] For example, such as Figure 5 As shown, steps 301 to 302b2 will be explained in detail below. Specifically, they can be implemented through steps 13 to 19 as described below.
[0105] Step 13: The electronic device determines whether the independent message is less than 8 characters.
[0106] For example, the aforementioned independent messages are the split training data.
[0107] Step 14: If the independent message is less than 8 characters, the electronic device will not truncate the independent message and will output it directly.
[0108] Step 15: If an independent message is greater than 8 characters and less than or equal to 128 characters, the electronic device adds the independent message to the truncation training set.
[0109] Step 16: If an independent message is longer than 128 characters, the electronic device truncates it three times according to the length of the independent message: 20%, 50%, and 80%, resulting in three truncated messages.
[0110] Step 17: The electronic device determines whether the number of characters in each of the three truncated messages is less than 8 characters.
[0111] Step 18: If any of the three truncated messages has fewer than 8 characters, the electronic device discards that truncated message.
[0112] Step 19: If any of the three truncated messages has more than 128 characters, the electronic device forcibly truncates it to 128 characters and adds the truncated message to the truncation training set.
[0113] For example, the electronic device first determines if the input message is less than 8 characters. If it is, the original message is output directly without truncation. For samples longer than 8 characters, truncation is performed at 20%, 50%, and 80% of the original length, resulting in three sub-messages of the same message. The truncated message is then checked for length; if it is too short, it is discarded. If the truncated message still exceeds 128 characters, it is forcibly truncated to 128 characters.
[0114] For example, consider the message obtained from the previous segmentation: "User A: Direct rental from landlord: 4th floor, one-bedroom, one-bathroom single room, cooking allowed; Location: Area A, Bzhuang Xiyuan Second District, near Metro Line 2; Price: 800 / month including property management fee and internet fee; Discounts available for long-term rentals; Short-term rentals also possible; Payment method: one month's rent as deposit, one month's rent in advance, monthly payment; Remarks: 4th floor single room, private bathroom, cooking allowed. Fully furnished with appliances." If we truncate it to 20%, 50%, and 80% of its length, we get the following three messages: First message: User A: Landlord. Second message: User A: Direct rental from landlord: 4th floor, one-bedroom, one-bathroom single room for rent, cooking allowed. Location: Area A, Bzhuang Xiyuan Second District, near Metro Line 2. Third message: User A: Direct rental from landlord: 4th floor, one-bedroom, one-bathroom single room for rent, cooking allowed. Location: Area A, Bzhuang Xiyuan Second District, near Metro Line 2. Price: 800 RMB / month including property management fee and internet fee. Discounts available for long-term rentals. Short-term rentals also welcome.
[0115] In some embodiments of this application, the electronic device, based on the candidate samples obtained from the above steps, randomly selects samples of different truncation lengths according to the original message order, and combines them to construct multiple samples.
[0116] It should be noted that the above data truncation scheme is adapted to notification scenarios with strict character or line count constraints, resolving the core contradiction between source information loss and summary conciseness. Specifically, it can be broken down into the following three key dimensions:
[0117] 1. Simulate the incomplete information distribution of real notifications to eliminate the training-inference scenario gap.
[0118] 2. Force the model to learn "prioritizing the extraction of core elements under limited information". The core requirement of a notification summary is not to "reiterate all the content", but to extract the core value within 38 characters. For example: "Zhang San will return to the company at four o'clock; Li Si has a meeting with you at three o'clock in the afternoon".
[0119] 3. Improve the model's robustness to truncation noise and avoid loss of key information. System truncation is irregular and may occur at arbitrary positions, introducing "textual noise," such as incomplete sentences or missing punctuation. By constructing samples with different truncation positions and lengths, such as truncating 20%, 50%, or 80% of the content for training, the model can focus on the core information in the remaining text, avoiding the generation of summaries that deviate from the original meaning due to input truncation during inference.
[0120] For example, the final samples before and after truncation are shown in Table 1.
[0121] Table 1
[0122]
[0123] In this embodiment, the electronic device truncates training data to obtain truncated text, and trains a model using this truncated text. This enables the model to generate summary messages that can extract the user's true intent from the truncated text, thus improving the accuracy of notification summaries by the electronic device.
[0124] In some embodiments of this application, prior to step 201 above, the training sample generation method provided in this application further includes steps 401 to 403 as described below.
[0125] Step 401: The electronic device acquires the third information corresponding to each training data.
[0126] In some embodiments, the information dimensions corresponding to the aforementioned third information include at least one of the following: subject dimension, event dimension, time dimension, and conclusion dimension.
[0127] For example, an electronic device can input truncated text into a first model to obtain third information corresponding to each training data.
[0128] In some embodiments of this application, the first model described above can be a neural network model, an AI model, or an LLM, etc. The specific model can be determined according to actual usage requirements, and this application does not impose any limitations.
[0129] Step 402: The electronic device performs text verification on the third information corresponding to each training data to obtain the verification information corresponding to each training data.
[0130] In some embodiments, a verification information is used to indicate the consistency of text content between a third piece of information and the training data corresponding to the third piece of information.
[0131] For example, the electronic device can input the third information and the truncated text corresponding to the third information back into the first model to obtain the verification information corresponding to each training data.
[0132] Step 403: The electronic device filters the third information corresponding to each training data based on the verification information and the information dimension of the third information corresponding to each training data to obtain the first information corresponding to each training data.
[0133] For example, such as Figure 6 As shown, the process of obtaining the first information can be specifically implemented through the following steps 30 to 33.
[0134] Step 30: The electronic device inputs truncated data into the LLM model to generate third information.
[0135] Step 31: The electronic device verifies the content of the third information.
[0136] Step 32: The electronic device filters third-party information based on the dimensional content.
[0137] Step 33: The electronic device aggregates the valid third information as the first information.
[0138] In some embodiments of this application, step 403 can be specifically implemented by step 403a as described below.
[0139] Step 403a: If the first verification information corresponding to the first training data indicates that the text content between the first training data and the corresponding third information is unrelated, and the text content corresponding to any two information dimensions of the third information corresponding to the first training data is empty, discard the third information corresponding to the first training data to obtain the first information corresponding to each training data.
[0140] In some embodiments of this application, the first training data mentioned above is any one of the training data in the text training dataset.
[0141] For example, if two or more of the four dimension elements in the information dimension of the third information are empty, the third information is discarded.
[0142] In some embodiments of this application, the electronic device can aggregate all valid core content to obtain the final core content of the notification sample.
[0143] For example, the verification information corresponding to each of the above training data is shown in Table 2.
[0144] Table 2
[0145]
[0146]
[0147]
[0148] In this embodiment, the core content generation stage uses LLM to extract essential elements based on structured annotation to form semantic constraint boundaries. The annotation stage mainly uses key-value pair format annotation. The final generated content includes four key values: subject, event, time, and core conclusion. Each key value has its corresponding specific content, and the content corresponding to the key value can be empty.
[0149] Quality control is mainly divided into two levels. The first is the accuracy of the core content itself, which needs to ensure that all core content comes from the input samples and that there is no redundant information. The second is that when two or more sub-elements have no specific content, the current core content is considered to have insufficient information. When using core content with insufficient information as a reference in the revision and summary result generation stage, it is easy to cause model illusion. Therefore, core content with more missing elements is discarded.
[0150] The core content aggregation stage primarily involves combining the core content from multiple message messages. This stage involves deduplicating duplicate core content and aggregating information about the same event scattered across different messages. The result is a highly condensed summary of the entire conversation, facilitating subsequent generation of summary content and validation of candidate summary content.
[0151] In some embodiments of this application, prior to step 202 above, the training sample generation method provided in this application further includes step 501 as described below.
[0152] Step 501: The electronic device inputs the second information of each training data into the dimension scoring model. Through the regular expression corresponding to each dimension in the dimension scoring model, the second information of each training data is scored to obtain the first score corresponding to each training data.
[0153] For example, the electronic device filters candidates based on the length of the summary content and the number of summary topics, selecting samples with a summary character length of less than 38 and a summary topic number of less than 4. For example, the summary result above, "Nancy greets Teacher Huo; landlord directly rents single rooms in Area A; welfare center gives out large-value ticket coupons on Saturdays," is separated by two semicolons, totaling 3 samples, which meet the requirements, and the total character count is 36, which also meets the requirements.
[0154] Then, embedding is used to calculate the similarity between the core content and the candidate summary. This step can efficiently perform an initial screening, filtering out samples with low similarity and retaining samples with high similarity.
[0155] Finally, using LLM, conciseness was scored based on three criteria: truncated text, core content, and candidate summary content. Samples with low conciseness scores were removed. An example of a conciseness score is shown below:
[0156] Please evaluate the quality of the summary provided by the AI assistant when completing the "Notification Summary" task on your mobile phone, based on the message content and core information, acting as an objective and impartial evaluator. The scoring criteria are as follows:
[0157] 0 points: The language is not concise, contains redundant, repetitive, and irrelevant information, and the content is vague, inaccurate, and inefficient.
[0158] 1 point: The language is extremely concise, eliminating redundant / repetitive / irrelevant information, and the content is clear, accurate, and efficient.
[0159] The message content is: A.
[0160] The core content is: B.
[0161] The conclusion is: C.
[0162] Your rating is: 1 point.
[0163] For example, such as Figure 7 As shown, the above content scoring process can be implemented through steps 40 to 45 below.
[0164] Step 40: The electronic device filters the candidate summary texts.
[0165] For example, the electronic device determines whether the length of the candidate summary text is less than 38 characters, and discards it directly if it is less than 38 characters, and determines whether the dimension content in the candidate summary text is less than 4, and discards it directly if it is less than 4.
[0166] Step 41: The electronic device calculates the similarity of the filtered candidate summary texts.
[0167] For example, if the similarity of the filtered candidate summary text is less than a preset similarity threshold, it will be discarded directly.
[0168] Step 42: If the similarity of the filtered candidate summary texts is greater than or equal to the preset similarity threshold, the electronic device will calculate the conciseness score.
[0169] For example, if the simplicity score is less than the preset simplicity threshold, it is discarded directly.
[0170] Step 43: If the conciseness score of the filtered candidate summary text is greater than or equal to the preset conciseness threshold, the electronic device will calculate the consistency score.
[0171] For example, if the consistency score of the filtered candidate summary text is less than the preset consistency threshold, it is discarded directly.
[0172] Step 44: If the consistency score of the filtered candidate summary text is greater than or equal to the preset consistency threshold, the electronic device performs an illusion score on the filtered candidate summary text.
[0173] For example, if the illusion score of the filtered candidate summary text is greater than or equal to the preset illusion score threshold, it is discarded directly.
[0174] Step 45: If the illusion score of the filtered candidate summary text is less than the preset illusion score threshold, the electronic device will use the filtered candidate summary text and the training data corresponding to the filtered candidate summary text as training samples.
[0175] In this way, by establishing a multi-layered verification mechanism, electronic devices can break through the limitations of the existing single consistency verification and build a multi-level, multi-dimensional summary verification mechanism that covers core dimensions such as consistency, illusion, and simplicity, thus comprehensively ensuring the quality of notification summaries.
[0176] In some embodiments of this application, the above-mentioned solutions address the problems of insufficient coverage of training data scenarios and missing key information in training samples. However, when the number of messages is too large, there will also be many corresponding core information entries, resulting in a large amount of information in the generated notification content, which may easily exceed the 38-character limit and make it easy to overlook key information. Therefore, electronic devices can use LLM to perform a series of optimizations on the core content, sorting them by importance and removing less important core content, so that only the more important core content is used in subsequent stages.
[0177] For example, electronic devices use LLM to score the importance of core content based on truncated text and core content, filtering out unimportant content. The requirements for the importance score are as follows:
[0178] Level 1: Top Emergency, highest priority, immediate action required: Concerning personal safety, significant property loss, or collapse of core operations, requiring response within seconds / minutes; delays will result in irreversible and serious consequences.
[0179] Level 2: First-level importance, high priority, to be handled within 1 hour: Affects the progress of core work, maintenance of important relationships, and achievement of key milestones. It needs to be closed within the same day. Delays will affect core objectives.
[0180] Level 3: Level 2 Routine, Medium Priority, to be handled within the day: Routine necessary tasks, not urgent but need to be completed, affecting the normal work / life order, can be handled within the day without negative impact.
[0181] Level 4: Secondary, low priority, to be processed within 3 days: Not necessary to process immediately, can be completed later, no clear time pressure, no negative impact if delayed within 3 days.
[0182] Level 5: Level 4 irrelevant, lowest priority, can be ignored / deferred: no practical value, irrelevant to itself, no need to process, no negative impact if not processed.
[0183] Regarding the core content: {"Subject": "Pumpkin [Pumpkin Lantern] Nancy, Teacher Huo","Event": "Nancy greets Teacher Huo, saying it's a coincidence to meet","Time": "","Core Conclusion": ""}, the content is merely a polite greeting from a chance encounter, lacking urgency, transactional nature, and any sense of responsibility. It has no practical value requiring any processing or response and is therefore considered meaningless chatter, meeting the Level 5 criterion of "irrelevant and requiring no processing".
[0184] Then, the electronic device uses LLM to merge and rewrite the core content, combining related events. For example, the following two core events:
[0185] {"Subject": "Pumpkin [Pumpkin Lantern] Nancy, Teacher Huo","Event": "Nancy greets Teacher Huo, saying it's a coincidence","Time": "","Core Conclusion": ""}{"Subject": "Huang Xin, Teacher Wang","Event": "Huang Xin greets Teacher Wang, saying it's a coincidence","Time": "","Core Conclusion": ""} can be combined into: {"Subject": "Huang Xin, Teacher Wang; Pumpkin [Nancy], Teacher Huo","Event": "Huang Xin greets Teacher Wang, and Nancy greets Teacher Huo, both saying it's a coincidence","Time": "","Core Conclusion": ""}.
[0186] Next, the electronic device uses LLM to score the importance of the core content. Finally, the electronic device sorts the scored core content in descending order of importance score, retains the top 5 core content, and discards the other core content with lower scores.
[0187] For example, such as Figure 8 As shown, the specific implementation process of the first information filtering described above can be achieved through the following steps 50 to 53.
[0188] Step 50: The electronic device scores and filters the first piece of information based on its importance.
[0189] Step 51: The electronic device merges the filtered first information.
[0190] Step 52: The electronic device scores the importance of the merged first information.
[0191] Step 53: Select the first piece of information corresponding to the top 5 importance scores for the electronic device.
[0192] For example, such as Figure 9 As shown, the above-mentioned sorting and simplification of the first information by importance can be achieved through steps 60 to 63 below.
[0193] Step 60: The electronic device scores the importance of the first piece of information.
[0194] For example, if the importance score corresponding to the first piece of information is less than the importance threshold, the electronic device discards the first piece of information.
[0195] Step 61: If the importance score corresponding to the first information is greater than or equal to the importance threshold, the electronic device performs content merging on the first information using the LLM model.
[0196] Step 62: The electronic device re-evaluates the importance of the merged first information.
[0197] Step 63: Select the first piece of information corresponding to the top 5 importance scores for the electronic device.
[0198] In this way, the electronic device prioritizes and simplifies the primary information, providing a valuable reference for generating concise and accurate candidate summaries. This allows it to provide the most important notification summaries even when receiving a large number of notifications on the device. Furthermore, it can be flexibly expanded to meet different conciseness requirements.
[0199] In some embodiments of this application, after step 203 above, the training sample generation method provided in this application further includes steps 601 to 603 as described below.
[0200] Step 601: The electronic device inputs the training samples into the initial model, performs text summarization on the truncated text in the training samples, and obtains the candidate summary text corresponding to the truncated text.
[0201] Step 602: The electronic device calculates the loss value between the candidate summary text and the summary text using the initial model.
[0202] In some embodiments of this application, the aforementioned loss value may be the cross-entropy loss value.
[0203] Step 603: The electronic device trains an initial model based on the loss value to obtain a notification message summary model.
[0204] In some embodiments of this application, the electronic device can train an initial model using loss values through backpropagation to obtain a notification message summary model.
[0205] In this embodiment, since the notification message summary model is trained using truncated data, it can summarize text that conforms to user semantics by using truncated data. This improves the accuracy of text summarization by electronic devices.
[0206] In some embodiments of this application, the training sample generation method provided in this application further includes the following steps 701 and 702.
[0207] Step 701: The electronic device receives the first notification message.
[0208] In some embodiments of this application, the aforementioned first notification message can be a notification message received by any application in the electronic device. The specific message can be determined according to actual usage requirements, and this application does not impose any limitations.
[0209] Step 702: The electronic device displays a summary text of the notification message based on the message content of the first notification message using the notification message summary model.
[0210] In some embodiments of this application, the electronic device may display a summary text of the notification message on the notification message interface.
[0211] For example, such as Figure 10 As shown, taking an electronic device as an example, a mobile phone, when in standby mode, receives notifications from various applications. When the phone receives a notification message from Zhang San: "Zhang San: I'm having dinner at Restaurant A at 6 PM tonight. The food there is delicious and many people recommend it. Let's try it!", the phone can summarize the notification message and get the summary message "Zhang San: I'm having dinner at Restaurant A at 6 PM tonight. It's very delicious," and display this summary message 11 "Zhang San: I'm having dinner at Restaurant A at 6 PM tonight. It's very delicious" on the phone's notification interface 10.
[0212] In this embodiment, the electronic device can display a summary text of the notification message in the notification message interface, which avoids the user being unable to view the notification message in a timely manner and improves the flexibility of the electronic device in displaying notification messages.
[0213] It should be noted that the above-described method embodiments, or the various possible implementations of the method embodiments, can be executed individually, or, provided there are no contradictions, they can be combined with each other. The specific implementation can be determined according to actual usage requirements, and this application embodiment does not impose any restrictions on this.
[0214] For example, such as Figure 11As shown below, a training sample generation method provided by an embodiment of this application will be explained in detail. Specifically, it can be implemented through steps 70 to 77 described below.
[0215] Step 70: The electronic device collects the initial training dataset.
[0216] Step 71: The electronic device filters and selects data from the initial training dataset to obtain the training dataset.
[0217] Step 72: The electronic device performs domain labeling on each training data in the training dataset.
[0218] Step 73: The electronic device randomly truncates each training data point in the training dataset to obtain the truncated text corresponding to each training data point.
[0219] Step 74: The electronic device generates the core content of the truncated text corresponding to each training data, thus obtaining the core text corresponding to each training data.
[0220] Step 75: The electronic device generates candidate summary text based on the core text corresponding to each training data using the LLM model.
[0221] Step 76: The electronic device performs content verification on the candidate summary text corresponding to each training data.
[0222] Step 77: The electronic device uses the verified summary text and the corresponding truncated text as training samples.
[0223] For example, such as Figure 12 As shown below, another training sample generation method provided by the embodiments of this application will be explained in detail. Specifically, it can be implemented through steps 80 to 88 as described below.
[0224] Step 80: The electronic device collects the initial training dataset.
[0225] Step 81: The electronic device filters and selects data from the initial training dataset to obtain the training dataset.
[0226] Step 82: The electronic device performs domain labeling on each training data in the training dataset.
[0227] Step 83: The electronic device randomly truncates each training data point in the training dataset to obtain the truncated text corresponding to each training data point.
[0228] Step 84: The electronic device generates the core content of the truncated text corresponding to each training data, thus obtaining the core text corresponding to each training data.
[0229] Step 85: The electronic device generates candidate summary text based on the core text corresponding to each training data using the LLM model.
[0230] Step 86: The electronic device uses an LLM model to sort and filter candidate summary texts based on their importance for each training data point.
[0231] Step 87: The electronic device performs content verification on the candidate summary text corresponding to each filtered training data.
[0232] Step 88: The electronic device uses the verified summary text and the corresponding truncated text as training samples.
[0233] It should be noted that the training sample generation method provided in this application can be executed by a training sample generation device. This application uses a training sample generation device executing the training sample generation method as an example to illustrate the training sample generation device provided in this application.
[0234] Figure 13 A schematic diagram of a possible structure of the training sample generation device involved in an embodiment of this application is shown. For example... Figure 13 As shown, the training sample generation device 90 may include: a generation module 91, a determination module 92, and a processing module 93.
[0235] The generation module 91 is used to generate second information corresponding to each training data point based on the truncated text and first information corresponding to each training data point. The information dimensions corresponding to the first information include at least one: subject dimension, event dimension, time dimension, and conclusion dimension. The first information includes information from at least one information dimension corresponding to the truncated text. The second information is a summary of the truncated text. The determination module 92 is used to determine the summary text from the second information corresponding to each training data point based on the first score corresponding to the second information. The scoring dimensions of the first score include consistency dimension, illusion dimension, and conciseness dimension. The processing module 93 is used to use the summary text and the truncated text corresponding to the summary text as training samples for the notification message summary model.
[0236] This application provides a training sample generation device that constructs four layers of comparative samples: source text, truncated text, core content, and summary text, combined with verification in terms of illusion, conciseness, and consistency. This allows the model to learn the complete semantic information of the original text through the truncated text, and thus summarize the notification message using the complete semantic information. In this way, the accuracy of the training sample generation device in outputting notification summary information based on truncated messages in the notification summary scenario is improved.
[0237] In one possible implementation, the processing module 93 is further configured to, before the generation module generates the second information corresponding to each training data based on the truncated text and the first information corresponding to each training data, split each training data into M sub-texts based on the segmentation characters contained in each training data in the text training dataset; each training data corresponds to at least two sub-texts, and the number of characters in each of the M sub-texts is greater than a first threshold, where M is a positive integer greater than 1; and based on the number of characters in each sub-text, truncate each sub-text to obtain the truncated text corresponding to each training data.
[0238] In one possible implementation, the processing module 93 is specifically used to, when the number of characters in the first sub-text is within a first range, treat the first sub-text as truncated data corresponding to the first training data; the first sub-text is any one of M sub-texts; the first training data is the training data corresponding to the first sub-text; or, when the number of characters in the first sub-text is greater than the maximum value of the first range, truncate the first sub-text according to at least one truncation ratio to obtain at least one candidate training text, and based on at least one candidate training text, obtain the truncated text corresponding to the first training data, so as to obtain the truncated text corresponding to each training data.
[0239] In one possible implementation, the processing module 93 is specifically used to truncate the first candidate training text according to the number of characters corresponding to the maximum value of the first number range when the number of characters in the first candidate training text is greater than the maximum value of the first number range, so as to obtain the truncated text corresponding to the first training data; the first candidate training text is any one of at least one candidate training text; or, when the number of characters in the first candidate training text is within the first number range, the first candidate training text is used as the truncated text corresponding to the first training data.
[0240] In one possible implementation, the processing module 93 is further configured to: obtain third information corresponding to each training data before the generation module generates second information corresponding to each training data based on the truncated text and first information corresponding to each training data; the information dimension of the third information includes at least one of the following: subject dimension, event dimension, time dimension, and conclusion dimension; and perform text verification on the third information corresponding to each training data to obtain verification information corresponding to each training data; a verification information is used to indicate the consistency of text content between a third information and a training data corresponding to a third information; and filter the third information corresponding to each training data based on the verification information and the information dimension of the third information corresponding to each training data to obtain the first information corresponding to each training data.
[0241] In one possible implementation, the processing module 93 is specifically used to discard the third information corresponding to the first training data when the first verification information corresponding to the first training data indicates that the text content between the first training data and the corresponding third information is unrelated, and the text content corresponding to any two information dimensions of the third information corresponding to the first training data is empty; wherein, the first training data is any training data in the text training dataset.
[0242] In one possible implementation, the processing module 93 is further configured to input the second information of each training data into a dimensional scoring model before determining the summary text from the second information corresponding to each training data based on the first score corresponding to the second information of each training data, and to perform dimensional scoring on the second information of each training data by using the regular expression corresponding to each dimension in the dimensional scoring model to obtain the first score corresponding to each training data.
[0243] In one possible implementation, the processing module 93 is specifically used to determine the second information that satisfies the first condition as the summary text; wherein the first condition is: the consistency dimension score corresponding to the second information is greater than or equal to the second threshold, the illusion dimension score is less than or equal to the third threshold, and the simplicity dimension score is greater than or equal to the fourth threshold.
[0244] In one possible implementation, the processing module 93 is further configured to: use the summary text and the truncated text corresponding to the summary text as training samples for the notification message summary model; input the training samples into the initial model; perform text summarization on the truncated text in the training samples to obtain candidate summary texts corresponding to the truncated texts; calculate the loss value between the candidate summary texts and the summary texts through the initial model; and train the initial model based on the loss value to obtain the notification message summary model.
[0245] In one possible implementation, the processing module 93 is further configured to receive the first notification message and, based on the message content of the first notification message, display a summary text of the notification message using a notification message summary model.
[0246] The training sample generation device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0247] The training sample generation device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0248] The training sample generation apparatus provided in this application embodiment can implement all the processes implemented in the above method embodiments, and will not be described again here to avoid repetition.
[0249] Optionally, such as Figure 14 As shown, this application embodiment also provides an electronic device 90, including a processor 91 and a memory 92. The memory 92 stores a program or instructions that can run on the processor 91. When the program or instructions are executed by the processor 91, they implement the various steps of the above-described training sample generation method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0250] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0251] Figure 15 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0252] The electronic device 100 includes, but is not limited to, components such as: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, and processor 110.
[0253] Those skilled in the art will understand that the electronic device 100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 15 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0254] The processor 110 is configured to generate second information corresponding to each training data point based on the truncated text and first information corresponding to each training data point; the information dimensions corresponding to the first information include at least one: subject dimension, event dimension, time dimension, and conclusion dimension, and the first information includes information of at least one information dimension corresponding to the truncated text; the second information is a summary of the truncated text; based on the first score corresponding to the second information of each training data point, a summary text is determined from the second information corresponding to each training data point; the scoring dimensions of the first score include consistency dimension, illusion dimension, and conciseness dimension; the summary text and the truncated text corresponding to the summary text are used as training samples for the notification message summary model.
[0255] In the electronic device provided in this application embodiment, a four-layer comparison sample is constructed, consisting of source text, truncated text, core content, and summary text, combined with verification in terms of illusion, conciseness, and consistency. This allows the model to learn the complete semantic information of the original text through the truncated text, thereby summarizing the notification message based on the complete semantic information. In this way, the accuracy of the electronic device in outputting notification summary information based on the truncated message in the notification summary scenario is improved.
[0256] In some embodiments of this application, the processor 110 is further configured to, before generating the second information corresponding to each training data based on the truncated text and the first information corresponding to each training data, split each training data into M sub-texts based on the segmentation characters contained in each training data in the text training dataset; each training data corresponds to at least two sub-texts, the number of characters in each of the M sub-texts is greater than a first threshold, and M is a positive integer greater than 1; and truncate each sub-text based on the number of characters in each sub-text to obtain the truncated text corresponding to each training data.
[0257] In some embodiments of this application, the processor 110 is specifically configured to, when the number of characters in the first sub-text is within a first range, use the first sub-text as truncated data corresponding to the first training data; the first sub-text is any one of M sub-texts; the first training data is the training data corresponding to the first sub-text; or, when the number of characters in the first sub-text is greater than the maximum value of the first range, truncate the first sub-text according to at least one truncation ratio to obtain at least one candidate training text, and obtain the truncated text corresponding to the first training data based on the at least one candidate training text, so as to obtain the truncated text corresponding to each training data.
[0258] In some embodiments of this application, the processor 110 is specifically configured to, when the number of characters in the first candidate training text is greater than the maximum value of the first quantity range, truncate the first candidate training text according to the number of characters corresponding to the maximum value to obtain the truncated text corresponding to the first training data; the first candidate training text is any one of at least one candidate training text; or, when the number of characters in the first candidate training text is within the first quantity range, use the first candidate training text as the truncated text corresponding to the first training data.
[0259] In some embodiments of this application, the processor 110 is further configured to: obtain third information corresponding to each training data before generating second information corresponding to each training data based on the truncated text and first information corresponding to each training data; the information dimension corresponding to the third information includes at least one of the following: subject dimension, event dimension, time dimension, and conclusion dimension; perform text verification on the third information corresponding to each training data to obtain verification information corresponding to each training data; a verification information is used to indicate the consistency of text content between a third information and a training data corresponding to a third information; and filter the third information corresponding to each training data based on the verification information and the information dimension of the third information corresponding to each training data to obtain the first information corresponding to each training data.
[0260] In some embodiments of this application, the processor 110 is specifically configured to discard the third information corresponding to the first training data when the first verification information corresponding to the first training data indicates that the text content between the first training data and the corresponding third information is unrelated, and the text content corresponding to any two information dimensions of the third information corresponding to the first training data is empty; wherein, the first training data is any training data in the text training dataset.
[0261] In some embodiments of this application, the processor 110 is further configured to input the second information of each training data into a dimension scoring model before determining the summary text from the second information corresponding to each training data based on the first score corresponding to the second information of each training data, and to perform dimension scoring on the second information of each training data by means of the regular expression corresponding to each dimension in the dimension scoring model, so as to obtain the first score corresponding to each training data.
[0262] In some embodiments of this application, the processor 110 is specifically used to determine the second information that satisfies the first condition as the summary text; wherein the first condition is: the consistency dimension score corresponding to the second information is greater than or equal to the second threshold, the illusion dimension score is less than or equal to the third threshold, and the simplicity dimension score is greater than or equal to the fourth threshold.
[0263] In some embodiments of this application, the processor 110 is further configured to: use the summary text and the truncated text corresponding to the summary text as training samples for the notification message summary model; input the training samples into the initial model; perform text summarization on the truncated text in the training samples to obtain candidate summary texts corresponding to the truncated texts; calculate the loss value between the candidate summary texts and the summary texts through the initial model; and train the initial model based on the loss value to obtain the notification message summary model.
[0264] In some embodiments of this application, the processor 110 is further configured to receive a first notification message; and, based on the message content of the first notification message, display a summary text of the notification message using a notification message summary model.
[0265] The electronic device provided in this application embodiment can implement the various processes implemented in the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0266] For details on the beneficial effects of the various implementation methods in this embodiment, please refer to the beneficial effects of the corresponding implementation methods in the above method embodiments. To avoid repetition, these will not be repeated here.
[0267] It should be understood that, in this embodiment, the input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0268] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 109 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0269] Processor 110 may include one or more processing units; optionally, processor 110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 110.
[0270] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0271] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0272] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0273] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0274] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here.
[0275] It should be noted that, in this document, 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 limitations, 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 that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0276] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0277] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for generating training samples, characterized in that, The method includes: Based on the truncated text and first information corresponding to each training data, second information corresponding to each training data is generated; the information dimension corresponding to the first information includes at least one of the following: subject dimension, event dimension, time dimension, and conclusion dimension; the second information is the summary information of the truncated text, and the first information includes information of at least one information dimension corresponding to the truncated text; Based on the first score corresponding to the second information of each training data, a summary text is determined from the second information corresponding to each training data; the scoring dimensions of the first score include consistency dimension, illusion dimension and conciseness dimension; The summary text and its corresponding truncated text are used as training samples for the notification message summary model.
2. The method according to claim 1, characterized in that, Before generating the second information corresponding to each training data based on the truncated text and the first information corresponding to each training data, the method further includes: Based on the segmentation characters contained in each training data in the text training dataset, each training data is split into M sub-texts; each training data corresponds to at least two sub-texts, and the number of characters in each of the M sub-texts is greater than a first threshold, where M is a positive integer greater than 1. Based on the number of characters in each subtext, each subtext is truncated to obtain the truncated text corresponding to each training data.
3. The method according to claim 2, characterized in that, The step of truncating each subtext based on the number of characters in each subtext to obtain the truncated text corresponding to each training data includes: If the number of characters in the first sub-text is within a first range, the first sub-text is used as the truncated data corresponding to the first training data; the first sub-text is any one of the M sub-texts; the first training data is the training data corresponding to the first sub-text. Alternatively, if the number of characters in the first sub-text is greater than the maximum value of the first number range, the first sub-text is truncated according to at least one truncation ratio to obtain at least one candidate training text, and based on the at least one candidate training text, the truncated text corresponding to the first training data is obtained, so as to obtain the truncated text corresponding to each training data.
4. The method according to claim 3, characterized in that, The step of obtaining the truncated text corresponding to the first training data based on the at least one candidate training text includes: If the number of characters in the first candidate training text is greater than the maximum value of the first number range, the first candidate training text is truncated according to the number of characters corresponding to the maximum value to obtain the truncated text corresponding to the first training data; the first candidate training text is any one of the at least one candidate training text. Alternatively, if the number of characters in the first candidate training text is within the first number range, the first candidate training text may be used as the truncated text corresponding to the first training data.
5. The method according to claim 1, characterized in that, Before generating the second information corresponding to each training data based on the truncated text and the first information corresponding to each training data, the method further includes: Obtain the third information corresponding to each training data point. The information dimensions corresponding to the third information include at least one of the following: subject dimension, event dimension, time dimension, and conclusion dimension. Text verification is performed on the third information corresponding to each training data to obtain the verification information corresponding to each training data; a verification information is used to indicate the consistency of the text content between a third information and the training data corresponding to the third information. Based on the verification information and the information dimension of the third information corresponding to each training data, the third information corresponding to each training data is filtered to obtain the first information corresponding to each training data.
6. The method according to claim 5, characterized in that, The filtering of the third information corresponding to each training data point, based on the information dimensions of the verification information and the third information corresponding to each training data point, includes: If the first verification information corresponding to the first training data indicates that the text content between the first training data and the corresponding third information is unrelated, and the text content corresponding to any two information dimensions of the third information corresponding to the first training data is empty, then the third information corresponding to the first training data is discarded. Wherein, the first training data is any one of the training data in the text training dataset.
7. The method according to claim 1, characterized in that, Before determining the summary text from the second information corresponding to each training data point based on the first score corresponding to the second information of each training data point, the method further includes: The second information of each training data is input into the dimension scoring model. The second information of each training data is scored by the regular expression corresponding to each dimension in the dimension scoring model to obtain the first score corresponding to each training data.
8. The method according to claim 1, characterized in that, The first score corresponding to the second information of each training data, and the determination of the summary text from the second information corresponding to each training data, include: The second piece of information that meets the first condition is identified as the summary text; The first condition is that the consistency dimension score corresponding to the second information is greater than or equal to the second threshold, the illusion dimension score is less than or equal to the third threshold, and the simplicity dimension score is greater than or equal to the fourth threshold.
9. The method according to claim 1, characterized in that, After using the summary text and its corresponding truncated text as training samples for the notification message summary model, the method further includes: The training samples are input into the initial model, and the truncated text in the training samples is summarized to obtain the candidate summary text corresponding to the truncated text. Using the initial model, the loss value between the candidate summary text and the summary text is calculated; Based on the loss value, the initial model is trained to obtain the notification message summary model.
10. The method according to claim 9, characterized in that, The method further includes: Receive the first notification message; Based on the message content of the first notification message, the summary text of the notification message is displayed using the notification message summary model.
11. A training sample generation device, characterized in that, The training sample generation device includes: The generation module is used to generate second information corresponding to each training data based on the truncated text and first information corresponding to each training data; the information dimension corresponding to the first information includes at least one of the following: subject dimension, event dimension, time dimension, and conclusion dimension; the second information is the summary information of the truncated text, and the first information includes information of at least one information dimension corresponding to the truncated text; The determination module is used to determine the summary text from the second information corresponding to each training data based on the first score corresponding to the second information of each training data; the scoring dimensions of the first score include consistency dimension, illusion dimension and conciseness dimension; The processing module is used to use the summary text and the truncated text corresponding to the summary text as training samples for the notification message summary model.
12. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the training sample generation method as described in any one of claims 1 to 10.