CN113988027A - Text generation method, device, equipment and storage medium - Google Patents

Text generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN113988027A
CN113988027A CN202111115410.7A CN202111115410A CN113988027A CN 113988027 A CN113988027 A CN 113988027A CN 202111115410 A CN202111115410 A CN 202111115410A CN 113988027 A CN113988027 A CN 113988027A
Authority
CN
China
Prior art keywords
text
generation
text generation
data
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111115410.7A
Other languages
Chinese (zh)
Inventor
申琛惠
程丽颖
邴立东
司罗
周然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Damo Institute Hangzhou Technology Co Ltd
Original Assignee
Alibaba Damo Institute Hangzhou Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Damo Institute Hangzhou Technology Co Ltd filed Critical Alibaba Damo Institute Hangzhou Technology Co Ltd
Priority to CN202111115410.7A priority Critical patent/CN113988027A/en
Publication of CN113988027A publication Critical patent/CN113988027A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/169Annotation, e.g. comment data or footnotes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure relates to a text generation method, a text generation device and a storage medium, wherein the method generates a target text based on a text to be processed and data of the text generation direction by acquiring the text to be processed and the data of the text generation direction, and the content of the target text is matched with the text generation direction. The data input when the target text is generated also comprises the data of the text generation direction besides the text to be processed, so that the generated target text corresponds to the text generation direction, the generated text can be controlled according to the given direction or condition under different application scenes, the generation of the text with controllable direction is also realized, the generated text is closer to the actual application scene, the practicability is higher, and the application range is wider.

Description

