Text rewriting instruction optimization method and device, equipment and storage medium
By iteratively optimizing the initial text rewriting instructions and generating target text rewriting instructions, it solves the problems of high training and deployment costs of ultra-large-scale models and low adaptability of text rewriting instructions, and improves the efficiency and accuracy of text rewriting.
Patent Information
- Application Number
- CN202310364655.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, when a very large-scale model is used for text rewriting, the training, storage and deployment costs are high, and the compatibility between manually written text rewriting instructions and the model is low, affecting efficiency and accuracy.
By iteratively optimizing the initial text rewriting instructions, the target text rewriting instructions are generated, and the target model that supports the text rewriting function is used to transform and evaluate the instruction content, and select qualified candidate instructions as output, thereby reducing the cost of model parameter adjustment.
It improves the compatibility between text rewriting instructions and models, improves the efficiency and accuracy of text rewriting, and reduces the difficulty and cost of model adjustment.
Smart Images

Figure CN118734797A_ABST
Abstract
Description
Background Art
[0002] Rich and vivid titles, main text and other text content can better attract the target audience to browse multimedia information, further increasing the playback volume and click-through rate of multimedia information.
[0003] At present, the text content of multimedia information, such as titles and texts, is manually written and obtained through repeated revisions and corrections, which has high writing costs and low efficiency. Therefore, in order to reduce writing costs and improve efficiency, a super-large-scale model based on instruction-based target generation is proposed; that is, text rewriting is realized based on the super-large-scale model. However, in the process of realizing text rewriting based on the super-large-scale model, the following problems still exist:
[0004] 1. The training cost, storage cost, and service deployment cost of ultra-large-scale models are relatively high. If targeted fine-tuning is performed based on text rewriting tasks, it will be necessary to separately train, store, and deploy services for ultra-large-scale models based on text rewriting tasks. At this time, it is necessary to adjust hundreds of billions of model parameters in the ultra-large-scale model, which is costly.
[0005] 2. The super-large-scale model has good task instruction generalization ability, so the super-large-scale model can adapt to text rewriting instructions. However, the current text rewriting instructions are all manually written, and the super-large-scale model does not understand the manually written text rewriting instructions accurately, resulting in low adaptability between the text rewriting instructions and the model, further affecting the efficiency and accuracy of text rewriting.
[0006] Therefore, how to improve the adaptability of text rewriting instructions and models while reducing costs, and how to improve the efficiency and accuracy of text rewriting is a technical problem that needs to be solved at present. Summary of the invention
[0007] The embodiments of the present application provide a text rewriting instruction optimization method, device, equipment and storage medium, which are used to improve the adaptability of text rewriting instructions to ultra-large-scale models and improve the efficiency and accuracy of text rewriting on the basis of reducing costs.
[0008] In a first aspect, an embodiment of the present application provides a text rewriting instruction optimization method, the method comprising:
[0009] Get the initial text rewrite instruction;
[0010] The initial text rewriting instruction is subjected to at least one iterative optimization process to obtain a target text rewriting instruction; wherein, in one iterative optimization process, the following operations are performed:
[0011] Performing instruction content transformation processing on the initial text rewriting instruction to obtain at least one candidate text rewriting instruction;
[0012] For at least one candidate text rewriting instruction, the following operations are performed respectively: a first rewriting text is generated for a candidate text rewriting instruction through a target model that supports a text rewriting function, and based on the first rewriting text, a candidate text rewriting instruction is evaluated to obtain an instruction evaluation value;
[0013] Among at least one candidate text rewriting instruction, a candidate text rewriting instruction whose instruction evaluation value meets the initial screening condition is screened out, and when the screened candidate text rewriting instruction meets the iteration termination condition, the candidate text rewriting instruction is output as the target text rewriting instruction.
[0014] In a second aspect, an embodiment of the present application provides a text rewriting instruction optimization device, the device comprising:
[0015] An acquisition unit, used for acquiring an initial text rewriting instruction;
[0016] The optimization processing unit is used to perform at least one iterative optimization process on the initial text rewriting instruction to obtain the target text rewriting instruction; wherein, in one iterative optimization process, the following operations are performed:
[0017] Performing instruction content transformation processing on the initial text rewriting instruction to obtain at least one candidate text rewriting instruction;
[0018] For at least one candidate text rewriting instruction, the following operations are performed respectively: a first rewriting text is generated for a candidate text rewriting instruction through a target model that supports a text rewriting function, and based on the first rewriting text, a candidate text rewriting instruction is evaluated to obtain an instruction evaluation value;
[0019] Among at least one candidate text rewriting instruction, a candidate text rewriting instruction whose instruction evaluation value meets the initial screening condition is screened out, and when the screened candidate text rewriting instruction meets the iteration termination condition, the candidate text rewriting instruction is output as the target text rewriting instruction.
[0020] In a possible implementation manner, the optimization processing unit is specifically used to:
[0021] Acquire semantic features of the initial text rewriting instruction, and process the semantic features into blocks to obtain at least one instruction block;
[0022] Performing instruction block adjustment processing on a target instruction block in at least one instruction block to obtain at least one instruction block sequence; wherein the instruction block adjustment processing includes: deleting the target instruction block, inserting a new instruction block before the target instruction block, replacing the target instruction block, and changing the position of the target instruction block;
[0023] A candidate text rewriting instruction associated with each of at least one instruction block sequence is determined respectively.
[0024] In a possible implementation manner, the optimization processing unit is specifically used to:
[0025] Based on at least one target rewritten text in the evaluation set, determine a text evaluation value associated with the first rewritten text, and determine the text attractiveness associated with the first rewritten text through a trained attractiveness evaluation model; wherein the text attractiveness represents the browsing popularity of the multimedia information associated with the first rewritten text;
[0026] The text evaluation value and the text attractiveness are weighted, and the obtained weighted result is used as the instruction evaluation value of a candidate text rewriting instruction.
[0027] In a possible implementation manner, the optimization processing unit is specifically used to:
[0028] Determine a brevity penalty factor based on a configured text reference length and an initial text length of the first rewritten text;
[0029] For at least one target rewritten text in the evaluation set, the following operations are respectively performed: determining a first number of identical segmented words contained in a first rewritten text and a target rewritten text, and determining a matching degree between the first rewritten text and a target text based on the first number and a second number of all segmented words contained in the first rewritten text;
[0030] A text evaluation value of the first rewritten text association is determined based on the at least one matching degree and a brevity penalty factor.
[0031] In a possible implementation, the attractiveness evaluation model is obtained by:
[0032] According to the training samples in the training sample set, the attractiveness evaluation model to be trained is subjected to cyclic iterative training to obtain a trained attractiveness evaluation model; in one cyclic iteration, the following operations are performed:
[0033] Selecting training samples from a training sample set; wherein the training samples at least include: the annotation attractiveness of text information associated with historical multimedia information;
[0034] Input the training samples into the attractiveness evaluation model to be trained to predict the predicted attractiveness of historical multimedia information;
[0035] Based on the labeled attractiveness and predicted attractiveness, a loss function is constructed to adjust the parameters of the attractiveness evaluation model to be trained.
[0036] In a possible implementation, the annotation attractiveness is determined in the following manner:
[0037] Determining the browsing completion degree of the historical multimedia information based on the actual browsing volume and the reference browsing volume of the historical multimedia information; wherein the reference browsing volume is determined based on the total number of browsing times and the fixed browsing volume configured for the historical multimedia information;
[0038] Use browsing completion as the annotation attraction.
[0039] In a possible implementation manner, the optimization processing unit is specifically used to:
[0040] Inputting a candidate text rewriting instruction and a first original text into a target model;
[0041] In the target model, do the following:
[0042] Identify content information included in a candidate text rewriting instruction; wherein the content information at least includes: rewriting style and keywords;
[0043] Based on the keyword, in the first original text, a target word segmentation matching the keyword is obtained;
[0044] A text rewriting operation is performed on the first original text according to the rewriting style to obtain a first rewritten text; wherein the first rewritten text includes the target word segmentation.
[0045] In a possible implementation, the iteration termination condition includes at least one of the following:
[0046] The instruction evaluation value reaches a first threshold;
[0047] The gain value is lower than the second threshold value, and the gain value is determined based on the instruction evaluation values of two adjacent screened candidate text rewriting instructions.
[0048] In a possible implementation manner, the optimization processing unit is further configured to:
[0049] After performing at least one iterative optimization process on the initial text rewriting instruction and obtaining the target text rewriting instruction, a text rewriting operation is performed on the second original text based on the target text rewriting instruction to obtain a second rewritten text.
[0050] In one possible implementation, the target model is obtained as follows:
[0051] Using general text data, pre-train an initial model supporting a text rewriting function to obtain a pre-trained model;
[0052] On various processing tasks of multimedia information, the pre-trained models are jointly trained based on the associated task instructions to obtain the target model.
[0053] In a third aspect, an embodiment of the present application provides a computing device, comprising: a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the steps of the text rewriting instruction optimization method provided in the embodiment of the present application.
[0054] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the text rewriting instruction optimization method provided in the embodiment of the present application are implemented.
[0055] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when the processor of a computing device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the computing device executes the steps of the text rewriting instruction optimization method provided in the embodiment of the present application.
[0056] The beneficial effects of this application are as follows:
[0057] The embodiments of the present application provide a method, device, equipment and storage medium for optimizing text rewriting instructions, which relate to artificial intelligence, and in particular to the field of data processing technology. In order to avoid the problem that the cost and difficulty of model adjustment increase simultaneously when the adaptive ability and adaptability of the target model to the artificially constructed text rewriting instructions are increased and the adaptability is enhanced due to adjusting the parameters of the target model, an implementation method for optimizing text rewriting instructions is proposed. In the present application, the initial text rewriting instruction is subjected to at least one iterative optimization process to obtain a target text rewriting instruction; in one iterative optimization process, the following are executed: first, the instruction content is transformed for the initial text rewriting instruction to obtain at least one candidate text rewriting instruction; then, for at least one candidate text rewriting instruction, the following are respectively executed: a first rewriting text is generated for a candidate text rewriting instruction through a target model that supports the text rewriting function, and based on the first rewriting text, a candidate text rewriting instruction is evaluated to obtain an instruction evaluation value; finally, from at least one candidate text rewriting instruction, the candidate text rewriting instruction whose instruction evaluation value meets the initial screening condition is screened out, and when the screened out candidate text rewriting instruction meets the iteration termination condition, the candidate text rewriting instruction is output as the target text rewriting instruction. Each candidate rewriting instruction obtained is evaluated, and based on the instruction evaluation value, it is determined whether to perform the next round of iterative optimization processing. After multiple rounds of instruction iterative optimization, the quality of the text rewriting instructions is improved, and can be better understood by the target model that supports the text rewriting function, thereby improving the accuracy and efficiency of text rewriting through the target model. In this process, only the text rewriting instructions are iteratively optimized, and there is no need to adjust the parameters of the target model, which can stimulate the target model's adaptive ability and adaptability to the text rewriting instructions, thereby reducing the cost and difficulty of adjusting the model for the text rewriting task.
[0058] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0060] Figure 1 A schematic diagram of text conversion;
[0061] Figure 2 A schematic diagram rewritten for a title;
[0062] Figure 3 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0063] Figure 4 A flow chart of a text rewriting instruction optimization method provided in an embodiment of the present application;
[0064] Figure 5 A flow chart of a method for performing instruction content transformation processing on an initial text rewriting instruction provided in an embodiment of the present application;
[0065] Figure 6 A schematic diagram of a first instruction block adjustment process provided in an embodiment of the present application;
[0066] Figure 7 A schematic diagram of a second instruction block adjustment process provided in an embodiment of the present application;
[0067] Figure 8 A schematic diagram of a third instruction block adjustment process provided in an embodiment of the present application;
[0068] Fig. 9 A schematic diagram of a fourth instruction block adjustment process provided in an embodiment of the present application;
[0069] Fig.10 A schematic diagram of obtaining a candidate text rewriting instruction provided in an embodiment of the present application;
[0070] Fig.11 A schematic diagram of evaluating a candidate text rewriting instruction provided in an embodiment of the present application;
[0071] Fig.12 A schematic diagram of obtaining a first rewritten text provided in an embodiment of the present application;
[0072] Fig.13 A schematic diagram of another method of obtaining a first rewritten text provided in an embodiment of the present application;
[0073] Fig.14 A schematic diagram of an attractiveness evaluation model provided in an embodiment of the present application;
[0074] Fig.15 A flow chart of a training method for an attractiveness evaluation model provided in an embodiment of the present application;
[0075] Fig.16 A schematic diagram of a specific implementation method of text rewriting instruction optimization provided in an embodiment of the present application;
[0076] Fig.17 A flowchart of a text rewriting method provided in an embodiment of the present application;
[0077] Fig.18 A structural diagram of a text rewriting instruction optimization device provided in an embodiment of the present application;
[0078] Fig.19 A structural diagram of a computing device provided in an embodiment of the present application;
[0079] Fig. 20 A structural diagram of another computing device provided for an embodiment of the present application. DETAILED DESCRIPTION
[0080] In order to make the purpose, technical solution and beneficial effects of this application clearer, the technical solution in the embodiment of this application will be clearly and completely described below in conjunction with the drawings in the embodiment of this application. Obviously, the described embodiment is only a part of the embodiment of this application, not all the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0081] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
[0082] Multimedia information: refers to media information in the form of text, images, videos, sounds, animations, etc.; for example, videos, short videos, graphic content, etc.
[0083] Text rewriting instruction: a command used to instruct a device to perform a text rewriting operation; in an embodiment of the present application, the text rewriting instruction may be a multimedia information title rewriting instruction or a text content rewriting instruction.
[0084] Target model: It is a large-scale model that supports tasks involving instructions, such as text rewriting, multimedia information type recognition, multimedia information title recognition, multimedia information sentiment polarity recognition, summary generation, and comment generation. That is, the task requirements are input into the large-scale model in the form of instructions, and the large-scale model will generate task-related targets according to the corresponding instructions. Figure 1 As shown in the figure, the target model is used to convert text content into an article. At this time, the input task instruction is: convert the following text content into an article, including the article title and three paragraphs, and the output is: an article containing a title and three paragraphs; Figure 2 As shown, the target model can also be used to rewrite the title. At this time, the input task instruction is: rewrite the following title into the "How-To" style. The title is: How to make scrambled eggs with tomatoes, and the output is: How to make scrambled eggs with tomatoes.
[0085] Ultra-large-scale model: It is a model that is not fine-tuned for a specific task, but has good in-context learning capabilities and good task instruction generalization capabilities. That is, when the parameters of the ultra-large-scale model are not adjusted based on the task instructions of task A, the ultra-large-scale model can also generate associated targets for the task instructions of task A.
[0086] Bilingual Evaluation Understudy (BLEU): It is an evaluation indicator in machine translation tasks, which measures the quality of translation based on precision. In the embodiment of the present application, it is used to evaluate the quality of the rewritten text associated with the candidate text rewriting instruction. The evaluation value of BLEU ranges from 0 to 1. The closer the evaluation value is to 1, the higher the quality of the rewritten text.
[0087] Brevity Penalty (BP): also known as "too short multiplication", is used to prevent the output results from tending to be short sentences.
[0088] The following is a brief introduction to the design concept of the embodiments of the present application.
[0089] Rich and vivid titles, main text and other text content can better attract the target audience to browse multimedia information, further increasing the playback volume and click-through rate of multimedia information.
[0090] At present, the text content of multimedia information, such as titles and texts, is manually written and obtained through repeated revisions and corrections, which has high writing costs and low efficiency. Therefore, in order to reduce writing costs and improve efficiency, a super-large-scale model based on instruction-based target generation is proposed; that is, text rewriting is achieved based on a super-large-scale model. For example, converting text obtained from other channels into an article can improve the efficiency of operators such as push services in converting hot events into the site; for example, converting a general-style title into a "How-To" style, the "How-To" style can increase the video playback rate and reduce the writing costs of operator annotation personnel.
[0091] However, in the process of implementing text rewriting based on ultra-large-scale models, there are still the following problems:
[0092] 1. The training cost, storage cost and service deployment cost of ultra-large-scale models are relatively high. If targeted fine-tuning is performed based on text rewriting tasks, it will be necessary to train, store and deploy ultra-large-scale models separately based on text rewriting tasks. At this time, it is necessary to adjust the model parameters of hundreds of billions in the ultra-large-scale model, which is costly. In addition, although the internal ultra-large-scale model capabilities are open to internal use, as an important capability asset, the parameters of the ultra-large-scale model will not be open to all business-related personnel. Similar external ultra-large-scale model capabilities generally do not directly provide model parameters, but usually provide capabilities in the form of application program interfaces (APIs), resulting in the inability to fine-tune large models for text rewriting tasks.
[0093] 2. The super-large-scale model has been trained on multiple tasks and has good task instruction generalization ability, that is, it constructs corresponding task instructions for new tasks so that the super-large-scale model can adapt to the task instructions of new tasks to complete the new tasks, that is, it constructs text rewriting instructions for text rewriting tasks, and the super-large-scale model can adapt to the text rewriting instructions to complete the text rewriting. However, the current text rewriting instructions are all manually written. Although the manually written task instructions are easy for humans to understand, they are not necessarily accurate for the model representation and understanding, resulting in the failure to fully utilize the capabilities of the super-large-scale model, which in turn leads to the text rewritten by the super-large-scale model being inaccurate and requiring more manual intervention; that is, the super-large-scale model does not understand the manually written text rewriting instructions accurately, resulting in low adaptability of the text rewriting instructions to the model, further affecting the efficiency and accuracy of text rewriting.
[0094] Therefore, how to improve the adaptability of text rewriting instructions and models while reducing costs, and how to improve the efficiency and accuracy of text rewriting is a technical problem that needs to be solved at present.
[0095] In view of this, the embodiments of the present application provide a text rewriting instruction optimization method, device, equipment and storage medium, which are used to improve the adaptability of text rewriting instructions and models and improve the efficiency and accuracy of text rewriting on the basis of reducing costs.
[0096] In the present application, by automatically optimizing the initial text rewriting instructions based on a trained target model that supports the text rewriting function, target text rewriting instructions that are adapted to the target model are obtained, thereby stimulating the target model's ability to adapt to the target text rewriting instructions, reducing the model's adjustment cost and difficulty for text rewriting tasks, and further improving the accuracy and efficiency of text rewriting through the target model.
[0097] In one possible implementation, the obtained initial text rewriting instruction is subjected to at least one iterative optimization process to obtain a target text rewriting instruction; in one iterative optimization process, the following are performed: first, the instruction content change process is performed on the initial text rewriting instruction to obtain at least one candidate text rewriting instruction; then, for at least one candidate text rewriting instruction, the following are performed respectively: a first rewriting text is generated for a candidate text rewriting instruction through a target model that supports the text rewriting function, and a candidate text rewriting instruction is evaluated based on the first rewriting text to obtain an instruction evaluation value; finally, from at least one candidate text rewriting instruction, the candidate text rewriting instruction whose instruction evaluation value meets the initial screening condition is screened out, and when the screened out candidate text rewriting instruction meets the iteration termination condition, the candidate text rewriting instruction is output as the target text rewriting instruction.
[0098] In the present application, the initial text rewriting instruction is transformed to obtain multiple candidate text rewriting instructions, and each candidate rewriting instruction is evaluated to determine whether to perform the next round of iterative optimization processing. In this way, after multiple rounds of instruction iterative optimization, the quality of the text rewriting instruction is improved, and it can be better understood by the target model that supports the text rewriting function, thereby improving the accuracy and efficiency of text rewriting through the target model; and in this process, only the text rewriting instruction is iteratively optimized, and there is no need to adjust the parameters of the target model, which can stimulate the target model's adaptive ability to the text rewriting instruction and adaptability, thereby reducing the adjustment cost and difficulty of the model for the text rewriting task.
[0099] In the embodiments of the present application, the target model supporting the text rewriting function, as well as the attractiveness evaluation model and other parts, involve artificial intelligence (AI) and machine learning technologies, and are designed based on speech technology, natural language processing technology and machine learning (ML) in artificial intelligence.
[0100] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence.
[0101] Artificial intelligence is the study of the design principles and implementation methods of various intelligent machines, so that the machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology mainly includes computer vision technology, natural language processing technology, and machine learning / deep learning. With the research and progress of artificial intelligence technology, artificial intelligence has been studied and applied in many fields, such as common smart homes, smart customer service, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, robots, smart medical care, etc. It is believed that with the development of technology, artificial intelligence will be applied in more fields and play an increasingly important role.
[0102] Machine learning is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Compared with data mining, which seeks mutual characteristics between big data, machine learning focuses more on algorithm design, allowing computers to automatically "learn" rules from data and use the rules to predict unknown data.
[0103] Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning and other technologies. Reinforcement learning (RL), also known as reinforcement learning, evaluation learning or enhanced learning, is one of the paradigms and methodologies of machine learning. It is used to describe and solve the problem of how an agent can maximize its rewards or achieve specific goals through learning strategies during its interaction with the environment.
[0104] After introducing the design concept of the embodiment of the present application, the application scenario set in the present application is briefly described below. It should be noted that the following scenario is only used to illustrate the embodiment of the present application and is not limited. In the specific implementation, the technical solution provided by the embodiment of the present application can be flexibly applied according to actual needs.
[0105] See also Figure 3 , Figure 3 Schematic diagram of an application scenario of an embodiment of the present application. The application scenario includes a terminal device 310 and a server 320, and the terminal device 310 and the server 320 can communicate with each other through a communication network.
[0106] In a possible implementation, the communication network may be a wired network or a wireless network. Therefore, the terminal device 310 and the server 320 may be directly or indirectly connected via a wired or wireless communication mode. For example, the terminal device 310 may be indirectly connected to the server 320 via a wireless access point, or the terminal device 310 may be directly connected to the server 320 via the Internet, and this application does not limit this.
[0107] In the embodiment of the present application, the terminal device 310 includes but is not limited to mobile phones, tablet computers, laptop computers, desktop computers, e-book readers, intelligent voice interaction devices, smart home appliances, car terminals and other devices; various clients can be installed on the terminal device, and the client can be an online multimedia platform that supports multimedia information preview, multimedia information playback and other functions, an application (such as a browser, game software, etc.), or a web page, a small program, etc.; for example, multimedia information can be viewed online through the client.
[0108] The server 320 is a background server corresponding to the client installed in the terminal device 310. The server 320 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0109] It should be noted that the text rewriting instruction optimization method in the embodiment of the present application can be executed by a computing device, which can be a server 320 or a terminal device 310, that is, the method can be executed by the server 320 or the terminal device 310 alone, or can be executed jointly by the server 320 and the terminal device 310.
[0110] When the terminal device 310 executes alone, for example, the terminal device 310 obtains an initial text rewriting instruction; and performs at least one iterative optimization process on the initial text rewriting instruction to obtain a target text rewriting instruction.
[0111] When the server 320 and the terminal device 310 execute together, for example, the terminal device 310 may obtain the initial text rewriting instruction and transmit the initial text rewriting instruction to the server 320, and the server 320 may perform at least one iterative optimization process on the initial text rewriting instruction to obtain the target text rewriting instruction.
[0112] When the server 320 executes alone, for example, the server 320 obtains an initial text rewriting instruction; and performs at least one iterative optimization process on the initial text rewriting instruction to obtain a target text rewriting instruction.
[0113] In the text rewriting instruction optimization process, a target model that supports the text rewriting function is involved. Exemplarily, a target model that supports the text rewriting function is provided to generate a first rewritten text for a candidate text rewriting instruction. In order to realize the generation of rewritten text for a text rewriting instruction through a target model, the embodiment of the present application also involves a method for obtaining the target model, and the method for obtaining the target model can be executed by a computing device, which can be a server 320 or a terminal device 310, that is, the method can be executed by the server 320 or the terminal device 310 alone, or can be executed by the server 320 and the terminal device 310 together.
[0114] It should be noted that the target model supporting the text rewriting function involved in the embodiment of the present application is not only used for text rewriting. The target model has good generalization ability and is also of great significance in the fields of multimedia information title recognition, multimedia information type recognition, multimedia information summary generation, comment generation, etc.
[0115] In the text rewriting instruction optimization process, an attractiveness evaluation model is involved. Exemplarily, in the candidate text rewriting instruction evaluation process, the text attractiveness associated with the first rewriting text associated with the candidate text rewriting instruction is determined by the trained attractiveness evaluation model; wherein the text attractiveness represents the browsing popularity of the multimedia information associated with the first rewriting text. In order to ensure the accuracy of the attractiveness evaluation, the embodiment of the present application also involves a training method for the attractiveness evaluation model, and the training method for the attractiveness evaluation model can be executed by a computing device, which can be a server 320 or a terminal device 310, that is, the method can be executed by the server 320 or the terminal device 310 alone, or can be executed by the server 320 and the terminal device 310 together.
[0116] In the embodiments of the present application, Figure 3 The figure is only an example. In fact, the number of terminal devices 310 and servers 320 is not limited, and no specific limitation is made in the embodiment of the present application. In the embodiment of the present application, when there are multiple servers 320, multiple servers 320 can form a blockchain, and the server 320 is a node on the blockchain.
[0117] To further illustrate the technical solution provided by the embodiment of the present application, the following is an example of a server executing alone, and in conjunction with the accompanying drawings, the text rewriting instruction optimization method provided by the present application, and the model training part of the model association involved in the text rewriting instruction optimization process are described in detail. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application.
[0118] See also Figure 4 , Figure 4 A method flow chart of a text rewriting instruction optimization method is provided for an embodiment of the present application, comprising the following steps:
[0119] Step S400, obtaining an initial text rewriting instruction.
[0120] In an embodiment of the present application, the initial text rewriting instruction initially obtained may be manually written and input; it may also be input by other devices or other programs, wherein the other devices or other programs are terminal devices or applications with artificial intelligence functions.
[0121] Exemplarily, when an initial text rewriting instruction is input by a terminal device with artificial intelligence function, the terminal device will first receive a voice instruction for instructing to generate a text rewriting instruction, and then generate an initial text rewriting instruction based on the voice instruction.
[0122] After the initial text rewriting instruction is manually written, there is no need to manually adjust the text rewriting instruction multiple times, but the initial text rewriting instruction is automatically optimized to construct a better text rewriting instruction to improve the text rewriting effect. The process of optimizing the initial text rewriting instruction is detailed in step S401.
[0123] Step S401, performing at least one iterative optimization process on the initial text rewriting instruction to obtain a target text rewriting instruction.
[0124] Since the operations performed in each iterative optimization process are consistent, referring to steps S1 to S3 below, the iterative optimization process of the initial text rewriting instruction is performed as an example to explain in detail.
[0125] Step S1, performing instruction content transformation processing on an initial text rewriting instruction to obtain at least one candidate text rewriting instruction;
[0126] Step S2, for at least one candidate text rewriting instruction, respectively perform the following operations: generate a first rewriting text for a candidate text rewriting instruction through a target model that supports the text rewriting function, and evaluate a candidate text rewriting instruction based on the first rewriting text to obtain an instruction evaluation value;
[0127] Step S3, screening out candidate text rewriting instructions whose instruction evaluation values meet the initial screening conditions from at least one candidate text rewriting instruction, and outputting the candidate text rewriting instructions as target text rewriting instructions when the screened out candidate text rewriting instructions meet the iteration termination conditions.
[0128] For example, the text rewriting instruction is a title rewriting instruction, and the existing title is "How to make scrambled eggs with tomatoes" for example:
[0129] First, obtain the initial title rewriting instruction, which is: modify the title to a "How-To" style with coherent sentences;
[0130] Secondly, the initial title rewriting instruction is processed by instruction content transformation to obtain candidate title rewriting instructions; it is assumed that four candidate title rewriting instructions are obtained, and the four candidate title rewriting instructions are: modify the title to a "How-To" style; modify the title to a "How-To" style with smooth sentences; modify the title to a "How-To" style with beautiful sentences; modify the title to a "How-To" style with smooth sentences and rich modifiers;
[0131] Then, for the candidate title rewriting instruction: modify the title to "How-To" style, determine that the first rewritten text corresponding to the candidate title rewriting instruction is "How to make scrambled eggs with tomatoes"; for the candidate title rewriting instruction: modify the title to "How-To" style, and the sentence is smooth, determine that the first rewritten text corresponding to the title rewriting instruction is "How to make scrambled eggs with tomatoes"; for the candidate title rewriting instruction: modify the title to "How-To" style with beautiful sentences, determine that the first rewritten text corresponding to the title rewriting instruction is "How to make delicious scrambled eggs with tomatoes"; for the candidate title rewriting instruction: modify the title to "How-To" style with smooth sentences and rich modifiers, determine that the first rewritten text corresponding to the title rewriting instruction is "How to make delicious and colorful scrambled eggs with tomatoes";
[0132] Next, the first rewritten texts corresponding to the four candidate title rewriting instructions are evaluated to obtain instruction evaluation values; assuming that the instruction evaluation value of "How to make scrambled eggs with tomatoes" is 80 points, the instruction evaluation value of "How to make scrambled eggs with tomatoes" is 81 points, the instruction evaluation value of "How to make delicious scrambled eggs with tomatoes" is 90 points, and the instruction evaluation value of "How to make delicious and attractive scrambled eggs with tomatoes" is 95 points;
[0133] Finally, based on the instruction evaluation value, the candidate title rewriting instruction with the largest instruction evaluation value is selected from the four candidate title rewriting instructions, namely, “How to make delicious and colorful scrambled eggs with tomatoes”; and when the candidate title rewriting instruction is selected and it is determined that the screened candidate title rewriting instruction meets the iteration termination condition, the screened candidate title rewriting instruction “How to make delicious and colorful scrambled eggs with tomatoes” is used as the target title rewriting instruction, that is, the final output target title rewriting instruction is: “How to make delicious and colorful scrambled eggs with tomatoes”.
[0134] In the present application, the initial text rewriting instructions are iteratively optimized for multiple times, and during the iterative optimization process, the candidate text rewriting instructions are evaluated based on the first rewritten text output by the target model for the candidate text rewriting instructions, and whether to perform iterative optimization processing is determined based on the instruction evaluation result, and after multiple iterative optimization processing, the target text rewriting instructions output when the iteration termination conditions are met are obtained; at this time, the quality of the target text rewriting instructions is improved, which can ensure the accuracy and efficiency of the text rewriting, and the target text rewriting instructions are screened on the basis of the target model, and have good adaptability to the target model. During this process, the parameters of the target model are not adjusted, which reduces the cost; therefore, on the basis of reducing the cost, the adaptability of the text rewriting instructions to the model is improved, and the efficiency and accuracy of the text rewriting are improved.
[0135] The iterative optimization process is described in detail below.
[0136] In the embodiment of the present application, in order to obtain a text rewriting instruction that is better than the initial text rewriting instruction, in step S1, the semantic features of the initial text rewriting instruction are first extracted, and then the semantic features are processed into blocks to obtain at least one instruction block, and then the instruction block is adjusted, and finally at least one candidate text rewriting instruction is determined based on the adjusted instruction block; for example, see Figure 5 , Figure 5 A flow chart of a method for performing instruction content transformation processing on an initial text rewriting instruction provided in an embodiment of the present application includes the following steps:
[0137] Step S11, acquiring semantic features of the initial text rewriting instruction, and performing block processing on the semantic features to obtain at least one instruction block.
[0138] After obtaining the initial text rewriting instruction, the semantic features of the initial text rewriting instruction are extracted, and then the semantic features are processed into blocks to obtain at least one instruction block; wherein the instruction block has a larger granularity than a word block and can better represent the instruction semantics.
[0139] It should be noted that the semantic features of the initial text rewriting instructions are extracted by machine learning; for example, it is implemented by using term frequency-inverse document frequency (TF-IDF), set of words (SoW), bag of words (BoW), etc.
[0140] Step S12, performing instruction block adjustment processing on the target instruction block in at least one instruction block to obtain at least one instruction block sequence; wherein the instruction block adjustment processing includes: deleting the target instruction block, inserting a new instruction block before the target instruction block, replacing the target instruction block, and changing the position of the target instruction block.
[0141] After semantically segmenting the semantic features to obtain at least one instruction block, a target instruction block is randomly selected from the at least one instruction block, and instruction block adjustment is performed on the target instruction block. The instruction block adjustment process is exemplarily described below.
[0142] 1. Delete the target instruction block.
[0143] Exemplarily, instruction blocks at K1 positions are randomly deleted, that is, K1 instruction block deletion operations are performed.
[0144] During an instruction block deletion operation, the following is performed: first, a random number r1 is generated, based on which, the instruction block at position r1% chunk_size is determined, and the instruction block at position r1% chunk_size is used as the target instruction block; then, another random number rr1 is generated, based on which, the probability of the target instruction block being deleted is determined, that is, rr1% is used as the probability of the target instruction block being deleted. If rr1 is greater than the deletion threshold, the target instruction block is deleted, otherwise, the target instruction block is retained. See Figure 6 , Figure 6 A schematic diagram of the first instruction block adjustment process provided in an embodiment of the present application.
[0145] 2. Insert a new instruction block before the target instruction block.
[0146] Exemplarily, a new instruction block is randomly inserted before the instruction block at K2 positions, that is, K2 new instruction block insertion operations are performed.
[0147] During an insertion operation, the following is performed: first, a random number r2 is generated, based on the random number r2, the instruction block at position r2% chunk_size is determined, and the instruction block at position r2% chunk_size is used as the target instruction block; then, a random number rr2 is generated again, based on the random number rr2, the probability of inserting a new instruction block before the target instruction block is determined, that is, rr2% is used as the probability of inserting a new instruction block before the target instruction block. If rr2 is greater than the insertion threshold, based on the target instruction block and an instruction block after the target instruction block, a new instruction block that meets the insertion condition is selected from the Trigram library, and the new instruction block is inserted before the target instruction block; wherein, the insertion condition is that the ternary probability of [target instruction block], [new instruction block], and [an instruction block after the target instruction block] meets the first threshold. See Figure 7 , Figure 7 A schematic diagram of the second instruction block adjustment process provided in an embodiment of the present application.
[0148] 3. Replace the target instruction block.
[0149] Exemplarily, the instruction blocks at K3 positions are randomly replaced, that is, K3 instruction block replacement operations are performed.
[0150] During an instruction block replacement operation, the following is performed: first, a random number r3 is generated, based on which, the instruction block at position r3% chunk_size is determined, and the instruction block at position r3% chunk_size is used as the target instruction block; then, another random number rr3 is generated, based on which, the probability of the target instruction block being replaced is determined, that is, rr3% is used as the probability of the target instruction block being replaced. If rr3 is greater than the replacement threshold, a replacement instruction block that meets the replacement condition is selected from the Trigram library, and the target instruction block is replaced with the replacement instruction block; wherein, the replacement condition is that the ternary probability of [an instruction block before the target instruction block], [the replacement instruction block], and [an instruction block after the target instruction block] meets the second threshold. See Figure 8 , Figure 8 A schematic diagram of the third instruction block adjustment process provided in an embodiment of the present application.
[0151] 4. Change the position of the target instruction block.
[0152] Exemplarily, the positions of instruction blocks at K4 positions are randomly changed, that is, K4 instruction block position change operations are performed.
[0153] During an instruction block position change operation, the following is performed: first, a random number r4 is generated, based on which, the instruction block at position r4% chunk_size is determined, and the instruction block at position r4% chunk_size is used as the target instruction block; then, another random number rr4 is generated, based on which, the probability of position change for the target instruction block is determined, that is, rr4% is used as the probability of position change for the target instruction block. If rr4 is greater than the position change threshold, the target instruction block is position-changed with the instruction block at the next position. See Fig. 9 , Fig. 9 A schematic diagram of the fourth instruction block adjustment process provided in an embodiment of the present application.
[0154] It should be noted that if the target instruction block has been deleted in the current round or the previous round, the instruction block will not be reinserted as a new instruction block. For example, if instruction block B is deleted during the first round of iterative optimization, instruction block B will not be included in the reinserted instruction blocks during the second and subsequent rounds of iterative optimization.
[0155] Step S13, respectively determining candidate text rewriting instructions associated with at least one instruction block sequence.
[0156] After adjusting the instruction blocks included in the instruction block sequence of the initial text rewriting instruction, at least one new instruction block sequence is obtained, and based on the at least one new instruction block sequence, candidate text rewriting instructions associated with each of the at least one new instruction block sequence are determined.
[0157] refer to Fig.10 , Fig.10 An exemplary schematic diagram of obtaining a candidate text rewriting instruction is provided, from Fig.10 It can be seen that after executing K1 instruction block insertion operations, K2 instruction block deletion operations, K3 instruction block replacement operations and K4 instruction block position change operations on the initial text rewriting instruction, K candidate text rewriting instructions are obtained.
[0158] In the present application, since instruction blocks can better represent instruction semantics, an instruction block adjustment method is adopted so that at least one candidate initial text rewriting instruction obtained can accurately express the text rewriting task information, thereby ensuring the accuracy of the adjusted text rewriting instruction, and further ensuring more accurate determination of the rewritten text based on the adjusted text rewriting instruction.
[0159] In the embodiment of the present application, after obtaining at least one candidate text rewriting instruction, the candidate text rewriting instruction is evaluated in step S2 to obtain an instruction evaluation value, and then the target text rewriting instruction is further determined according to the instruction evaluation value. Fig.11 , Fig.11 A schematic diagram of evaluating a candidate text rewriting instruction provided in an embodiment of the present application includes the following steps:
[0160] Step S21, inputting the candidate text rewriting instruction into a target model supporting the text rewriting function to obtain a first rewritten text.
[0161] In the embodiment of the present application, in order to accurately obtain the first rewritten text associated with the candidate text rewriting instruction through the target model supporting the text rewriting function, the target model should be trained first to obtain the trained target model, and then based on the trained target model, the first rewritten text associated with the candidate text rewriting instruction is accurately output. The training process and application process of the target model are described in detail below.
[0162] 1. Training of target model
[0163] In one possible implementation, the target model supporting the text rewriting function is obtained by pre-training an initial model supporting the text rewriting function using general text data, and jointly training the pre-trained model on various processing tasks of multimedia information based on associated task instructions.
[0164] Among them, general text data includes but is not limited to: web page data, novels, and encyclopedia data; various processing tasks include but are not limited to: multimedia information type recognition, multimedia information title recognition, multimedia information emotional polarity recognition, multimedia information summary generation, and multimedia information comment generation; the training data used in the joint training process includes: task instructions, multimedia information, and task objectives.
[0165] Exemplarily, when the target model supporting the text rewriting function mainly processes language, the model may be a language model; in this case, the language model is pre-trained on general text data, and after the pre-training is completed, joint training is performed on the two processing tasks of type recognition task and comment generation task based on the instruction method. In this case, the data structure of the training data is as follows:
[0166] Processing Task 1: Type Identification
[0167] Command prompt: Based on the following multimedia information, output the type of media information
[0168] Annotated data:
[0169] Multimedia message 1---Multimedia message type 1
[0170] Multimedia message 2---Multimedia message type 2
[0171] …
[0172] Multimedia information v---Multimedia information type v
[0173] Processing Task 2: Comment Generation
[0174] Instruction prompt: Based on the following multimedia information, generate comments for the multimedia information
[0175] Annotated data:
[0176] Multimedia Information 1---Multimedia Information Comment 1
[0177] Multimedia Information 1---Multimedia Information Comment 2
[0178] Multimedia Information 2---Multimedia Information Comments 1
[0179] …
[0180] Multimedia information v Multimedia information comments v
[0181] During the training process, the task instructions are input into the instruction area of the model, and the original features of the multimedia information are placed at the back. Through such training, the model can have a better ability to understand instructions.
[0182] 2. Generate the first rewritten text associated with the candidate text rewriting instruction based on the target model
[0183] In one possible implementation, a candidate text rewriting instruction and a first original text are input into a trained target model, and in the trained target model, a text rewriting operation is performed on the first original text based on the candidate text rewriting instruction to obtain a first rewritten text associated with the candidate text rewriting instruction.
[0184] For example, see Fig.12 , Fig.12 A schematic diagram of obtaining a first rewritten text provided in an embodiment of the present application. Fig.12 It can be seen that the candidate text rewriting instruction and the first original text are input into the target model, and the text rewriting operation is performed through the multi-layer transformer decoder (Transformer Decoder) in the target model to realize the text rewriting, and finally the first rewritten text associated with the candidate text rewriting instruction is output.
[0185] In an embodiment of the present application, in the target model, the following is specifically performed: first, identifying content information included in a candidate text rewriting instruction; wherein the content information includes at least: rewriting style, keywords; then, based on the keywords, obtaining a target word segmentation matching the keyword in the first original text; finally, performing a text rewriting operation on the first original text according to the rewriting style to obtain a first rewritten text; wherein the first rewritten text includes the target word segmentation; at this time, rewriting the first original text based on the candidate text rewriting instruction is implemented to obtain the associated first rewritten text.
[0186] For example, see Fig.13 , Fig.13 Another schematic diagram of obtaining a first rewritten text provided in an embodiment of the present application. Fig.13 In the example, the first original text is: How to make scrambled eggs with tomatoes; the candidate text rewriting instruction is: rewrite the first original text into the "How-To" style, and retain "scrambled eggs with tomatoes"; at this time, the first original text and the candidate text rewriting instruction are input into the target model, and in the target model, the following is executed: first, the rewriting style in "Rewrite the first original text into the "How-To" style, and retain "scrambled eggs with tomatoes"" is identified as: "How-To" style, and the keyword is: scrambled eggs with tomatoes. After that, it is determined that "scrambled eggs with tomatoes" is included in the first original text, so "scrambled eggs with tomatoes" is determined as the target word to be retained. Finally, the text rewriting operation is performed on "How to make scrambled eggs with tomatoes" according to the "How-To" style to obtain the first rewritten text, and the first rewritten text is required to include the target word "scrambled eggs with tomatoes". At this time, the output first rewritten text is: How to make scrambled eggs with tomatoes.
[0187] In an embodiment of the present application, after obtaining the first rewritten text through the target model, the first rewritten text is evaluated to determine the associated text evaluation value and text attractiveness, and further based on the text evaluation value and text attractiveness, the instruction evaluation value of the first candidate text rewriting instruction is determined, see steps S22 to S23 for details.
[0188] Step S22: determining a text evaluation value associated with the first rewritten text based on at least one target rewritten text in the evaluation set.
[0189] The evaluation set is a pre-collected data pair of the original text and the target rewritten text; for example, the text is a multimedia information title, and the "How-To" style title rewriting is taken as an example. The format of the data in the evaluation set is:
[0190] Multimedia information original title 1---"How-To" style title 1
[0191] Multimedia information original title 2---"How-To" style title 2
[0192] …
[0193] Original title of multimedia information---"How-To" style title
[0194] In a possible implementation, when determining the text evaluation value associated with the first rewritten text based on at least one target rewritten text in the evaluation set, the text evaluation value is determined based on a brevity penalty factor and a matching degree between the first rewritten text and at least one target rewritten text; the implementation principle is shown in the following formula (1):
[0195]
[0196] Among them, BLEU represents the text evaluation value, BP represents the brevity penalty factor, and ω n Representation weight, P n Characterize the matching degree.
[0197] In a possible implementation, during the BLEU calculation process, it is necessary to determine the precision of 1-gram, 2-gram, ..., N-gram of the first rewritten text, and N is generally set to 4. Among them, the 1-gram precision indicates the degree of matching between the first rewritten text and the first original text, and the other n-grams indicate the fluency of the first rewritten text; at this time, Pn represents the precision of n-gram, ω n The weights that represent n-grams are generally set to uniform weights, that is, for any n, there is ω n =1 / N.
[0198] In a possible implementation, the BP brevity penalty factor is determined based on the initial text length of the first rewritten text and the configured text reference length. If the initial text length of the first rewritten text is less than or equal to the configured text reference length, BP is less than 1, otherwise BP is 1. The implementation principle is shown in the following formula (2):
[0199]
[0200] The MT output length represents the initial length of the first rewritten text, and the reference output length represents the reference length of the configured text.
[0201] In a possible implementation, the degree of match between the first rewritten text and each target rewritten text in at least one target rewritten text is determined based on the first data in the first rewritten text that contains the same segmentation as the target rewritten text; taking a target rewritten text C as an example, when the first number of the same segmentations contained in the first rewritten text and the target rewritten text C is 10, and the second number of all segmentations contained in the first rewritten text is 20, it is determined that the degree of match between the first rewritten text and the target rewritten text C is 50%. The implementation principle is shown in the following formula (3):
[0202]
[0203] Among them, CounterClip (n-gram) represents the first quantity, and Counter (n-gram) represents the second quantity.
[0204] In this application, trace data with certain statistical significance is used as an evaluation set for the effect of optimized text rewriting instructions, which reduces the demand for data annotation and reduces costs.
[0205] Step S23, determining the text attractiveness associated with the first rewritten text through the trained attractiveness evaluation model; wherein the text attractiveness represents the browsing popularity of the multimedia information associated with the first rewritten text.
[0206] In the embodiment of the present application, in order to accurately obtain the text attractiveness associated with the first rewritten text through the attractiveness evaluation model, the attractiveness evaluation model should be trained first to obtain a trained attractiveness evaluation model, and then based on the trained attractiveness evaluation model, the text attractiveness associated with the first rewritten text is accurately output. The training process and application process of the attractiveness evaluation model are described in detail below.
[0207] 1. Training of attractiveness evaluation model
[0208] See also Fig.14 , Fig.14 A schematic diagram of an attractiveness evaluation model provided for an embodiment of the present application, comprising a bidirectional encoder representation from transformer (BERT) network layer, a fully connected network layer, and an output layer.
[0209] On the basis of the attractiveness evaluation model, in order to ensure the accuracy of the attractiveness evaluation, in the embodiment of the present application, Fig.14The attractiveness evaluation model shown provides a training method for the attractiveness evaluation model; specifically, based on the training sample set, the attractiveness evaluation model to be trained performs cyclic iterative training to obtain a trained attractiveness evaluation model. Since the operation of each round of cyclic iteration is consistent during the cyclic iteration, the training method of the attractiveness evaluation model is described below by taking one round of training iteration as an example.
[0210] See also Fig.15 , Fig.15 A flow chart of a training method for an attractiveness evaluation model provided in an embodiment of the present application includes the following steps:
[0211] Step S1500, constructing a training sample set.
[0212] Each training sample in the training sample set is historical multimedia information with annotated attractiveness, and the annotated attractiveness is used to characterize the attractiveness of text information associated with the historical multimedia information.
[0213] In one possible implementation, the annotation attractiveness is determined based on the actual views and reference views of the historical multimedia information to determine the browsing completion of the historical multimedia information; and the browsing completion is used as the annotation attractiveness; wherein the reference views are determined based on the total views and the fixed views configured for the historical multimedia information.
[0214] For example, taking multimedia information as video, the attractiveness is marked as the completion of video playback. At this time, the attractiveness evaluation model is trained on a large amount of historical playback behavior data on the video platform, and a period of time is set, such as a set of videos whose number of players meets a certain threshold within a month. If the playback completion of the video is higher than a certain threshold, then the video title is used as a positive sample of attractiveness, otherwise it is a negative sample.
[0215] Step S1501: Select training samples from a training sample set.
[0216] During the training process, training samples are randomly selected from the training sample set, and training is performed based on the selected training samples.
[0217] Step S1502: input the training samples into the attractiveness evaluation model to be trained to predict the predicted attractiveness of the historical multimedia information.
[0218] After the historical multimedia information passes through the attractiveness evaluation model, the predicted attractiveness associated with the historical multimedia information is obtained.
[0219] Step S1503, based on the labeled attractiveness and the predicted attractiveness, the loss function is constructed to adjust the parameters of the attractiveness evaluation model to be trained.
[0220] In a possible implementation, a loss function is constructed based on the difference between the labeled attractiveness and the predicted attractiveness, and parameters of the attractiveness evaluation model to be trained are adjusted based on the loss function.
[0221] 2. Determine the text attractiveness of the first rewritten text based on the attractiveness evaluation model
[0222] Exemplarily, the first rewritten text is input into the attractiveness evaluation model, and the text attractiveness associated with the first rewritten text is output through the BERT network layer and the fully connected network layer.
[0223] Step S24, weighting the text evaluation value and the text attractiveness, and using the obtained weighted result as the instruction evaluation value of a candidate text rewriting instruction.
[0224] Exemplarily, the instruction evaluation value=text evaluation value*w1+text attractiveness*w2, wherein w1 and w2 are weights of the text evaluation value and text attractiveness, respectively, and w1+w2=1.
[0225] It should be noted that the execution order of step S21 and step S22 can be replaced, and the execution order given in this application is not unique.
[0226] In the present application, a first rewritten text associated with a candidate text rewriting instruction is obtained through a target model, and based on the text evaluation value and text attractiveness of the first rewritten text, an instruction evaluation value of the associated candidate text rewriting instruction is determined to ensure the accuracy of the determined instruction evaluation value, so as to further select an accurate target text rewriting instruction based on the instruction evaluation value.
[0227] In an embodiment of the present application, in order to accurately obtain the target rewritten text during each iterative optimization process, in step S3, first, from at least one candidate text rewriting instruction obtained during the current round of iterative processing, a candidate text rewriting instruction with the largest instruction evaluation value is screened out, and then it is determined whether the screened out candidate text rewriting instruction satisfies the iteration termination condition. When it is determined that the iteration termination condition is satisfied, the candidate text rewriting instruction screened out in the current round is used as the target text rewriting instruction and output. If it is determined that the iteration termination condition is not satisfied, the candidate text rewriting instruction screened out in the current round is used as the input of the round iterative optimization process.
[0228] In a possible implementation, the iteration termination condition includes but is not limited to:
[0229] The instruction evaluation value reaches a first threshold;
[0230] The gain value is lower than a second threshold value, and the gain value is determined based on instruction evaluation values of two adjacent screened candidate text rewriting instructions;
[0231] The number of iterative optimization processes has reached the upper limit.
[0232] When the iteration termination condition is met, the target text rewriting instruction is output. The format of the target text rewriting instruction is as follows, taking the title rewriting as an example:
[0233] "Rewrite the title as follows:
[0234] Preserve key information
[0235] Change to "How-To" style
[0236] More use of modifiers
[0237] Original title: XXXX"
[0238] In the present application, an iteration termination condition is set so that the target text rewriting instructions will not be adjusted endlessly, thus saving resources and making the output target text rewriting instructions more accurate.
[0239] See also Fig.16 , Fig.16 A schematic diagram of a specific implementation method for text rewriting instruction optimization provided in an embodiment of the present application; the technical scheme of the embodiment of the present application is explained by optimizing the video title rewriting instruction: first, the title rewriting instruction D screened out in the previous round of iterative optimization processing is obtained; secondly, the title rewriting instruction D is processed for instruction content change to obtain candidate title rewriting instruction D1, candidate title rewriting instruction D2...candidate title rewriting instruction Dk, and the candidate title rewriting instructions D1~Dk are respectively evaluated for title rewriting instruction effects to obtain instruction evaluation values corresponding to the candidate title rewriting instructions D1~Dk; then, based on the instruction evaluation values, the candidate title rewriting instruction with the largest instruction evaluation value is selected from the candidate title rewriting instructions D1~Dk, that is, the candidate title rewriting instruction D2; then, based on the instruction evaluation value of the candidate title rewriting instruction D2, it is determined whether the iteration termination condition is met, and when it is determined that the iteration termination condition is met, the candidate title rewriting instruction D2 is used as the target title rewriting instruction, otherwise the candidate title rewriting instruction D2 continues to be iteratively optimized.
[0240] It should be noted that the title rewriting instructions in the first round of iterative optimization processing were manually written.
[0241] In an embodiment of the present application, after performing at least one iterative optimization process on the initial text rewriting instruction and obtaining the target text rewriting instruction, a text rewriting operation is performed on the second original text based on the target text rewriting instruction to obtain a second rewritten text.
[0242] Exemplarily, the target text rewriting instruction and the second original text are input into the trained target model, and in the trained target model, a text rewriting operation is performed on the second original text based on the target text rewriting instruction to obtain the second rewritten text associated with the target text rewriting instruction. Specifically, the implementation method of determining the second rewritten text associated with the target text rewriting instruction through the target model can refer to the implementation method of obtaining the first rewritten text, and the principle is similar, so it will not be repeated here.
[0243] It should be noted that the second original text and the first original text may be the same text, or may be texts with the same content but different formats.
[0244] In another possible implementation, after obtaining the target text rewriting instructions, the target text rewriting instructions are saved. When other original texts are encountered later, the target text rewriting instructions can be slightly adjusted based on the other original texts and the adjusted text rewriting instructions can be used, which can reduce costs and improve efficiency.
[0245] See also Fig.17 , Fig.17 A flowchart of a text rewriting method provided for the implementation of this application includes the following steps:
[0246] Step S1700, using general text data, pre-training an initial model supporting a text rewriting function to obtain a pre-trained model;
[0247] Step S1701, on various processing tasks of multimedia information, based on associated task instructions, jointly training the pre-trained models to obtain a target model;
[0248] Step S1702, constructing an evaluation set for instruction evaluation, wherein the evaluation set includes at least one target rewritten text;
[0249] Step S1703, performing cyclic iterative training on the trained attractiveness evaluation model according to the training samples in the training sample set to obtain a trained attractiveness evaluation model, wherein the training samples are historical multimedia information with labeled attractiveness;
[0250] Step S1704, constructing an initial text rewriting instruction;
[0251] Step S1705, performing instruction content change processing on the initial text rewriting instruction to obtain at least one candidate text rewriting instruction;
[0252] Step S1706, for each candidate text rewriting instruction, determining the associated first rewriting text through the target model supporting the text rewriting function;
[0253] Step S1707, determining a text evaluation value of each first rewritten text based on at least one target rewritten text in the evaluation set;
[0254] Step S1708, determining the text attractiveness of each first rewritten text through an attractiveness evaluation model;
[0255] Step S1709, determining the instruction evaluation value of the associated candidate text rewriting instruction based on the text evaluation value and text attractiveness of each first rewritten text;
[0256] Step S1710, based on the instruction evaluation value of each of the at least one candidate text rewriting instructions, screening out the candidate text rewriting instruction with the largest instruction evaluation value;
[0257] Step S1711, determine whether the iteration termination condition is met, if so, execute step S1712, otherwise execute step S1713;
[0258] Step S1712, using the screened candidate text rewriting instructions as target text rewriting instructions;
[0259] Step S1713, taking the candidate text rewriting instruction as the initial text rewriting instruction, and returning to step S1705.
[0260] It should be noted that steps S1700 to S1703 are preliminary preparations. Fig.17 The execution order of steps S1700 to S1703 is only an example and is not the only implementation method; specifically, in the embodiment of the present application, step S1702 may be executed first, then step S1703, and finally step S1700 to S1701; or, step S1703 may be executed first, then step S1702, and finally step S1700 to S1701; or, step S1700 to S1701 may be executed first, then step S1703, and finally step S1702; or, step S1700 to S1701, step S1702, and step S1703 may be executed simultaneously.
[0261] The text rewriting instruction optimization method provided in the embodiment of the present application has the following effects:
[0262] In order to avoid the problem of the simultaneous increase in model adjustment cost and difficulty when the target model's adaptive ability and adaptability to artificially constructed text rewriting instructions are increased due to adjusting the parameters of the target model, a method for optimizing the text rewriting instructions is proposed, namely, performing at least one iterative optimization process on the initial text rewriting instructions to obtain the target text rewriting instructions; in each round of iterative optimization process, evaluating each candidate rewriting instruction obtained in the current round to obtain an instruction evaluation value, and determining whether to perform the next round of iterative optimization process based on the instruction evaluation value, so that after multiple rounds of instruction iterative optimization, the quality of the text rewriting instructions is improved, and can be better understood by the target model that supports the text rewriting function, thereby improving the accuracy and efficiency of text rewriting through the target model; and in this process, only the text rewriting instructions are iteratively optimized, and there is no need to adjust the parameters of the target model, which can stimulate the adaptive ability and adaptability of the target model to the text rewriting instructions, thereby reducing the adjustment cost and difficulty of the model for the text rewriting task.
[0263] Based on the same inventive concept, the embodiment of the present application also provides a text rewriting instruction optimization device 1800, such as Fig.18 As shown, the text rewriting instruction optimization device 1800 includes:
[0264] An acquisition unit 1801 is used to acquire an initial text rewriting instruction;
[0265] The optimization processing unit 1802 is used to perform at least one iterative optimization process on the initial text rewriting instruction to obtain the target text rewriting instruction; wherein, in one iterative optimization process, the following operations are performed:
[0266] Performing instruction content transformation processing on the initial text rewriting instruction to obtain at least one candidate text rewriting instruction;
[0267] For at least one candidate text rewriting instruction, the following operations are performed respectively: a first rewriting text is generated for a candidate text rewriting instruction through a target model that supports a text rewriting function, and based on the first rewriting text, a candidate text rewriting instruction is evaluated to obtain an instruction evaluation value;
[0268] Among at least one candidate text rewriting instruction, a candidate text rewriting instruction whose instruction evaluation value meets the initial screening condition is screened out, and when the screened candidate text rewriting instruction meets the iteration termination condition, the candidate text rewriting instruction is output as the target text rewriting instruction.
[0269] In a possible implementation, the optimization processing unit 1802 is specifically configured to:
[0270] Acquire semantic features of the initial text rewriting instruction, and process the semantic features into blocks to obtain at least one instruction block;
[0271] Performing instruction block adjustment processing on a target instruction block in at least one instruction block to obtain at least one instruction block sequence; wherein the instruction block adjustment processing includes: deleting the target instruction block, inserting a new instruction block before the target instruction block, replacing the target instruction block, and changing the position of the target instruction block;
[0272] A candidate text rewriting instruction associated with each of at least one instruction block sequence is determined respectively.
[0273] In a possible implementation, the optimization processing unit 1802 is specifically configured to:
[0274] Based on at least one target rewritten text in the evaluation set, determine a text evaluation value associated with the first rewritten text, and determine the text attractiveness associated with the first rewritten text through a trained attractiveness evaluation model; wherein the text attractiveness represents the browsing popularity of the multimedia information associated with the first rewritten text;
[0275] The text evaluation value and the text attractiveness are weighted, and the obtained weighted result is used as the instruction evaluation value of a candidate text rewriting instruction.
[0276] In a possible implementation, the optimization processing unit 1802 is specifically configured to:
[0277] Determine a brevity penalty factor based on a configured text reference length and an initial text length of the first rewritten text;
[0278] For at least one target rewritten text in the evaluation set, the following operations are respectively performed: determining a first number of identical segmented words contained in a first rewritten text and a target rewritten text, and determining a matching degree between the first rewritten text and a target text based on the first number and a second number of all segmented words contained in the first rewritten text;
[0279] A text evaluation value of the first rewritten text association is determined based on the at least one matching degree and a brevity penalty factor.
[0280] In a possible implementation, the attractiveness evaluation model is obtained by:
[0281] According to the training samples in the training sample set, the attractiveness evaluation model to be trained is subjected to cyclic iterative training to obtain a trained attractiveness evaluation model; in one cyclic iteration, the following operations are performed:
[0282] Selecting training samples from a training sample set; wherein the training samples at least include: the annotation attractiveness of text information associated with historical multimedia information;
[0283] Input the training samples into the attractiveness evaluation model to be trained to predict the predicted attractiveness of historical multimedia information;
[0284] Based on the labeled attractiveness and predicted attractiveness, a loss function is constructed to adjust the parameters of the attractiveness evaluation model to be trained.
[0285] In a possible implementation, the annotation attractiveness is determined in the following manner:
[0286] Determining the browsing completion degree of the historical multimedia information based on the actual browsing volume and the reference browsing volume of the historical multimedia information; wherein the reference browsing volume is determined based on the total number of browsing times and the fixed browsing volume configured for the historical multimedia information;
[0287] Use browsing completion as the annotation attraction.
[0288] In a possible implementation, the optimization processing unit 1802 is specifically configured to:
[0289] Inputting a candidate text rewriting instruction and a first original text into a target model;
[0290] In the target model, do the following:
[0291] Identify content information included in a candidate text rewriting instruction; wherein the content information at least includes: rewriting style and keywords;
[0292] Based on the keyword, in the first original text, a target word segmentation matching the keyword is obtained;
[0293] A text rewriting operation is performed on the first original text according to the rewriting style to obtain a first rewritten text; wherein the first rewritten text includes the target word segmentation.
[0294] In a possible implementation, the iteration termination condition includes at least one of the following:
[0295] The instruction evaluation value reaches a first threshold;
[0296] The gain value is lower than the second threshold value, and the gain value is determined based on the instruction evaluation values of two adjacent screened candidate text rewriting instructions.
[0297] In a possible implementation, the optimization processing unit 1802 is further configured to:
[0298] After performing at least one iterative optimization process on the initial text rewriting instruction and obtaining the target text rewriting instruction, a text rewriting operation is performed on the second original text based on the target text rewriting instruction to obtain a second rewritten text.
[0299] In one possible implementation, the target model is obtained as follows:
[0300] Using general text data, pre-train an initial model supporting a text rewriting function to obtain a pre-trained model;
[0301] On various processing tasks of multimedia information, the pre-trained models are jointly trained based on the associated task instructions to obtain the target model.
[0302] The text rewriting instruction optimization device provided in the embodiment of the present application has the following effects:
[0303] In order to avoid the problem that the model adjustment cost and difficulty increase simultaneously when the target model's adaptive ability and adaptability to artificially constructed text rewriting instructions are increased due to adjusting the parameters of the target model, a method for optimizing the text rewriting instructions is proposed, namely, performing at least one iterative optimization process on the initial text rewriting instructions to obtain the target text rewriting instructions; in each round of iterative optimization process, evaluating each candidate rewriting instruction obtained in the current round to obtain an instruction evaluation value, and determining whether to perform the next round of iterative optimization process based on the instruction evaluation value, so that after multiple rounds of instruction iterative optimization, the quality of the text rewriting instructions is improved, and can be better understood by the target model that supports the text rewriting function, thereby improving the accuracy and efficiency of text rewriting through the target model; and in this process, only the text rewriting instructions are iteratively optimized, and there is no need to adjust the parameters of the target model, which can stimulate the adaptive ability and adaptability of the target model to the text rewriting instructions, thereby reducing the adjustment cost and difficulty of the model for the text rewriting task.
[0304] For the convenience of description, the above parts are divided into units (or modules) according to their functions and described separately. Of course, when implementing this application, the functions of each unit (or module) can be implemented in the same or multiple software or hardware.
[0305] After introducing the text rewrite instruction optimization method and apparatus according to an exemplary embodiment of the present application, another exemplary embodiment of the present application, a computing device, is introduced next.
[0306] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.
[0307] In an embodiment of the present application, a computing device is also provided, and the computing device may include at least a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, the processor executes any step of the text rewriting instruction optimization method of various exemplary embodiments of the present application.
[0308] In a possible implementation, the computing device may be a terminal device, and the structure of the computing device may be as follows: Fig.19 As shown, it includes: a communication component 1910, a memory 1920, a display unit 1930, a camera 1940, a sensor 1950, an audio circuit 1960, a Bluetooth module 1970, a processor 1980 and other components.
[0309] The communication component 1910 is used to communicate with the ring wearable device. In some embodiments, a circuit wireless fidelity (Wireless Fidelity, WiFi) module may be included. The WiFi module belongs to a short-range wireless transmission technology, and the computing device sends and receives information through the WiFi module.
[0310] The memory 1920 can be used to store software programs and data. The processor 1980 performs various functions and data processing by running the software programs or data stored in the memory 1920. The memory 1920 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one type of disk storage device, flash memory device, or other volatile solid-state storage device. The memory 1920 stores an operating system that enables the computing device to run. In the present application, the memory 1920 can store an operating system and various application programs, and can also store code for executing the text rewriting instruction optimization method of the embodiment of the present application.
[0311] The display unit 1930 can also be used to display information input by the user or information provided to the user and a graphical user interface (GUI) of various menus of the terminal device. Specifically, the display unit 1930 includes a display screen 1932 arranged on the front of the terminal device. The display screen 1932 can be configured in the form of a liquid crystal display, a light emitting diode, etc.
[0312] The display unit 1930 can also be used to receive input digital or character information and generate signal input related to user settings and function control of the terminal device. Specifically, the display unit 1930 may include a touch screen 1931 arranged on the front of the terminal device, which can collect user touch operations on or near it, such as clicking a button, dragging a scroll box, etc.
[0313] The touch screen 1931 can be covered on the display screen 1932, or the touch screen 1931 and the display screen 1932 can be integrated to realize the input and output functions of the terminal device, and the integrated display screen can be referred to as a touch display screen. In this application, the display unit 1930 can display applications, multimedia information played by applications, and corresponding operation steps.
[0314] Camera 1940 can be used to capture static images. Camera 1940 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 1980 to convert it into a digital image signal.
[0315] The computing device may further include at least one sensor 1950, such as an acceleration sensor 1951, a distance sensor 1952, a fingerprint sensor 1953, and a temperature sensor 1954. The computing device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.
[0316] The audio circuit 1960, the speaker 1961, and the microphone 1962 can provide an audio interface between the user and the computing device. The audio circuit 1960 can transmit the electrical signal converted from the received audio data to the speaker 1961, which is converted into a sound signal for output. The computing device can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 1962 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1960 and converted into audio data, and then the audio data is output to the communication component 1910 for transmission to, for example, another computing device, or the audio data is output to the memory 1920 for further processing.
[0317] The Bluetooth module 1970 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the computing device can establish a Bluetooth connection with a wearable computing device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 1970 to exchange data.
[0318] The processor 1980 is the control center of the computing device. It uses various interfaces and lines to connect various parts of the entire computing device. It executes various functions of the computing device and processes data by running or executing software programs stored in the memory 1920 and calling data stored in the memory 1920. In some embodiments, the processor 1980 may include one or more processing units; the processor 1980 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 1980. In the present application, the processor 1980 can run the operating system, application programs, user interface display and touch response, as well as the text rewriting instruction optimization method of the embodiment of the present application. In addition, the processor 1980 is coupled to the display unit 1930.
[0319] In another possible implementation, the computing device may be a server. The structure of the computing device may be as follows: Fig. 20 As shown, the components of the computing device 2000 may include, but are not limited to: at least one processor 2001, at least one memory 2002, and a bus 2003 connecting different system components (including the memory 2002 and the processor 2001).
[0320] The memory 2002 may be used to store software programs and data. The processor 2001 executes various functions and data processing by running the software programs or data stored in the memory 2002, thereby implementing the text rewriting instruction optimization method of the embodiment of the present application.
[0321] Bus 2003 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
[0322] The memory 2002 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 20021 and / or a cache memory 20022 , and may further include a read-only memory (ROM) 20020 .
[0323] Memory 2002 may also include a program / utility 20025 having a set (at least one) of program modules 20024, such program modules 20024 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0324] The computing device 2000 may also communicate with one or more external devices 2004 (e.g., keyboards, pointing devices, etc.), one or more devices that enable a user to interact with the computing device 2000, and / or any device that enables the computing device 2000 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via input / output (I / O) interface 2005. Furthermore, the computing device 2000 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 2006. Fig. 20 As shown, network adapter 2006 communicates with other modules for computing device 2000 via bus 2003. It should be understood that although Fig. 20 Not shown, other hardware and / or software modules may be used in conjunction with computing device 2000, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0325] In addition, it should be noted that in the specific implementation of this application, user-related data is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0326] In some possible implementations, various aspects of the text rewriting instruction optimization method provided by the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on a computing device, the computer program is used to enable the computing device to execute the steps of the text rewriting instruction optimization method according to various exemplary implementations of the present application described above in this specification.
[0327] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0328] The program product of multimedia information recommendation of the embodiment of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on a computing device. However, the program product of the present application is not limited to this. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, device or device.
[0329] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may convey, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.
[0330] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0331] Computer programs for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The computer program may be executed entirely on the user computing device, partially on the user equipment, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0332] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0333] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0334] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain a computer-usable computer program.
[0335] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program commands. These computer program commands can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the commands executed by the processor of the computer or other programmable data processing device generate commands for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0336] These computer program commands may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the commands stored in the computer readable memory produce an article of manufacture comprising a command device, the command device implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0337] These computer program commands can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the commands executed on the computer or other programmable device provide the instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0338] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0339] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A text rewriting instruction optimization method, It is characterized in that The method comprises: Get the initial text rewrite instruction; The initial text rewriting instruction is subjected to at least one iterative optimization process to obtain a target text rewriting instruction; wherein, in one iterative optimization process, the following operations are performed: Performing instruction content transformation processing on the initial text rewriting instruction to obtain at least one candidate text rewriting instruction; For the at least one candidate text rewriting instruction, the following operations are performed respectively: a first rewriting text is generated for a candidate text rewriting instruction through a target model that supports a text rewriting function, and based on the first rewriting text, the candidate text rewriting instruction is evaluated to obtain an instruction evaluation value; Among the at least one candidate text rewriting instruction, the candidate text rewriting instruction whose instruction evaluation value meets the initial screening condition is screened out, and when the screened candidate text rewriting instruction meets the iteration termination condition, the candidate text rewriting instruction is output as the target text rewriting instruction.
2. The method according to claim 1, It is characterized in that The performing instruction content transformation processing on the initial text rewriting instruction to obtain at least one candidate text rewriting instruction includes: Acquire semantic features of the initial text rewriting instruction, and process the semantic features into blocks to obtain at least one instruction block; Performing instruction block adjustment processing on a target instruction block in the at least one instruction block to obtain at least one instruction block sequence; wherein the instruction block adjustment processing includes: deleting the target instruction block, inserting a new instruction block before the target instruction block, replacing the target instruction block, and changing the position of the target instruction block; The candidate text rewriting instructions associated with each of the at least one instruction block sequence are respectively determined.
3. The method according to claim 1, It is characterized in that The step of evaluating the candidate text rewriting instruction based on the first rewritten text to obtain an instruction evaluation value includes: Based on at least one target rewritten text in the evaluation set, determining a text evaluation value associated with the first rewritten text, and determining a text attractiveness associated with the first rewritten text through a trained attractiveness evaluation model; wherein the text attractiveness represents the browsing popularity of the multimedia information associated with the first rewritten text; The text evaluation value and the text attractiveness are weighted, and the obtained weighted result is used as the instruction evaluation value of the one candidate text rewriting instruction.
4. The method according to claim 3, It is characterized in that The determining, based on at least one target rewritten text in the evaluation set, a text evaluation value associated with the first rewritten text comprises: Determining a brevity penalty factor based on a configured text reference length and an initial text length of the first rewritten text; For at least one target rewritten text in the evaluation set, the following operations are respectively performed: determining a first number of identical segmented words contained in the first rewritten text and a target rewritten text, and determining a matching degree between the first rewritten text and the target text based on the first number and a second number of all segmented words contained in the first rewritten text; Based on at least one matching degree and the brevity penalty factor, a text evaluation value associated with the first rewritten text is determined.
5. The method according to claim 3, It is characterized in that The attractiveness evaluation model is obtained in the following way: According to the training samples in the training sample set, the attractiveness evaluation model to be trained is subjected to cyclic iterative training to obtain a trained attractiveness evaluation model; in one cyclic iteration, the following operations are performed: Selecting training samples from the training sample set; wherein the training samples at least include: the annotation attractiveness of text information associated with historical multimedia information; Inputting the training samples into the attractiveness evaluation model to be trained to predict the predicted attractiveness of the historical multimedia information; Based on the labeled attractiveness and the predicted attractiveness, a loss function is constructed to adjust parameters of the attractiveness evaluation model to be trained.
6. The method according to claim 5, It is characterized in that The labeling attractiveness is determined as follows: Determining the browsing completion degree of the historical multimedia information based on the actual browsing volume and the reference browsing volume of the historical multimedia information; wherein the reference browsing volume is determined based on the total number of browsing times and the fixed browsing volume configured for the historical multimedia information; The browsing completion degree is used as the annotation attractiveness degree.
7. The method according to claim 1, It is characterized in that The step of generating a first rewritten text for a candidate text rewriting instruction by using a target model that supports a text rewriting function includes: Inputting the candidate text rewriting instruction and the first original text into the target model; In the target model, do the following: Identify content information included in the candidate text rewriting instruction; wherein the content information at least includes: rewriting style and keywords; Based on the keyword, obtaining a target word segmentation matching the keyword in the first original text; A text rewriting operation is performed on the first original text according to the rewriting style to obtain the first rewritten text; wherein the first rewritten text includes the target word segmentation.
8. The method according to claim 1, It is characterized in that The iteration termination condition includes at least one of the following: The instruction evaluation value reaches a first threshold; The gain value is lower than a second threshold value, and the gain value is determined based on instruction evaluation values of two adjacent screened candidate text rewriting instructions.
9. The method according to claim 1, It is characterized in that After performing at least one iterative optimization process on the initial text rewriting instruction to obtain the target text rewriting instruction, the method further includes: Based on the target text rewriting instruction, a text rewriting operation is performed on the second original text to obtain a second rewritten text.
10. The method according to any one of claims 1 to 9, It is characterized in that The target model is obtained by: Using general text data, pre-train an initial model supporting a text rewriting function to obtain a pre-trained model; On various processing tasks of multimedia information, the pre-trained models are jointly trained based on associated task instructions to obtain the target model.
11. A text rewriting instruction optimization device, It is characterized in that The device comprises: An acquisition unit, used for acquiring an initial text rewriting instruction; The optimization processing unit is used to perform at least one iterative optimization process on the initial text rewriting instruction to obtain a target text rewriting instruction; wherein, in one iterative optimization process, the following operations are performed: Performing instruction content transformation processing on the initial text rewriting instruction to obtain at least one candidate text rewriting instruction; For the at least one candidate text rewriting instruction, the following operations are performed respectively: a first rewriting text is generated for a candidate text rewriting instruction through a target model that supports a text rewriting function, and based on the first rewriting text, the candidate text rewriting instruction is evaluated to obtain an instruction evaluation value; Among the at least one candidate text rewriting instruction, the candidate text rewriting instruction whose instruction evaluation value meets the initial screening condition is screened out, and when the screened candidate text rewriting instruction meets the iteration termination condition, the candidate text rewriting instruction is output as the target text rewriting instruction.
12. A computing device, It is characterized in that The computing device comprises: a memory and a processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to implement the steps of any one of the methods of claims 1 to 10.
13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer program product, It is characterized in that The invention comprises a computer program, which implements the steps of any one of the methods of claims 1 to 10 when executed by a processor.
Citation Information
Cited By
Text data generation method and device, electronic equipment and storage medium
CN121543127A