Text generation method, device, equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of text generation, and in particular, to a text generation method, a text generation device, text generation equipment and a storage medium.
Background
The text generation techniques provided by the related art may generate summarized text or commented text for a given text based on the given text. However, the text generation technology cannot control the generation direction of the text, and cannot meet the requirements of the user on the specific field and the specific text generation direction. Therefore, how to implement a text generation method with controllable generation direction is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, embodiments of the present disclosure provide a text generation method, apparatus, device and storage medium.
A first aspect of an embodiment of the present disclosure provides a text generation method, including:
acquiring a text to be processed and data of a text generation direction;
and generating a target text based on the text to be processed and the data of the text generation direction, wherein the content of the target text is matched with the text generation direction.
A second aspect of an embodiment of the present disclosure provides a text generation apparatus, including:
the acquisition module is used for acquiring the text to be processed and the data of the text generation direction;
and the generating module is used for generating a target text based on the text to be processed and the data of the text generating direction, and the content of the target text is matched with the text generating direction.
A third aspect of embodiments of the present disclosure provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method of the first aspect may be implemented.
A fourth aspect of embodiments of the present disclosure provides a computer-readable storage medium having a computer program stored therein, which, when executed by a processor, may implement the method of the first aspect described above.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
according to the embodiment of the disclosure, the target text is generated by acquiring the text to be processed and the data of the text generation direction and based on the text to be processed and the data of the text generation direction, and the content of the target text is matched with the text generation direction. The data input when the target text is generated also comprises the data of the text generation direction besides the text to be processed, so that the generated target text corresponds to the text generation direction, the generated text can be controlled according to the given direction or condition under different application scenes, the generation of the text with controllable direction is also realized, the generated text is closer to the actual application scene, the practicability is higher, and the application range is wider.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic diagram of a text generation scenario provided in an embodiment of the present disclosure;
fig. 2 is a flowchart of a text generation method provided in an embodiment of the present disclosure;
fig. 3 is a flowchart of another text generation method provided by the embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a text generation apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a computer device in an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
The text generation techniques provided by the related art may generate summarized text or commented text for a given text based on the given text. However, the text generation in the related art belongs to Uncontrollable text generation (unontrollable text generation), the generated text is too random and has no directionality, and because the text generation needs a large amount of training data, the text generation is greatly influenced by the training data and can be limited by generalization of different fields, the effect of cross-fields is reduced, that is, because the training is data of each field, the model of the text generation can be influenced by background knowledge of different fields during learning, and the effect of cross-fields is reduced. Therefore, the generation of the text needs to be controlled, and in the related art, the keywords can be extracted from the text, and the text generation is controlled by using the keywords, but the text can only be close to the standard text to the greatest extent, and the single standard text has high limitation on the generation effect of the text, and cannot be allowed to achieve a good generation effect after the same input controls different generation conditions, that is, the generation direction of the text cannot be controlled, and the requirements of a user on a specific field and a specific text generation direction cannot be met. Therefore, how to implement a text generation method with controllable generation direction is a technical problem to be solved by those skilled in the art.
For the defect that the generation direction of a text cannot be controlled in the related art, an embodiment of the present disclosure provides a text generation scheme, and exemplarily, fig. 1 is a schematic diagram of a text generation scene provided by an embodiment of the present disclosure, as shown in fig. 1, a computer device may obtain a text to be processed and data of the text generation direction, and then may generate a target text matched with the text generation direction based on the text to be processed and the data of the text generation direction. The data input when the target text is generated also comprises the data of the text generation direction besides the text to be processed, so that the generated target text corresponds to the text generation direction, the generated text can be controlled according to the given direction or condition under different application scenes, the generation of the text with controllable direction is also realized, the generated text is closer to the actual application scene, the practicability is higher, and the application range is wider.
In order to better understand the inventive concept of the embodiments of the present disclosure, the following describes technical solutions of the embodiments of the present disclosure with reference to exemplary embodiments.
Fig. 2 is a flowchart of a text generation method provided by an embodiment of the present disclosure, which may be executed by a computer device. As shown in fig. 2, the method provided by this embodiment includes the following steps:
step 101, obtaining a text to be processed and data of a text generation direction.
The text to be processed may be any text that needs to be subjected to information extraction or text summary generation, and the length of the text to be processed is not limited in the embodiments of the present disclosure, for example, the text to be processed may be a thesis, a piece of news content, or the like.
The data of the text generation direction may be data representing the control condition or the generation direction of the text, and may be extracted in advance from Domain background knowledge (Domain knowledge), which may be known by an expert in a certain field by default, and a more precise text property determination may be made by the background knowledge, such as whether the text is derefective or positive, the content of the text implicit, and the like, which may not be known by the public in the same field.
For example, on product reviews, data that satisfies the text generation direction of the product background may be a positive opinion or a negative opinion directly or indirectly for the product; in the field of peer review, the data of the text generation direction may be a functional division for each sentence, such as a sentence in the text or a summary of the content of the paper, or a good-and-bad review, suggestion, etc. proposed for the author's paper.
In the embodiment of the present disclosure, the computer device may obtain a text to be processed and data of a text generation direction, where a source of the text to be processed is not limited, for example, the text to be processed input by a user in real time may be obtained, and the text to be processed sent by other computer devices may also be obtained.
And 102, generating a target text based on the text to be processed and the data of the text generation direction.
The target text can be understood as an output text with a control condition or a text generation direction, and the content of the target text is matched with the text generation direction.
In the embodiment of the present disclosure, after acquiring the text to be processed and the data of the text generation direction, the computer device may input the text to be processed and the data of the text generation direction into a pre-trained text generation model, and output the target text matched with the text generation direction.
The text generation model may be a deep learning model generated by a Controllable text (Controllable text generation), and the Controllable text generation model may be a deep understanding text generation model processed by natural language, and the model aims to make the generated text meet the requirements of control conditions or directions, and further control the direction of text generation based on the text generation, so that the generated text fully meets the requirements of control variables, and different control conditions or directions exist in different fields. For example, when generating a news topic, it is possible to control whether the content of the news topic is a revenue figure or a general summary of the impact on the future; the robot debates can control the generation of text content, and the attention direction is economy, society, education, environmental protection and the like.
Optionally, the controllable text model is trained by using data labeled with sentence functionality sentence by sentence. The sentence functionality can be understood as the type or role of the sentence, for example, a sentence can be labeled as a sentence commenting on advantages or disadvantages, a summarized sentence, or the like. The computer device can input the sample text with sentence-by-sentence labeled sentence functionality, the generated target sample text and the data of the sample text generation direction into the controllable text model for training until the training condition is met.
Illustratively, in the generation of the moderator review (Meta-review) of peer evaluation, the functionality of each sentence can be labeled, and some information of the recorded or rejected articles of the articles, the scores given by the peers, the self-credibility of the peers to the self-opinion, the process of peer and paper author debate and the like are collected, and the information is used for performing controllable text model training, wherein the moderator review can be a summary written by the domain moderator for each paper according to peer evaluation when deciding whether to record or reject the paper.
Because controllable text generation is often based on the nature of the task itself, a deep understanding of the task context is required to make it perform well: for example, in computer products, light weight may be a description of the advantages of the product being portable, but for wardrobes, light weight may be a criticism that the product quality is not relevant and has potential safety hazards; in peer evaluation of paper submission, the model is required to understand information that many experts default to but are not even known to the general public, for example, it is stated that the content of a paper is over-engineered, which is a judgment that the paper lacks novelty, even if engineering can be an advantage in other fields. Therefore, the controllable text model is trained by using data with a large amount of field background knowledge during training, the knowledge of the controllable text model on the field background knowledge of the data can be deepened by using abundant information, the text understanding capability of the model is deepened, the accurate control which is more consistent with a single task per se is carried out, the output text is more suitable for practical application scenes, and the practicability is stronger.
According to the embodiment of the disclosure, the target text is generated by acquiring the text to be processed and the data of the text generation direction and based on the text to be processed and the data of the text generation direction, and the content of the target text is matched with the text generation direction. The data input when the target text is generated also comprises the data of the text generation direction besides the text to be processed, so that the generated target text corresponds to the text generation direction, the generated text can be controlled according to the given direction or condition under different application scenes, the generation of the text with controllable direction is also realized, the generated text is closer to the actual application scene, the practicability is higher, and the application range is wider.
Exemplarily, fig. 3 is a flowchart of another text generation method provided by the embodiment of the present disclosure, and as shown in fig. 3, in a possible implementation, generating a target text based on a text to be processed and data of a text generation direction may include the following steps:
step 301, in response to acquiring data of a plurality of text generation directions, generating at least one sentence matched with the text generation direction for each text generation direction.
The text generation direction of the embodiment of the present disclosure may include a plurality of directions, that is, the data of the text generation direction may be a plurality of directions. The data of the plurality of text generation directions may include two or more data of the same text generation direction, that is, the plurality of text generation directions may include a plurality of the same text generation directions, for example, two advantages and two disadvantages.
In the embodiment of the present disclosure, when determining that the data of the text generation direction is multiple, the computer device may generate at least one sentence matching the text generation direction for each text generation direction, that is, each text generation direction generates a corresponding sentence.
Step 302, generating a target text based on the sentence corresponding to each text generation direction.
After the computer device generates at least one sentence matched with the text generation direction for each text generation direction, at least one sentence corresponding to each text generation direction may be arranged and combined to obtain the target text, that is, when the data of the text generation directions is multiple, the target text may be obtained by combining the sentences generated based on each text generation direction.
In an embodiment of the present disclosure, generating a target text based on a sentence corresponding to each text generation direction may include: and arranging and combining the sentences corresponding to the text generation directions according to the sequence of the data of the text generation directions to obtain the target text.
When generating the target text based on the sentences corresponding to the text generation directions, the computer device may arrange and combine the sentences corresponding to the plurality of generation directions according to the acquisition order of the data of the text generation directions to generate the target text.
In another embodiment of the present disclosure, generating a target text based on a sentence corresponding to each text generation direction includes: and arranging and combining the sentences corresponding to the plurality of text generation directions according to the generation sequence of the sentences to obtain the target text.
When the computer device generates the target text based on the sentences corresponding to the text generation directions, all the sentences obtained by text generation can be arranged and combined according to the generation sequence of each sentence, so that the target text is generated.
In the scheme, the number of the text generation directions and the number of the sentences for generating the text can be controlled on the basis of controlling the text generation directions, the control conditions and the control range are further refined, so that the controllable text has more control categories, the refinement can better meet the change of task requirements, the output text meets the requirements,
the text generation techniques provided by the related art do not emphasize that there is sufficient understanding of the background of the domain and lack of control over the generated text, for example, in the generation of news topics, where each corresponding news item and its corresponding title are given, but do not explain why the success of summarizing its newly developed business service in its corresponding title is no better than summarizing its net revenue in one year for each particular item, such as a financial revenue report.
The text generation needs to be deeply understood in the related field, and for different generated contents, the text generation needs to be performed according to each specific requirement to achieve a satisfactory effect. The text generation method provided by the embodiment of the disclosure is different from the uncontrollable text generation (without any control of the generation direction), and the controllable generation can more accurately control the text generation direction, so that the text generation method can be widely applied to the information extraction and summary type tasks closer to the user requirements, and has higher application value. Such as the directional field, namely the related field with clearly defined advantages and disadvantages, the robot debate generation, the directional E-commerce comment summary, etc. For example, in the automatic generation of the robot debate, the robot can be made to pay attention to different debate directions to generate debate contents, and the debate directions can comprise economy, society, education, environmental protection and the like; in the E-commerce product summary, different summary emphasis points can be emphasized according to requirements, such as product packaging, product performance, logistics dispatching and the like; or in the summary of peer evaluation (peererew) of paper submission, there are different emphasis points on the summary generation of manuscript recording or manuscript rejection, for example, manuscript recording needs to state the advantages of an article more specifically, but manuscript rejection needs to emphasize the disadvantages, and the peer evaluation can be the comments given by peers to papers submitted by others in the process of scientific research paper announcement. Under different application scenes, the scheme can control the generated text according to the control condition or the direction, can better process tasks, meets the processing requirement, and has stronger practicability and wider application range.
Fig. 4 is a schematic structural diagram of a text generating apparatus provided in an embodiment of the present disclosure, where the processing apparatus may be understood as the computer device or a part of functional modules in the computer device. As shown in fig. 4, the text generation apparatus 40 includes:
an obtaining module 41, configured to obtain a text to be processed and data of a text generation direction;
and a generating module 42, configured to generate a target text based on the text to be processed and the data of the text generation direction, where the content of the target text matches the text generation direction.
In one embodiment, the generating module 42 includes:
the first generation submodule is used for generating at least one sentence matched with the text generation direction respectively aiming at each text generation direction when the data of a plurality of text generation directions are acquired;
and the second generation submodule is used for generating a target text based on the sentences corresponding to the text generation directions.
In one embodiment, the data of the plurality of text generation directions includes two or more data of the same text generation direction.
In one embodiment, the second generation submodule is configured to:
and arranging and combining the sentences corresponding to the text generation directions according to the sequence of the data of the text generation directions to obtain a target text.
In one embodiment, the second generation submodule is configured to:
and arranging and combining the sentences corresponding to the plurality of text generation directions according to the generation sequence of the sentences to obtain a target text.
The apparatus provided in this embodiment can execute the method in any one of the embodiments in fig. 1 to fig. 3, and the execution manner and the beneficial effects are similar, and are not described herein again.
The embodiment of the present disclosure further provides a computer device, which includes a processor and a memory, where the memory stores a computer program, and when the computer program is executed by the processor, the method of any one of the above-mentioned fig. 1 to fig. 3 may be implemented.
For example, fig. 5 is a schematic structural diagram of a computer device in an embodiment of the present disclosure. Referring now specifically to FIG. 5, a block diagram of a computer device 500 suitable for use in implementing embodiments of the present disclosure is shown. The computer device 500 in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), etc., and a stationary terminal such as a digital TV, a desktop computer, etc. The computer device shown in fig. 5 is only an example and should not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
As shown in fig. 5, computer device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the computer apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the computer device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates a computer device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the computer device; or may exist separately and not be incorporated into the computer device.
The computer readable medium carries one or more programs which, when executed by the computing device, cause the computing device to: acquiring a text to be processed and data of a text generation direction; and generating a target text based on the text to be processed and the data of the text generation direction, wherein the content of the target text is matched with the text generation direction. .
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The embodiments of the present disclosure further provide a computer-readable storage medium, where a computer program is stored in the storage medium, and when the computer program is executed by a processor, the method of any one of the embodiments in fig. 1 to fig. 3 may be implemented, where the execution manner and the beneficial effects are similar, and are not described herein again.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A text generation method, comprising:
acquiring a text to be processed and data of a text generation direction;
and generating a target text based on the text to be processed and the data of the text generation direction, wherein the content of the target text is matched with the text generation direction.
2. The method of claim 1, wherein generating a target text based on the text to be processed and the data of the text generation direction comprises:
in response to the data of a plurality of text generation directions, generating at least one sentence matched with the text generation direction for each text generation direction;
and generating a target text based on the sentence corresponding to each text generation direction.
3. The method according to claim 2, wherein the data of the plurality of text generation directions includes data of two or more same text generation directions.
4. The method according to claim 2 or 3, wherein the generating a target text based on the sentence corresponding to each text generation direction comprises:
and arranging and combining the sentences corresponding to the text generation directions according to the sequence of the data of the text generation directions to obtain a target text.
5. The method according to claim 2 or 3, wherein the generating a target text based on the sentence corresponding to each text generation direction comprises:
and arranging and combining the sentences corresponding to the plurality of text generation directions according to the generation sequence of the sentences to obtain a target text.
6. A text generation apparatus, comprising:
the acquisition module is used for acquiring the text to be processed and the data of the text generation direction;
and the generating module is used for generating a target text based on the text to be processed and the data of the text generating direction, and the content of the target text is matched with the text generating direction.
7. The apparatus of claim 6, wherein the generating module comprises:
the first generation submodule is used for generating at least one sentence matched with the text generation direction respectively aiming at each text generation direction when the data of a plurality of text generation directions are acquired;
and the second generation submodule is used for generating a target text based on the sentences corresponding to the text generation directions.
8. The apparatus according to claim 7, wherein the data of the plurality of text generation directions includes data of two or more same text generation directions.
9. A computer device, comprising:
memory and a processor, wherein the memory has stored therein a computer program which, when executed by the processor, implements the method of any of claims 1-5.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN202111115410.7A 2021-09-23 2021-09-23 Text generation method, device, equipment and storage medium Pending CN113988027A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111115410.7A CN113988027A (en) 2021-09-23 2021-09-23 Text generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111115410.7A CN113988027A (en) 2021-09-23 2021-09-23 Text generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113988027A true CN113988027A (en) 2022-01-28

Family

ID=79736400

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111115410.7A Pending CN113988027A (en) 2021-09-23 2021-09-23 Text generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113988027A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287278A (en) * 2019-06-20 2019-09-27 北京百度网讯科技有限公司 Comment on generation method, device, server and storage medium
CN112257393A (en) * 2020-12-22 2021-01-22 北京百度网讯科技有限公司 Method, device, equipment and medium for realizing text generation
CN112328751A (en) * 2020-12-03 2021-02-05 三星电子(中国)研发中心 Method and device for processing text
CN113076756A (en) * 2020-01-06 2021-07-06 北京沃东天骏信息技术有限公司 Text generation method and device
CN113254604A (en) * 2021-07-15 2021-08-13 山东大学 Reference specification-based professional text generation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287278A (en) * 2019-06-20 2019-09-27 北京百度网讯科技有限公司 Comment on generation method, device, server and storage medium
CN113076756A (en) * 2020-01-06 2021-07-06 北京沃东天骏信息技术有限公司 Text generation method and device
CN112328751A (en) * 2020-12-03 2021-02-05 三星电子(中国)研发中心 Method and device for processing text
CN112257393A (en) * 2020-12-22 2021-01-22 北京百度网讯科技有限公司 Method, device, equipment and medium for realizing text generation
CN113254604A (en) * 2021-07-15 2021-08-13 山东大学 Reference specification-based professional text generation method and device

Similar Documents

Publication Publication Date Title
CN110096584B (en) Response method and device
CN115982376B (en) Method and device for training model based on text, multimode data and knowledge
WO2020182123A1 (en) Method and device for pushing statement
CN111625645B (en) Training method and device for text generation model and electronic equipment
CN112364860A (en) Training method and device of character recognition model and electronic equipment
CN111341308A (en) Method and apparatus for outputting information
CN111897950A (en) Method and apparatus for generating information
CN111414471B (en) Method and device for outputting information
CN116894188A (en) Service tag set updating method and device, medium and electronic equipment
CN115270717A (en) Method, device, equipment and medium for detecting vertical position
CN113051933B (en) Model training method, text semantic similarity determination method, device and equipment
CN110827085A (en) Text processing method, device and equipment
CN117131281B (en) Public opinion event processing method, apparatus, electronic device and computer readable medium
CN112380883B (en) Model training method, machine translation method, device, equipment and storage medium
CN111382262B (en) Method and device for outputting information
CN116186545A (en) Training and application methods and devices of pre-training model, electronic equipment and medium
CN113988027A (en) Text generation method, device, equipment and storage medium
CN110377842A (en) Voice remark display methods, system, medium and electronic equipment
CN115563281A (en) Text classification method and device based on text data enhancement
CN111339770B (en) Method and device for outputting information
CN110852043B (en) Text transcription method, device, equipment and storage medium
CN111027332B (en) Method and device for generating translation model
CN111581381B (en) Method and device for generating training set of text classification model and electronic equipment
CN111382365A (en) Method and apparatus for outputting information
CN111597441A (en) Information processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination