CN112036155A - Text generation method, text generation device and computer readable storage medium - Google Patents
Text generation method, text generation device and computer readable storage medium Download PDFInfo
- Publication number
- CN112036155A CN112036155A CN202011027336.9A CN202011027336A CN112036155A CN 112036155 A CN112036155 A CN 112036155A CN 202011027336 A CN202011027336 A CN 202011027336A CN 112036155 A CN112036155 A CN 112036155A
- Authority
- CN
- China
- Prior art keywords
- text
- target
- rhetorical
- target position
- model
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/211—Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
- G06F40/35—Discourse or dialogue representation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/088—Non-supervised learning, e.g. competitive learning
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computing Systems (AREA)
- Evolutionary Computation (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Medical Informatics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Machine Translation (AREA)
Abstract
本公开涉及一种文本生成方法、文本生成装置及计算机可读存储介质。方法包括:获取目标文本;确定所述目标文本中待插入修辞文本的目标位置;根据处于所述目标位置的预设范围内的文本的语义,生成所述修辞文本;将所述修辞文本插入至所述目标位置。如此,无需用户输入本体和喻体即可自动生成修辞文本,使得生成的修辞文本更加多样,提高了生成修辞文本的智能化程度。并且,在生成修辞文本时参考了处于目标位置的预设范围内的文本的语义,使得生成的修辞文本的语义与目标位置的预设范围内的文本的语义较为匹配,提高了对目标文本修饰的准确度,从而提高了修饰后的文本的信息量。
The present disclosure relates to a text generation method, a text generation device, and a computer-readable storage medium. The method includes: acquiring target text; determining a target position in the target text where rhetorical text is to be inserted; generating the rhetorical text according to the semantics of the text within a preset range of the target position; inserting the rhetorical text into the target location. In this way, the rhetorical text can be automatically generated without the need for the user to input the ontology and the metaphor, which makes the generated rhetorical text more diverse and improves the intelligence of the generated rhetorical text. In addition, when generating rhetorical text, the semantics of the text within the preset range of the target position are referred to, so that the semantics of the generated rhetorical text is more matched with the semantics of the text within the preset range of the target position, and the modification of the target text is improved. accuracy, thereby improving the information content of the modified text.
Description
技术领域technical field
本公开涉及计算机技术领域,尤其涉及一种文本生成方法、文本生成装置及计算机可读存储介质。The present disclosure relates to the field of computer technologies, and in particular, to a text generation method, a text generation device, and a computer-readable storage medium.
背景技术Background technique
随着科学技术的飞速发展,大量先进技术不断涌现,自然语言处理技术即为其中一个重要的技术。在自然语言处理技术的广泛应用中,自动生成文本成为一个研究的热点问题。文本生成在人工智能、神经网络的发展下有了长足的进展,如自动摘要生成、自动标题生成、AI写诗、人机对话、文本风格转换、故事生成等等。而对于人类语言写作技巧的自动化使用却少有研究或产品涉及。With the rapid development of science and technology, a large number of advanced technologies continue to emerge, and natural language processing technology is one of the important technologies. In the wide application of natural language processing technology, automatic text generation has become a hot research topic. Text generation has made great progress under the development of artificial intelligence and neural networks, such as automatic summary generation, automatic title generation, AI poetry writing, human-computer dialogue, text style conversion, story generation, etc. There is little research or product coverage on the automated use of human language writing skills.
在相关技术中,在学界中围绕故事生成(story generation)的任务,有着许多相关研究。其中,故事生成即是使用encoder-decoder框架模型,给定一段文本作为开头输入模型,模型就会继续生成一段合适的故事展开文本或结尾文本。其中,模型在生成故事展开文本或结尾文本时刻结合相应情感、主人公设定、指示图谱作为额外输入,增强辅助故事生成的结果。In the related art, there are many related studies in the academic circle around the task of story generation. Among them, the story generation uses the encoder-decoder framework model. Given a piece of text as the starting input model, the model will continue to generate a suitable story expansion text or ending text. Among them, the model combines the corresponding emotion, protagonist setting, and instruction map as additional input at the moment of generating the unfolding text or ending text of the story to enhance the results of auxiliary story generation.
上述用于故事生成的模型或多或少会生成一些包含有修饰性语句的句子,但是其缺点很明显:在于端到端生成,对于使用什么样的修辞写作手法,完全不可控。另外,现有的端到端方法生成比喻的技术,输入必须为一对比喻的本体和喻体,模型才能针对性生成相应的比喻文本。换言之,该技术仅限于给定本体和喻体的比喻文本的生成。并且,利用该技术生成比喻文本时并不参考上下文语义,无法保证所生成的文本忠于原文。The above model for story generation will more or less generate some sentences containing modified sentences, but its shortcomings are obvious: it is end-to-end generation, and it is completely uncontrollable about what kind of rhetorical writing technique is used. In addition, for the existing end-to-end method to generate metaphors, the input must be a pair of metaphor ontology and metaphor, so that the model can generate the corresponding metaphor text. In other words, the technique is limited to the generation of figurative texts given an ontology and a metaphor. Moreover, when using this technology to generate figurative text, it does not refer to contextual semantics, and it cannot guarantee that the generated text is faithful to the original text.
发明内容SUMMARY OF THE INVENTION
为克服相关技术中存在的问题,本公开提供一种文本生成方法、文本生成装置及计算机可读存储介质。To overcome the problems existing in the related art, the present disclosure provides a text generation method, a text generation device and a computer-readable storage medium.
根据本公开实施例的第一方面,提供一种文本生成方法,包括:According to a first aspect of the embodiments of the present disclosure, there is provided a text generation method, including:
获取目标文本;get the target text;
确定所述目标文本中待插入修辞文本的目标位置;determining the target position of the rhetorical text to be inserted in the target text;
根据处于所述目标位置的预设范围内的文本的语义,生成所述修辞文本;generating the rhetorical text according to the semantics of the text within the preset range of the target position;
将所述修辞文本插入至所述目标位置。Inserting the rhetorical text into the target location.
可选地,所述确定所述目标文本中待插入修辞文本的目标位置,包括:Optionally, the determining the target position of the rhetorical text to be inserted in the target text includes:
对所述目标文本进行分词处理,得到所述目标文本的分词结果,其中,所述分词结果包括各分词以及分词所在的位置;Perform word segmentation processing on the target text to obtain a word segmentation result of the target text, wherein the word segmentation result includes each word segmentation and the location of the word segmentation;
将所述分词结果输入至修饰概率预测模型,得到所述修饰概率预测模型输出的各位置对应的修饰概率,其中,位置对应的修饰概率用于表征在所述位置处插入待生成的所述修辞文本的概率;The word segmentation result is input into the modification probability prediction model, and the modification probability corresponding to each position output by the modification probability prediction model is obtained, wherein the modification probability corresponding to the position is used to indicate that the rhetoric to be generated is inserted at the position the probability of the text;
将最大修饰概率对应的位置确定为所述目标位置。The position corresponding to the maximum modification probability is determined as the target position.
可选地,所述根据处于所述目标位置的预设范围内的文本的语义,生成所述修辞文本,包括:Optionally, generating the rhetorical text according to the semantics of the text within the preset range of the target position includes:
根据处于所述目标位置的预设范围内的文本的语义,确定所述目标位置对应的语义向量;determining the semantic vector corresponding to the target position according to the semantics of the text within the preset range of the target position;
根据所述语义向量生成所述修辞文本。The rhetorical text is generated from the semantic vector.
可选地,所述根据所述语义向量生成所述修辞文本,包括:Optionally, the generating the rhetorical text according to the semantic vector includes:
将所述语义向量输入至文本生成模型中,得到所述文本生成模型输出的所述修辞文本。The semantic vector is input into a text generation model to obtain the rhetorical text output by the text generation model.
可选地,所述文本生成模型包括修辞类型生成子模型和修辞文本生成子模型;Optionally, the text generation model includes a rhetorical type generation sub-model and a rhetorical text generation sub-model;
所述将所述语义向量输入至文本生成模型中,得到所述文本生成模型输出的所述修辞文本,包括:The inputting the semantic vector into the text generation model to obtain the rhetorical text output by the text generation model includes:
将所述语义向量输入至所述修辞类型生成子模型,得到所述修辞类型生成子模型输出的待生成的所述修辞文本的修辞类型向量;inputting the semantic vector into the rhetoric type generation sub-model, to obtain the rhetorical type vector of the rhetorical text to be generated output by the rhetoric type generation sub-model;
将所述语义向量和所述修辞类型向量输入至所述修辞文本生成子模型,得到所述修辞文本生成子模型输出的所述修辞文本。Inputting the semantic vector and the rhetorical type vector into the rhetorical text generation sub-model to obtain the rhetorical text output by the rhetorical text generation sub-model.
可选地,所述文本生成模型通过以下方式得到:Optionally, the text generation model is obtained by:
获取去除修辞文本后的原始文本,以及去除的所述修辞文本在所述原始文本中的位置对应的语义向量;obtaining the original text after removing the rhetorical text, and the semantic vector corresponding to the position of the removed rhetorical text in the original text;
将所述位置对应的语义向量作为模型输入参数,将去除的所述修辞文本作为模型输出参数,对神经网络进行训练,以获得所述文本生成模型。The semantic vector corresponding to the position is used as the model input parameter, and the removed rhetorical text is used as the model output parameter, and the neural network is trained to obtain the text generation model.
可选地,所述方法应用于服务器,所述服务器运行有修饰概率预测模型以及文本生成模型;Optionally, the method is applied to a server, and the server runs a modified probability prediction model and a text generation model;
所述获取目标文本包括:所述服务器获取客户端上传的目标文本;The obtaining the target text includes: obtaining, by the server, the target text uploaded by the client;
所述确定所述目标文本中待插入修辞文本的目标位置,包括:所述服务器对所述目标文本进行分词处理,得到所述目标文本的分词结果,并调用所述修饰概率预测模型对所述分词结果进行处理,得到各分词所在的位置对应的修饰概率,并将最大修饰概率对应的位置确定为所述目标位置;The determining of the target position of the rhetorical text to be inserted in the target text includes: the server performs a word segmentation process on the target text, obtains a word segmentation result of the target text, and invokes the modification probability prediction model to perform a word segmentation on the target text. The word segmentation result is processed to obtain the modification probability corresponding to the position of each word segmentation, and the position corresponding to the maximum modification probability is determined as the target position;
所述根据处于所述目标位置的预设范围内的文本的语义,生成所述修辞文本,包括:所述服务器根据处于所述目标位置的预设范围内的文本的语义,确定所述目标位置对应的语义向量,并调用所述文本生成模型对所述语义向量进行处理,得到所述修辞文本;The generating the rhetorical text according to the semantics of the text within the preset range of the target position includes: the server determining the target position according to the semantics of the text within the preset range of the target position corresponding semantic vector, and call the text generation model to process the semantic vector to obtain the rhetorical text;
所述方法还包括:所述服务器在将所述修辞文本插入至所述目标位置后,将包括所述修辞文本的新的文本发送给所述客户端。The method further includes: after the server inserts the rhetorical text into the target position, sending a new text including the rhetorical text to the client.
根据本公开实施例的第二方面,提供一种文本生成装置,包括:According to a second aspect of the embodiments of the present disclosure, there is provided a text generation apparatus, including:
第一获取模块,被配置为获取目标文本;a first obtaining module, configured to obtain the target text;
第一确定模块,被配置为确定所述目标文本中待插入修辞文本的目标位置;a first determining module, configured to determine a target position in the target text where the rhetorical text is to be inserted;
生成模块,被配置为根据处于所述目标位置的预设范围内的文本的语义,生成所述修辞文本;a generating module configured to generate the rhetorical text according to the semantics of the text within the preset range of the target position;
插入模块,被配置为将所述修辞文本插入至所述目标位置。An insertion module configured to insert the rhetorical text into the target location.
可选地,所述第一确定模块包括:Optionally, the first determining module includes:
分词处理子模块,被配置为对所述目标文本进行分词处理,得到所述目标文本的分词结果,其中,所述分词结果包括各分词以及分词所在的位置;A word segmentation processing submodule, configured to perform word segmentation processing on the target text to obtain a word segmentation result of the target text, wherein the word segmentation result includes each word segmentation and the location of the word segmentation;
第一输入子模块,被配置为将所述分词结果输入至修饰概率预测模型,得到所述修饰概率预测模型输出的各位置对应的修饰概率,其中,位置对应的修饰概率用于表征在所述位置处插入待生成的所述修辞文本的概率;The first input sub-module is configured to input the word segmentation result into the modification probability prediction model, and obtain the modification probability corresponding to each position output by the modification probability prediction model, wherein the modification probability corresponding to the position is used to characterize the modification probability in the modification probability prediction model. the probability of inserting the rhetorical text to be generated at the position;
第一确定子模块,被配置为将最大修饰概率对应的位置确定为所述目标位置。The first determination submodule is configured to determine the position corresponding to the maximum modification probability as the target position.
可选地,所述生成模块包括:Optionally, the generation module includes:
第二确定子模块,被配置为根据处于所述目标位置的预设范围内的文本的语义,确定所述目标位置对应的语义向量;a second determination submodule, configured to determine a semantic vector corresponding to the target position according to the semantics of the text within the preset range of the target position;
生成子模块,被配置为根据所述语义向量生成所述修辞文本。A generating submodule is configured to generate the rhetorical text according to the semantic vector.
可选地,所述生成子模块包括:Optionally, the generating submodule includes:
第二输入子模块,被配置为将所述语义向量输入至文本生成模型中,得到所述文本生成模型输出的所述修辞文本。The second input sub-module is configured to input the semantic vector into a text generation model to obtain the rhetorical text output by the text generation model.
可选地,所述文本生成模型包括修辞类型生成子模型和修辞文本生成子模型;Optionally, the text generation model includes a rhetorical type generation sub-model and a rhetorical text generation sub-model;
所述第二输入子模块,包括:The second input submodule includes:
第三输入子模块,被配置为将所述语义向量输入至所述修辞类型生成子模型,得到所述修辞类型生成子模型输出的待生成的所述修辞文本的修辞类型向量;a third input sub-module, configured to input the semantic vector into the rhetoric type generation sub-model, to obtain a rhetorical type vector of the rhetorical text to be generated output by the rhetoric type generation sub-model;
第四输入子模块,被配置为将所述语义向量和所述修辞类型向量输入至所述修辞文本生成子模型,得到所述修辞文本生成子模型输出的所述修辞文本。The fourth input sub-module is configured to input the semantic vector and the rhetorical type vector into the rhetorical text generation sub-model to obtain the rhetorical text output by the rhetorical text generation sub-model.
可选地,所述装置还包括:Optionally, the device further includes:
第一获取模块,被配置为获取去除修辞文本后的原始文本,以及去除的所述修辞文本在所述原始文本中的位置对应的语义向量;a first obtaining module, configured to obtain the original text after removing the rhetorical text, and the semantic vector corresponding to the position of the removed rhetorical text in the original text;
训练模块,被配置为将所述位置对应的语义向量作为模型输入参数,将去除的所述修辞文本作为模型输出参数,对神经网络进行训练,以获得所述文本生成模型。The training module is configured to use the semantic vector corresponding to the position as a model input parameter, and use the removed rhetorical text as a model output parameter to train a neural network to obtain the text generation model.
可选地,所述装置应用于服务器,所述服务器运行有修饰概率预测模型以及文本生成模型;Optionally, the apparatus is applied to a server, and the server runs a modified probability prediction model and a text generation model;
所述第一获取模块被配置为:所述服务器获取客户端上传的目标文本;The first obtaining module is configured to: the server obtains the target text uploaded by the client;
所述第一确定模块被配置为:所述服务器对所述目标文本进行分词处理,得到所述目标文本的分词结果,并调用所述修饰概率预测模型对所述分词结果进行处理,得到各分词所在的位置对应的修饰概率,并将最大修饰概率对应的位置确定为所述目标位置;The first determining module is configured to: the server performs word segmentation processing on the target text, obtains a word segmentation result of the target text, and invokes the modification probability prediction model to process the word segmentation result, and obtains each word segmentation The modification probability corresponding to the position where it is located, and the position corresponding to the maximum modification probability is determined as the target position;
所述生成模块被配置为:所述服务器根据处于所述目标位置的预设范围内的文本的语义,确定所述目标位置对应的语义向量,并调用所述文本生成模型对所述语义向量进行处理,得到所述修辞文本;The generation module is configured to: the server determines a semantic vector corresponding to the target position according to the semantics of the text within the preset range of the target position, and invokes the text generation model to perform a function on the semantic vector. processing to obtain the rhetorical text;
所述装置还包括:The device also includes:
发送模块,被配置为所述服务器在将所述修辞文本插入至所述目标位置后,将包括所述修辞文本的新的文本发送给所述客户端。The sending module is configured to send the new text including the rhetorical text to the client after the server inserts the rhetorical text into the target position.
根据本公开实施例的第三方面,提供一种文本装置,包括:According to a third aspect of the embodiments of the present disclosure, there is provided a text device, comprising:
处理器;processor;
用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;
其中,所述处理器被配置为:wherein the processor is configured to:
获取目标文本;get the target text;
确定所述目标文本中待插入修辞文本的目标位置;determining the target position of the rhetorical text to be inserted in the target text;
根据处于所述目标位置的预设范围内的文本的语义,生成所述修辞文本;generating the rhetorical text according to the semantics of the text within the preset range of the target position;
将所述修辞文本插入至所述目标位置。Inserting the rhetorical text into the target location.
根据本公开实施例的第四方面,提供一种计算机可读存储介质,其上存储有计算机程序指令,该程序指令被处理器执行时实现本公开第一方面所提供的文本生成方法的步骤。According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium on which computer program instructions are stored, and when the program instructions are executed by a processor, implement the steps of the text generation method provided in the first aspect of the present disclosure.
本公开的实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
采用上述技术方案,首先,确定目标文本中待插入修辞文本的目标位置,接着,根据处于目标位置的预设范围内的文本的语义,生成修辞文本,最后,将所生成的修辞文本插入至目标位置。如此,无需用户输入本体和喻体即可自动生成修辞文本,使得生成的修辞文本更加多样,提高了生成修辞文本的智能化程度。并且,在生成修辞文本时参考了处于目标位置的预设范围内的文本的语义,使得生成的修辞文本的语义与目标位置的预设范围内的文本的语义较为匹配,提高了对目标文本修饰的准确度,从而提高了修饰后的文本的信息量。By adopting the above technical solution, first, the target position in the target text where the rhetorical text is to be inserted is determined, then the rhetorical text is generated according to the semantics of the text within the preset range of the target position, and finally, the generated rhetorical text is inserted into the target Location. In this way, the rhetorical text can be automatically generated without the need for the user to input the ontology and the metaphor, which makes the generated rhetorical text more diverse and improves the intelligence of the generated rhetorical text. In addition, when generating rhetorical text, the semantics of the text within the preset range of the target position are referred to, so that the semantics of the generated rhetorical text is more matched with the semantics of the text within the preset range of the target position, and the modification of the target text is improved. accuracy, thereby improving the information content of the modified text.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.
图1是相关技术中生成比喻文本的模型的示意图。FIG. 1 is a schematic diagram of a model for generating figurative text in the related art.
图2是根据一示例性实施例示出的一种文本生成方法的流程图。Fig. 2 is a flow chart of a text generation method according to an exemplary embodiment.
图3是图2所示实施例示出的一种步骤S12的流程图。FIG. 3 is a flowchart of step S12 shown in the embodiment shown in FIG. 2 .
图4是图2所示实施例示出的一种步骤S13的流程图。FIG. 4 is a flowchart of step S13 shown in the embodiment shown in FIG. 2 .
图5是根据一示例性实施例示出的一种获得修辞文本方法的流程图。Fig. 5 is a flow chart of a method for obtaining rhetorical text according to an exemplary embodiment.
图6是根据一示例性实施例示出的一种文本生成方法中客户端与服务器之间的交互图。Fig. 6 is an interaction diagram between a client and a server in a text generation method according to an exemplary embodiment.
图7是根据一示例性实施例示出的一种文本生成装置的框图。Fig. 7 is a block diagram of a text generating apparatus according to an exemplary embodiment.
图8是根据一示例性实施例示出的一种文本生成装置的框图。Fig. 8 is a block diagram of a text generating apparatus according to an exemplary embodiment.
图9是根据一示例性实施例示出的一种文本生成装置的框图。Fig. 9 is a block diagram of a text generating apparatus according to an exemplary embodiment.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as recited in the appended claims.
在无条件式(不结合上下文语义)的比喻文本的生成方式中,采用前后向生成策略。示例地,生成比喻文本的模型可以包括backward模型和forward模型。首先使用backward模型向前生成句子直到句首;之后使用forward模型向后生成句子直到句尾。In the generation of unconditional (without contextual semantics) figurative text, the forward and backward generation strategy is adopted. Illustratively, models for generating figurative text may include backward models and forward models. First, the backward model is used to generate sentences forward until the beginning of the sentence; then the forward model is used to generate sentences backward until the end of the sentence.
图1是相关技术中生成比喻文本的模型的示意图。如图1所示,输入为一对本体和喻体,其中,本体为“enjoyed”,喻体为“devoured”。首先,backward模型向前生成至句首后结束。在图1中,在backward模型中,在α项中预测句首为“fire”的概率为0.4,为“she”的概率为0.3,为“flood”的概率为0.1,在β项中预测句首为“fire”的概率为0.1,为“she”的概率为0.4,为“flood”的概率为0.01,综合α项和β项结果,最终得到句首为“she”。此时句子为“shedevoured”和“sheenjoyed”。FIG. 1 is a schematic diagram of a model for generating figurative text in the related art. As shown in Figure 1, the input is a pair of ontology and metaphor, where the ontology is "enjoyed" and the metaphor is "devoured". First, the backward model is generated forward to the end of the sentence. In Figure 1, in the backward model, the probability of predicting the sentence head as "fire" in the α term is 0.4, the probability of "she" is 0.3, the probability of "flood" is 0.1, and the probability of predicting the sentence in the beta term is 0.4. The probability of the first being "fire" is 0.1, the probability of being "she" is 0.4, and the probability of being "flood" is 0.01. Combining the results of the α term and the β term, the final sentence start is "she". At this point the sentences are "shedevoured" and "sheenjoyed".
之后,使用forward模型向后生成句子直到句尾。如图1所示,在forward模型中分别输入句子“shedevoured”和句子“she enjoyed”,forward模型依次生成文本“his”、“novels”,并在生成“novels”后结束。最终生成句子为“she devoured his novel”,即是用“devoured”隐喻“enjoyed”。After that, the forward model is used to generate sentences backwards until the end of the sentence. As shown in Figure 1, the sentence "shedevoured" and the sentence "she enjoyed" are entered in the forward model respectively, and the forward model generates the text "his" and "novels" in turn, and ends after generating "novels". The final generated sentence is "she devoured his novel", that is, using "devoured" as a metaphor for "enjoyed".
在生成比喻文本的相关技术方式,需要用户输入本体和喻体,无法在未给定本体和喻体的条件下自动生成修辞文本,导致文本生成的智能化程度较低。并且,在生成比喻文本时参考上下文语义,可能会导致生成的比喻文本不能较好地与上下文匹配。In the related technical way of generating figurative text, the user needs to input ontology and figurative body, and rhetorical text cannot be automatically generated without given ontology and figurative body, resulting in a low degree of intelligence in text generation. Moreover, referring to context semantics when generating figurative text may result in that the generated figurative text cannot match the context well.
鉴于此,本公开提供一种文本生成方法、文本生成装置及计算机可读存储介质。In view of this, the present disclosure provides a text generation method, a text generation apparatus, and a computer-readable storage medium.
在详细介绍本公开提供的文本生成方法、文本生成装置及计算机可读存储介质之前,首先对本公开所涉及应用场景进行介绍。在第一种实施例中,该应用场景可以是客户端为目标文本生成修辞文本的场景。该客户端例如可以为智能手机、平板电脑、智能手表、智能手环、PDA(英文:PersonalDigitalAssistant,中文:个人数字助理)等移动终端,也可以是台式计算机等固定终端。在第二种实施例中,该应用场景是用户通过客户端输入目标文本,服务器从客户端中接收到目标文本,并为该目标文本生成修辞文本的场景。其中,服务器可以用独立的服务器或者是多个物理服务器组成的服务器集群来实现。Before introducing the text generation method, text generation device, and computer-readable storage medium provided by the present disclosure in detail, the application scenarios involved in the present disclosure are first introduced. In the first embodiment, the application scenario may be a scenario in which the client generates rhetorical text for the target text. The client can be, for example, a mobile terminal such as a smart phone, a tablet computer, a smart watch, a smart bracelet, a PDA (English: Personal Digital Assistant, Chinese: Personal Digital Assistant), or a fixed terminal such as a desktop computer. In the second embodiment, the application scenario is a scenario in which the user inputs target text through the client, the server receives the target text from the client, and generates rhetorical text for the target text. The server may be implemented by an independent server or a server cluster composed of multiple physical servers.
图2是根据一示例性实施例示出的一种文本生成方法的流程图,如图1所示,该文本生成方法可以包括以下步骤。Fig. 2 is a flowchart of a text generation method according to an exemplary embodiment. As shown in Fig. 1 , the text generation method may include the following steps.
在步骤S11中,获取目标文本。In step S11, the target text is acquired.
在本公开中,目标文本可以为需要利用修辞文本进行修饰的文本。例如,该目标文本可以为小说作家写好的相对简单直白的叙述文字。此外,目标文本可以为句子、词语和段落等中的至少一者。本公开并不限制目标文本的长度。In the present disclosure, the target text may be text that needs to be modified with rhetorical text. For example, the target text may be relatively simple and straightforward narrative text written by a novelist. Also, the target text may be at least one of sentences, words, paragraphs, and the like. The present disclosure does not limit the length of the target text.
在可能的一种实施例中,目标文本可以是待生成的文学作品中的语句。其中,文学作品是指以语言文字为工具,形象化地反映客观现实或表现作家心灵世界的艺术作品。文学作品可以包括诗歌、散文、小说、剧本、寓言和童话等中的至少一种。In a possible embodiment, the target text may be a sentence in a literary work to be generated. Among them, literary works refer to works of art that use language as a tool to visually reflect objective reality or express the spiritual world of writers. Literary works may include at least one of poems, essays, novels, plays, fables, fairy tales, and the like.
值得说明的是,在本公开中,待生成的文学作品是指包括目标文本但尚未完全生成的文学作品。本申请各实施例中的文本生成方法就用于对目标文本进行自动修饰润色,以实现对该文学作品的创作。而并非是己知一个既有的文学作品的目标文本,查询该既有的文学作品中的修辞文本。It is worth noting that, in the present disclosure, a literary work to be generated refers to a literary work that includes the target text but has not been completely generated. The text generation method in each embodiment of the present application is used to automatically modify and polish the target text, so as to realize the creation of the literary work. Instead of knowing the target text of an existing literary work, query the rhetorical text in the existing literary work.
在可能的另一种实施例中,该目标文本可以是对话交流中的语句。In another possible embodiment, the target text may be a sentence in a dialogue exchange.
值得说明的是,在上述第一种实施例示出的应用场景中,客户端具有可编辑文字的功能,用户可以直接在客户端中编辑一段相对简单直白的叙述文本,如此,客户端即可获取到目标文本。或者,用户在其他可编辑文本的设备中输入目标文本,之后,通过该设备将所编辑的目标文本发送给客户端,以使客户端接收到目标文本,并基于该目标文本执行后续的生成修辞文本和插入修辞文本的步骤。It is worth noting that, in the application scenario shown in the above-mentioned first embodiment, the client has the function of editing text, and the user can directly edit a relatively simple and straightforward narrative text in the client. In this way, the client can Get the target text. Or, the user inputs the target text in other text-editable devices, and then sends the edited target text to the client through the device, so that the client receives the target text and performs subsequent generation rhetoric based on the target text Text and steps to insert rhetorical text.
在上述第二种实施例示出的应用场景中,客户端与服务器通信连接,用户在客户端中编辑一段相对简单直白的叙述文本,之后,该客户端将该文本发送给服务器,如此,服务器即可接收到目标文本,并基于该目标文本执行后续的生成修辞文本和插入修辞文本的步骤。In the application scenario shown in the second embodiment above, the client is connected to the server in communication, the user edits a relatively simple and straightforward narrative text in the client, and then the client sends the text to the server. In this way, the server The target text can be received, and the subsequent steps of generating rhetorical text and inserting rhetorical text are performed based on the target text.
在步骤S12中,确定目标文本中待插入修辞文本的目标位置。In step S12, the target position of the rhetorical text to be inserted in the target text is determined.
在本公开中,目标位置是指所生成的修辞文本要插入的位置,也即是,该位于目标位置之前的文本或者之后的文本需要采用修辞手法进行修饰。其中,待插入修辞文本的目标位置可以为目标文本中的任一位置。例如,该目标位置可以为目标文本中的句首位置、句中位置、或者句尾位置。本公开对此不作具体限定。In the present disclosure, the target position refers to the position where the generated rhetorical text is to be inserted, that is, the text located before or after the target position needs to be modified using rhetorical devices. The target position where the rhetorical text is to be inserted may be any position in the target text. For example, the target position may be the position at the beginning of the sentence, the position in the middle of the sentence, or the position at the end of the sentence in the target text. This disclosure does not specifically limit this.
在步骤S13中,根据处于目标位置的预设范围内的文本的语义,生成修辞文本。In step S13, rhetorical text is generated according to the semantics of the text within the preset range of the target position.
本公开所生成的修辞文本是为了对目标文本中的词句进行修饰,以使修饰后的词句能准确形象地表达客观现实或表现作家的心灵世界,因此,在本公开中,需要根据处于目标位置的预设范围内的文本的语义,生成修辞文本,以使修辞文本的语义与目标位置的预设范围内的文本的语义相匹配。其中,预设范围可以是目标位置的前一位置至目标位置的后一位置,也可以是目标位置的前一位置至目标位置,还可以是目标位置至目标位置的后一位置。需要说明的是,还可以是前或后多个位置,例如,目标位置为5,该预设范围可以为[2,8]等等。The rhetorical text generated in the present disclosure is to modify the words and sentences in the target text, so that the modified words and sentences can accurately and vividly express the objective reality or the spiritual world of the writer. Therefore, in the present disclosure, it is necessary to The rhetorical text is generated so that the semantics of the rhetorical text matches the semantics of the text within the preset range of the target location. The preset range may be from the previous position of the target position to the next position of the target position, or from the previous position of the target position to the target position, or from the target position to the next position of the target position. It should be noted that there may also be multiple front or rear positions, for example, if the target position is 5, the preset range may be [2, 8] and so on.
在步骤14中,将修辞文本插入至目标位置。In step 14, the rhetorical text is inserted at the target location.
在生成修辞文本之后,将修辞文本插入至目标位置,以使修辞文本以更贴切地表达出目标文本的意思。After the rhetorical text is generated, the rhetorical text is inserted into the target position, so that the rhetorical text can express the meaning of the target text more appropriately.
采用上述技术方案,首先,确定目标文本中待插入修辞文本的目标位置,接着,根据处于目标位置的预设范围内的文本的语义,生成修辞文本,最后,将所生成的修辞文本插入至目标位置。如此,无需用户输入本体和喻体即可自动生成修辞文本,使得生成的修辞文本更加多样,提高了生成修辞文本的智能化程度。并且,在生成修辞文本时参考了处于目标位置的预设范围内的文本的语义,使得生成的修辞文本的语义与目标位置的预设范围内的文本的语义较为匹配,提高了对目标文本修饰的准确度,从而提高了修饰后的文本的信息量。By adopting the above technical solution, first, the target position in the target text where the rhetorical text is to be inserted is determined, then the rhetorical text is generated according to the semantics of the text within the preset range of the target position, and finally, the generated rhetorical text is inserted into the target Location. In this way, the rhetorical text can be automatically generated without the need for the user to input the ontology and the metaphor, which makes the generated rhetorical text more diverse and improves the intelligence of the generated rhetorical text. In addition, when generating rhetorical text, the semantics of the text within the preset range of the target position are referred to, so that the semantics of the generated rhetorical text is more matched with the semantics of the text within the preset range of the target position, and the modification of the target text is improved. accuracy, thereby improving the information content of the modified text.
为了便于本领域技术人员更好的理解本公开所提供的文本生成方法,下面以一个完整的实施例进行说明。In order to facilitate those skilled in the art to better understand the text generation method provided by the present disclosure, a complete example will be described below.
首先,对确定目标文本中待插入修辞文本的目标位置的具体实施方式进行说明。First, the specific implementation of determining the target position of the rhetorical text to be inserted in the target text will be described.
在一种实施例中,用户在目标文本中确定出目标位置并输入该目标位置,如此,执行该文本生成方法的设备确定目标位置。In one embodiment, the user determines the target position in the target text and inputs the target position, so that the device executing the text generation method determines the target position.
在另一种实施例中,可以通过机器学习的方式预测目标位置。示例地,图3是图2所示实施例示出的一种步骤S12的流程图。如图2所示,步骤S12可以包括以下步骤。In another embodiment, the target location can be predicted by means of machine learning. For example, FIG. 3 is a flowchart of step S12 shown in the embodiment shown in FIG. 2 . As shown in FIG. 2 , step S12 may include the following steps.
在步骤S121中,对目标文本进行分词处理,得到目标文本的分词结果,其中,分词结果包括各分词以及分词所在的位置。In step S121, a word segmentation process is performed on the target text to obtain a word segmentation result of the target text, wherein the word segmentation result includes each word segment and the location where the word segment is located.
可以采用相关技术中的分词技术对目标进行分词,本公开对分词处理的具体方式不作限制。The word segmentation technology in the related art can be used to segment the target, and the present disclosure does not limit the specific manner of the word segmentation processing.
在一种可能的方式中,目标文本为中文文本,在对中文文本进行分词处理之后,中文文本中的每一字符均为一分词。例如,目标文本为“我今天吃了晚饭,感觉很好吃。”分词处理后的分词为“我/今/天/吃/了/晚/饭/,/感/觉/很/好/吃/。”各分词所在的位置依次为1至14,即,分词“我”在目标文本中的位置为1,“今”在目标文本中的位置为2,……“。”在目标文本中的位置为14。In a possible manner, the target text is Chinese text, and after word segmentation processing is performed on the Chinese text, each character in the Chinese text is a word segment. For example, the target text is "I ate dinner today, and it feels delicious." The participle after word segmentation is "I/today/day/eat/dine/dinner/meal/, /feeling/feeling/very/good/eat /." The position of each participle is from 1 to 14, that is, the position of the participle "I" in the target text is 1, the position of "Jin" in the target text is 2, ... "." in the target text The position is 14.
在步骤122中,将分词结果输入至修饰概率预测模型,得到修饰概率预测模型输出的各位置对应的修饰概率,其中,位置对应的修饰概率用于表征在位置处插入待生成的修辞文本的概率。In step 122, the word segmentation result is input into the modification probability prediction model, and the modification probability corresponding to each position output by the modification probability prediction model is obtained, wherein the modification probability corresponding to the position is used to represent the probability of inserting the rhetorical text to be generated at the position .
修饰概率预测模型为预先训练得到的模型,并且,可以通过以下训练方式得到:首先,针对每一样本目标文本,获取该样本目标文本的样本分词结果,以及各分词所在位置对应的修饰概率标签。之后,将样本分词结果作为模型输入参数,将各位置对应的修饰概率作为模型输出参数,对神经网络进行训练,得到修饰概率预测模型。The modification probability prediction model is a model obtained by pre-training, and can be obtained by the following training methods: first, for each sample target text, obtain the sample word segmentation result of the sample target text, and the modification probability label corresponding to the position of each word segmentation. After that, the sample word segmentation result is used as the model input parameter, and the modification probability corresponding to each position is used as the model output parameter, and the neural network is trained to obtain the modification probability prediction model.
考虑到BERT(Bidirectional Encoder Representation from Transformers)性能效果强大,并且通过无监督的训练方式在大规模语料中进行预训练,能够更好的适配缺乏标注数据的下游任务,例如,自动修饰润色文本等,因此,在一种优选地方式中,可以采用BERT作为修饰概率预测模型。具体的训练方式可参照现有的神经网络模型的训练方式,此处不作限制。Considering the powerful performance of BERT (Bidirectional Encoder Representation from Transformers), and pre-training in large-scale corpus through unsupervised training, it can better adapt to downstream tasks that lack labeled data, such as automatic modification of text, etc. , therefore, in a preferred manner, BERT can be used as the modification probability prediction model. The specific training method may refer to the training method of the existing neural network model, which is not limited here.
分词所在位置对应的修饰概率标签可以向量形式表达,并且,在该向量中只有用户标注的需要插入修辞文本的位置对应的修饰概率为1,其他位置对应的修饰概率均为0。The modification probability label corresponding to the position of the word segmentation can be expressed in the form of a vector, and in the vector, only the position marked by the user that needs to be inserted into the rhetorical text corresponds to the modification probability of 1, and the modification probability corresponding to other positions is 0.
在训练得到修饰概率预测模型之后,只需将目标文本的分词结果输入至该修饰概率预测模型,即可得到该修饰概率预测模型输出的各位置对应的修饰概率。After the modification probability prediction model is obtained by training, the modification probability corresponding to each position output by the modification probability prediction model can be obtained by simply inputting the word segmentation result of the target text into the modification probability prediction model.
值得说明的是,还可以将分词结果进行编码,编码出长度为L的向量序列,其中,长度L等于位置数量,例如,分词结果包括的位置为1至14,则编码得到的向量序列的长度L即为14。此外,在修饰概率预测模型中可以采用Softmax函数得到长度为L的概率向量。It is worth noting that the word segmentation result can also be encoded to encode a vector sequence of length L, where the length L is equal to the number of positions. For example, if the word segmentation result includes positions 1 to 14, then the length of the encoded vector sequence is L is 14. In addition, the Softmax function can be used to obtain a probability vector of length L in the modified probability prediction model.
在步骤123中,将位置中最大修饰概率对应的位置确定为目标位置。In step 123, the position corresponding to the maximum modification probability among the positions is determined as the target position.
如上所述,位置对应的修饰概率用于表征在位置处插入待生成的修辞文本的概率,某一位置对应的概率值越大表征在该位置插入修辞文本的概率就越大,因此,在本公开中,在得到各位置对应的修饰概率之后,比较各修饰概率的大小,将位置中最大修饰概率对应的位置确定为目标位置。As mentioned above, the modification probability corresponding to the position is used to represent the probability of inserting the rhetorical text to be generated at the position. In the disclosure, after obtaining the modification probability corresponding to each position, the size of each modification probability is compared, and the position corresponding to the largest modification probability among the positions is determined as the target position.
继续沿用上述例子,目标文本为“我今天吃了晚饭,感觉很好吃。”,将该目标文本的分词结果输入至按照上述方式预先训练后的修饰概率预测模型,该修饰概率预测模型即可输出表征各位置对应的修饰概率的概率向量,且该概率向量为[0.1,0.01,0.02,0.02,0.05,0.2,0.01,0.04,0.05,0.1,0,0,0,0.4],则目标位置即为位置14,即,需要在该位置处插入修辞文本。值得说明的是,在该位置处插入修辞文本可以是在该位置的前一位置处插入修辞文本,也可以是在该文字的后一位置处插入修辞文本,用户可以根据实际需求进行设置,本公开对此不作具体限定。在实际应用中,多是利用修辞文本对前一词句进行修饰,因此,本公开中,以将修辞文本插入目标位置的后一位置处,以对目标位置或者目标位置前一位置处的词句进行修饰。Continuing to use the above example, the target text is "I had dinner today and it was delicious." Input the word segmentation result of the target text into the modification probability prediction model pre-trained according to the above method, and the modification probability prediction model can be Output the probability vector representing the modification probability corresponding to each position, and the probability vector is [0.1, 0.01, 0.02, 0.02, 0.05, 0.2, 0.01, 0.04, 0.05, 0.1, 0, 0, 0, 0.4], then the target position That is position 14, ie, the position where rhetorical text needs to be inserted. It is worth noting that inserting rhetorical text at this position can be inserting rhetorical text at the previous position of the position, or inserting rhetorical text at the latter position of the character. Users can set it according to actual needs. There is no specific limitation in the disclosure. In practical applications, rhetorical text is mostly used to modify the previous sentence. Therefore, in the present disclosure, the rhetorical text is inserted into the position after the target position, so as to modify the words and sentences at the target position or the position before the target position. retouch.
例如,后续生成的修辞文本为“仿佛山珍海味一般”,则将修辞文本插入至目标位置后,得到的文本为“我今天吃了晚饭,感觉很好吃。仿佛山珍海味一般”。For example, if the subsequently generated rhetorical text is "like the delicacy of mountains and seas", after inserting the rhetorical text into the target position, the obtained text is "I ate dinner today and it feels delicious. It is like delicacy of mountains and seas".
接着,对图2中的步骤S13进行说明。图4是图2所示实施例示出的一种步骤S13的流程图。如图4所示,步骤S13可以包括以下步骤。Next, step S13 in FIG. 2 will be described. FIG. 4 is a flowchart of step S13 shown in the embodiment shown in FIG. 2 . As shown in FIG. 4 , step S13 may include the following steps.
在步骤131中,根据处于目标位置的预设范围内的文本的语义,确定目标位置对应的语义向量;In step 131, the semantic vector corresponding to the target position is determined according to the semantics of the text within the preset range of the target position;
在步骤132中,根据语义向量生成修辞文本。In step 132, rhetorical text is generated from the semantic vector.
为了确保所生成的修辞文本能够在最大程度上忠于目标文本,在本公开中,可以根据处于目标位置范围内的文本的语义,确定目标位置对应的语义向量,并基于该语义向量生成修辞文本。In order to ensure that the generated rhetorical text can be faithful to the target text to the greatest extent, in the present disclosure, a semantic vector corresponding to the target position can be determined according to the semantics of the text within the target position range, and the rhetorical text can be generated based on the semantic vector.
在本公开中,目标位置对应的语义向量用于表征处于目标位置的预设范围内的文本的语义向量。可以理解,语义向量是对处于目标位置的预设范围内的文本的低维表达,涵盖了该处于目标位置的预设范围内的文本的特征信息。该语义向量为句向量,即,一个语义向量中可以包括多个词向量。In the present disclosure, the semantic vector corresponding to the target position is used to represent the semantic vector of the text within the preset range of the target position. It can be understood that the semantic vector is a low-dimensional expression of the text within the preset range of the target position, and covers the feature information of the text within the preset range of the target position. The semantic vector is a sentence vector, that is, a semantic vector may include multiple word vectors.
例如,可以对处于目标位置的预设范围内的文本中的每一分词进行编码,以得到每一分词对应的语义,之后,综合处于目标位置的预设范围内的多个分词对应的语义,确定出目标位置对应的语义向量。For example, each word segment in the text within the preset range of the target position can be encoded to obtain the semantics corresponding to each word segment, and then the semantics corresponding to multiple word segmentations within the preset range of the target location are synthesized, The semantic vector corresponding to the target position is determined.
在可能的方式中,可以通过机器学习的方式生成修辞文本。例如,将语义向量输入至文本生成模型中,得到该文本生成模型输出的修辞文本。In a possible way, rhetorical text can be generated by means of machine learning. For example, the semantic vector is input into the text generation model, and the rhetorical text output by the text generation model is obtained.
其中,文本生成模型可以通过以下方式得到:首先,获取去除修辞文本后的原始文本,以及去除的修辞文本在原始文本中的位置对应的语义向量。示例地,可参照图4中所描述的方式确定语义向量。之后,将位置对应的语义向量作为模型输入参数,将去除的修辞文本作为模型输出参数,对神经网络进行训练,以获得文本生成模型。具体的训练方式可以参照现有的神经网络模型训练方式,此处不作限制。The text generation model can be obtained in the following ways: first, the original text after removing the rhetorical text and the semantic vector corresponding to the position of the removed rhetorical text in the original text are obtained. Illustratively, the semantic vector may be determined with reference to the manner described in FIG. 4 . After that, the semantic vector corresponding to the position is used as the model input parameter, and the removed rhetorical text is used as the model output parameter, and the neural network is trained to obtain the text generation model. The specific training method can refer to the existing neural network model training method, which is not limited here.
至此即可得到训练完成后的文本生成模型,并可以利用该文本生成模型确定出修辞文本。At this point, the text generation model after training can be obtained, and the rhetorical text can be determined by using the text generation model.
在实际应用中,修辞类型是指修辞方法的类型,其可以有多种,例如,比喻,拟人,反复、排比和顶真等等。为了进一步提高所生成的修辞文本的准确性,在本公开中还可以先确定出修辞类型,之后,再基于修辞类型和语义向量生成修辞文本。In practical application, rhetorical type refers to the type of rhetorical method, which can be of many kinds, for example, metaphor, personification, repetition, parallelism, and truth, etc. In order to further improve the accuracy of the generated rhetorical text, in the present disclosure, the rhetorical type may also be determined first, and then the rhetorical text is generated based on the rhetorical type and the semantic vector.
在一种方式中,可以是用户输入修辞类型,执行生成文本方法的设备获取到用户输入的修辞类型之后,根据该修辞类型和语义向量生成修辞文本。In one manner, the rhetoric type may be input by the user, and after acquiring the rhetoric type input by the user, the device executing the method for generating text generates rhetorical text according to the rhetoric type and the semantic vector.
在另一种方式中,执行生成文本方法的设备可以自动生成修辞类型,之后,根据该修辞类型和语义向量生成修辞文本。In another manner, the device performing the method of generating text may automatically generate a rhetorical type, and then generate a rhetorical text according to the rhetoric type and the semantic vector.
在该方式中,文本生成模型包括修辞类型生成子模型和修辞文本生成子模型。如图5所示,上述将语义向量输入至文本生成模型中,得到所述文本生成模型输出的所述修辞文本可以进一步包括步骤S51和步骤S52。In this manner, the text generation model includes a rhetorical type generation sub-model and a rhetorical text generation sub-model. As shown in FIG. 5 , inputting the semantic vector into the text generation model, and obtaining the rhetorical text output by the text generation model may further include steps S51 and S52.
在步骤S51中,将语义向量输入至修辞类型生成子模型,得到修辞类型生成子模型输出的待生成的修辞文本的修辞类型向量。In step S51, the semantic vector is input into the rhetoric type generation sub-model, and the rhetorical type vector of the rhetorical text to be generated output by the rhetoric type generation sub-model is obtained.
在本公开中,修辞类型向量是对修辞类型采用情况的向量化。修辞类型向量可以包括表示具体修辞类型的向量,修辞类型向量还可以包括表示不采用修辞类型的向量。即,修辞类型向量可以表示无修辞类型的含义,而不限定于仅表示具体修辞类型,因为目标文本可能不需要利用修辞文本进行修饰。In this disclosure, a rhetorical type vector is a vectorization of rhetorical type adoption. The rhetorical type vector may include a vector representing a specific rhetorical type, and the rhetorical type vector may also include a vector representing no rhetorical type. That is, the rhetorical type vector can represent the meaning of no rhetorical type, and is not limited to representing only a specific rhetorical type, because the target text may not need to be modified with the rhetorical text.
在一个实施例中,预设的修辞类型包括:比喻,拟人,反复、排比和顶真。结合具体的修辞类型来举例说明修辞类型向量的实质形式,比如,表示比喻的修辞类型向量则可以为[1,0,0,0],表示拟人的修辞类型向量则可以为[0,1,0,0]。In one embodiment, the preset rhetorical types include: metaphor, personification, repetition, parallelism, and realism. Combine the specific rhetoric type to illustrate the substantial form of the rhetorical type vector. For example, the rhetorical type vector representing metaphor can be [1,0,0,0], and the rhetorical type vector representing personification can be [0,1, 0,0].
上述文本生成模型可以包括两个子模型,分别为用于生成用于表征修辞类型的修辞类型向量的修辞类型生成子模型和用于生成修辞文本的修辞文本生成子模型。The above text generation model may include two sub-models, namely, a rhetorical type generation sub-model for generating rhetorical type vectors for representing rhetorical types and a rhetorical text generation sub-model for generating rhetorical texts.
其中,修辞类型生成子模型可以通过以下训练方式训练得到:首先,获取去除的修辞文本在原始文本中的位置对应的样本语义向量,以及,去除的修辞文本的样本修辞类型向量;之后,将该样本语义向量作为模型输入参数,将该样本修辞类型向量作为模型输出参数,对神经网络模型进行训练,以获得修辞类型生成子模型。具体的训练方式可以参照现有的神经网络模型训练方式,此处不作限制。Among them, the rhetorical type generation sub-model can be trained by the following training methods: first, obtain the sample semantic vector corresponding to the position of the removed rhetorical text in the original text, and the sample rhetorical type vector of the removed rhetorical text; The sample semantic vector is used as the model input parameter, the sample rhetorical type vector is used as the model output parameter, and the neural network model is trained to obtain the rhetorical type generation sub-model. The specific training method can refer to the existing neural network model training method, which is not limited here.
在步骤S52中,将语义向量和修辞类型向量输入至修辞文本生成子模型,得到修辞文本生成子模型输出的修辞文本。In step S52, the semantic vector and the rhetorical type vector are input into the rhetorical text generation sub-model to obtain the rhetorical text output by the rhetorical text generation sub-model.
示例地,可以将语义向量和修辞类型向量组合为一个向量,输入至修辞文本生成子模型,之后,修辞文本生成子模型对组合后的向量进行解码,生成修辞文本。其中,修辞文本生成子模型可以包括transformer解码器。值得说明的是,本公开对组合方式并不作具体限定。For example, the semantic vector and the rhetorical type vector can be combined into one vector, which is input to the rhetorical text generation sub-model, and then the rhetorical text generation sub-model decodes the combined vector to generate the rhetorical text. Among them, the rhetorical text generation sub-model may include a transformer decoder. It should be noted that the present disclosure does not specifically limit the combination manner.
在一种可能的方式中,可以直接以拼接的方式组合成一个向量,拼接的先后顺序不作限定。例如,可以将修辞类型向量拼接在语义向量之后,或者将修辞类型向量拼接在语义向量之前。在另一种可能的方式中,可以采用向量元素重组的方式组合成一个向量。例如,修辞类型向量为[0,1,0,0],语义向量为[1,1,1,0,0,1,0],那么,以向量元素重组的方式进行组合,可以得到组合后的向量为[1,1,1,0,0,1,0,1,0,0,0]。可以理解,将语义向量和修辞类型向量进行合理的融合,能够让修辞手法更加恰当地进行体现,提高所生成的修辞文本的准确性。In a possible way, it can be directly combined into a vector by splicing, and the sequence of splicing is not limited. For example, the rhetorical type vector can be concatenated after the semantic vector, or the rhetorical type vector can be concatenated before the semantic vector. In another possible way, the vector elements can be recombined to form a vector. For example, if the rhetorical type vector is [0,1,0,0], and the semantic vector is [1,1,1,0,0,1,0], then, by combining the vector elements, the combined The vector of is [1,1,1,0,0,1,0,1,0,0,0]. It can be understood that the reasonable fusion of the semantic vector and the rhetorical type vector can make the rhetorical device more appropriately reflected and improve the accuracy of the generated rhetorical text.
修辞文本生成子模型可以通过以下训练方式训练得到:首先,获取样本语义向量、样本修辞类型向量以及去除的修辞文本;之后,将样本语义向量、样本修辞类型向量作为模型输入参数,将去除的修辞文本作为模型输出参数,对神经网络模型进行训练,以获得修辞文本生成子模型。具体的训练方式可以参照现有的神经网络模型训练方式,此处不作限制。The rhetorical text generation sub-model can be trained by the following training methods: First, obtain the sample semantic vector, the sample rhetoric type vector, and the removed rhetorical text; The text is used as the model output parameter, and the neural network model is trained to obtain a rhetorical text generation sub-model. The specific training method can refer to the existing neural network model training method, which is not limited here.
值得说明的是,上述修饰概率预测模型和文本生成模型可以为同一个模型,在该模型中,既可以预测出目标位置,也可以进一步生成修辞文本。只需将目标文本的分词结果输入该模型,该模型即可输出目标位置以及修辞文本,之后,执行文本生成方法的电子设备即可将修辞文本插入至目标位置即可。在该情况下,模型是通过将样本目标文本的分词结果作为模型输入参数,将样本目标文本的目标位置和修辞文本作为模型输出参数,对神经网络进行训练得到的。It is worth noting that the above modification probability prediction model and text generation model can be the same model, and in this model, the target position can be predicted, and rhetorical text can be further generated. Just input the word segmentation result of the target text into the model, the model can output the target position and the rhetorical text, and then the electronic device executing the text generation method can insert the rhetorical text into the target position. In this case, the model is obtained by training the neural network with the word segmentation result of the sample target text as model input parameters, and the target position and rhetorical text of the sample target text as model output parameters.
图6是根据一示例性实施例示出的一种文本生成方法中客户端与服务器之间的交互图。其中,服务器运行有修饰概率预测模型以及文本生成模型。如图6所示,该方法包括以下步骤。Fig. 6 is an interaction diagram between a client and a server in a text generation method according to an exemplary embodiment. Among them, the server runs a modified probability prediction model and a text generation model. As shown in Figure 6, the method includes the following steps.
在步骤S61中,客户端上传目标文本。例如,用户可以直接在客户端中编辑生成目标文本,之后,客户端将目标文本上传。In step S61, the client uploads the target text. For example, the user can directly edit and generate the target text in the client, and then the client uploads the target text.
在步骤S62中,服务器获取客户端上传的目标文件。In step S62, the server obtains the target file uploaded by the client.
在步骤S63中,服务器对目标文本进行分词处理,得到目标文本的分词结果,并调用修饰概率预测模型对分词结果进行处理,得到各分词所在的位置对应的修饰概率,将最大修饰概率对应的位置确定为目标位置。其中,确定目标位置的具体实施方式可以参照图3所描述的方式,此处不再赘述。In step S63, the server performs word segmentation processing on the target text, obtains the word segmentation result of the target text, and calls the modification probability prediction model to process the word segmentation result, obtains the modification probability corresponding to the position of each word segmentation, and assigns the position corresponding to the maximum modification probability Determined as the target location. The specific implementation manner of determining the target position may refer to the manner described in FIG. 3 , which will not be repeated here.
在步骤S64中,服务器根据处于目标位置的预设范围内的文本的语义,确定目标位置对应的语义向量,并调用文本生成模型对语义向量进行处理,得到修辞文本。其中,得到修辞文本的具体实施方式可以参照图4所描述的方式,此处不再赘述。In step S64, the server determines the semantic vector corresponding to the target position according to the semantics of the text within the preset range of the target position, and invokes the text generation model to process the semantic vector to obtain rhetorical text. The specific implementation manner of obtaining the rhetorical text may refer to the manner described in FIG. 4 , which will not be repeated here.
在步骤S65中,服务器将修辞文本插入至目标位置。In step S65, the server inserts the rhetorical text into the target position.
在步骤S66中,服务器将包括修辞文本的新的文本发送给客户端。In step S66, the server sends the new text including the rhetorical text to the client.
基于同一发明构思,本公开还提供一种文本生成装置。图7是根据一示例性实施例示出的一种文本生成装置的框图。如图7所示,该文本生成装置可以包括:Based on the same inventive concept, the present disclosure also provides a text generation device. Fig. 7 is a block diagram of a text generating apparatus according to an exemplary embodiment. As shown in Figure 7, the text generating apparatus may include:
第一获取模块701,被配置为获取目标文本;a first obtaining
第一确定模块702,被配置为确定所述目标文本中待插入修辞文本的目标位置;a first determining
生成模块703,被配置为根据处于所述目标位置的预设范围内的文本的语义,生成所述修辞文本;A
插入模块704,被配置为将所述修辞文本插入至所述目标位置。An inserting
可选地,所述第一确定模块702包括:Optionally, the first determining
分词处理子模块,被配置为对所述目标文本进行分词处理,得到所述目标文本的分词结果,其中,所述分词结果包括各分词以及分词所在的位置;A word segmentation processing submodule, configured to perform word segmentation processing on the target text to obtain a word segmentation result of the target text, wherein the word segmentation result includes each word segmentation and the location of the word segmentation;
第一输入子模块,被配置为将所述分词结果输入至修饰概率预测模型,得到所述修饰概率预测模型输出的各位置对应的修饰概率,其中,位置对应的修饰概率用于表征在所述位置处插入待生成的所述修辞文本的概率;The first input sub-module is configured to input the word segmentation result into the modification probability prediction model, and obtain the modification probability corresponding to each position output by the modification probability prediction model, wherein the modification probability corresponding to the position is used to characterize the modification probability in the modification probability prediction model. the probability of inserting the rhetorical text to be generated at the position;
第一确定子模块,被配置为将最大修饰概率对应的位置确定为所述目标位置。The first determination submodule is configured to determine the position corresponding to the maximum modification probability as the target position.
可选地,所述生成模块703包括:Optionally, the
第二确定子模块,被配置为根据处于所述目标位置的预设范围内的文本的语义,确定所述目标位置对应的语义向量;a second determination submodule, configured to determine a semantic vector corresponding to the target position according to the semantics of the text within the preset range of the target position;
生成子模块,被配置为根据所述语义向量生成所述修辞文本。A generating submodule is configured to generate the rhetorical text according to the semantic vector.
可选地,所述生成子模块包括:Optionally, the generating submodule includes:
第二输入子模块,被配置为将所述语义向量输入至文本生成模型中,得到所述文本生成模型输出的所述修辞文本。The second input sub-module is configured to input the semantic vector into a text generation model to obtain the rhetorical text output by the text generation model.
可选地,所述文本生成模型包括修辞类型生成子模型和修辞文本生成子模型;Optionally, the text generation model includes a rhetorical type generation sub-model and a rhetorical text generation sub-model;
所述第二输入子模块,包括:The second input submodule includes:
第三输入子模块,被配置为将所述语义向量输入至所述修辞类型生成子模型,得到所述修辞类型生成子模型输出的待生成的所述修辞文本的修辞类型向量;a third input sub-module, configured to input the semantic vector into the rhetoric type generation sub-model, to obtain a rhetorical type vector of the rhetorical text to be generated output by the rhetoric type generation sub-model;
第四输入子模块,被配置为将所述语义向量和所述修辞类型向量输入至所述修辞文本生成子模型,得到所述修辞文本生成子模型输出的所述修辞文本。The fourth input sub-module is configured to input the semantic vector and the rhetorical type vector into the rhetorical text generation sub-model to obtain the rhetorical text output by the rhetorical text generation sub-model.
可选地,所述装置还包括:Optionally, the device further includes:
第一获取模块,被配置为获取去除修辞文本后的原始文本,以及去除的所述修辞文本在所述原始文本中的位置对应的语义向量;a first obtaining module, configured to obtain the original text after removing the rhetorical text, and the semantic vector corresponding to the position of the removed rhetorical text in the original text;
训练模块,被配置为将所述位置对应的语义向量作为模型输入参数,将去除的所述修辞文本作为模型输出参数,对神经网络进行训练,以获得所述文本生成模型。The training module is configured to use the semantic vector corresponding to the position as a model input parameter, and use the removed rhetorical text as a model output parameter to train a neural network to obtain the text generation model.
可选地,所述装置应用于服务器,所述服务器运行有修饰概率预测模型以及文本生成模型;Optionally, the apparatus is applied to a server, and the server runs a modified probability prediction model and a text generation model;
所述第一获取模块701被配置为:所述服务器获取客户端上传的目标文本;The first obtaining
所述第一确定模块702被配置为:所述服务器对所述目标文本进行分词处理,得到所述目标文本的分词结果,并调用所述修饰概率预测模型对所述分词结果进行处理,得到各分词所在的位置对应的修饰概率,并将最大修饰概率对应的位置确定为所述目标位置;The
所述生成模块703被配置为:所述服务器根据处于所述目标位置的预设范围内的文本的语义,确定所述目标位置对应的语义向量,并调用所述文本生成模型对所述语义向量进行处理,得到所述修辞文本;The
所述装置还包括:The device also includes:
发送模块,被配置为所述服务器在将所述修辞文本插入至所述目标位置后,将包括所述修辞文本的新的文本发送给所述客户端。The sending module is configured to send the new text including the rhetorical text to the client after the server inserts the rhetorical text into the target position.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be described in detail here.
本公开还提供一种计算机可读存储介质,其上存储有计算机程序指令,该程序指令被处理器执行时实现本公开提供的文本生成方法的步骤。The present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and when the program instructions are executed by a processor, implement the steps of the text generation method provided by the present disclosure.
图8是根据一示例性实施例示出的一种用于生成文本的装置的框图。例如,装置800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。Fig. 8 is a block diagram of an apparatus for generating text according to an exemplary embodiment. For example,
参照图8,装置800可以包括以下一个或多个组件:处理组件802,存储器804,电力组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。8, the
处理组件802通常控制装置800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的文本生成方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The
存储器804被配置为存储各种类型的数据以支持在装置800的操作。这些数据的示例包括用于在装置800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电力组件806为装置800的各种组件提供电力。电力组件806可以包括电源管理系统,一个或多个电源,及其他与为装置800生成、管理和分配电力相关联的组件。
多媒体组件808包括在所述装置800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当装置800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当装置800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/
传感器组件814包括一个或多个传感器,用于为装置800提供各个方面的状态评估。例如,传感器组件814可以检测到装置800的打开/关闭状态,组件的相对定位,例如所述组件为装置800的显示器和小键盘,传感器组件814还可以检测装置800或装置800一个组件的位置改变,用户与装置800接触的存在或不存在,装置800方位或加速/减速和装置800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于装置800和其他设备之间有线或无线方式的通信。装置800可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,装置800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述的文本生成方法。In an exemplary embodiment,
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器804,上述指令可由装置800的处理器820执行以完成上述的文本生成方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions, such as a
在另一示例性实施例中,还提供一种计算机程序产品,该计算机程序产品包含能够由可编程的装置执行的计算机程序,该计算机程序具有当由该可编程的装置执行时用于执行上述的文本生成方法的代码部分。In another exemplary embodiment, there is also provided a computer program product comprising a computer program executable by a programmable apparatus, the computer program having, when executed by the programmable apparatus, for performing the above The code section of the text generation method.
图9是根据一示例性实施例示出的一种文本生成装置1900的框图。例如,装置1900可以被提供为一服务器。参照图9,装置1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述文本生成方法。FIG. 9 is a block diagram of a
装置1900还可以包括一个电源组件1926被配置为执行装置1900的电源管理,一个有线或无线网络接口1950被配置为将装置1900连接到网络,和一个输入输出(I/O)接口1958。装置1900可以操作基于存储在存储器1932的操作系统,例如Windows ServerTM,MacOS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。The
本领域技术人员在考虑说明书及实践本公开后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the present disclosure. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or techniques in the technical field not disclosed by the present disclosure . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011027336.9A CN112036155A (en) | 2020-09-25 | 2020-09-25 | Text generation method, text generation device and computer readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011027336.9A CN112036155A (en) | 2020-09-25 | 2020-09-25 | Text generation method, text generation device and computer readable storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN112036155A true CN112036155A (en) | 2020-12-04 |
Family
ID=73574451
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011027336.9A Pending CN112036155A (en) | 2020-09-25 | 2020-09-25 | Text generation method, text generation device and computer readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN112036155A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113111664A (en) * | 2021-04-30 | 2021-07-13 | 网易(杭州)网络有限公司 | Text generation method and device, storage medium and computer equipment |
| CN114757188A (en) * | 2022-05-20 | 2022-07-15 | 大连大学 | A method for rewriting canonical medical text based on generative adversarial network |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100153219A1 (en) * | 2008-12-12 | 2010-06-17 | Microsoft Corporation | In-text embedded advertising |
| CN109933217A (en) * | 2019-03-12 | 2019-06-25 | 北京字节跳动网络技术有限公司 | Method and apparatus for pushing statements |
| CN110263150A (en) * | 2019-03-05 | 2019-09-20 | 腾讯科技(深圳)有限公司 | Document creation method, device, computer equipment and storage medium |
| CN110795556A (en) * | 2019-11-01 | 2020-02-14 | 中山大学 | A summary generation method based on fine-grained intrusive decoding |
-
2020
- 2020-09-25 CN CN202011027336.9A patent/CN112036155A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100153219A1 (en) * | 2008-12-12 | 2010-06-17 | Microsoft Corporation | In-text embedded advertising |
| CN110263150A (en) * | 2019-03-05 | 2019-09-20 | 腾讯科技(深圳)有限公司 | Document creation method, device, computer equipment and storage medium |
| CN109933217A (en) * | 2019-03-12 | 2019-06-25 | 北京字节跳动网络技术有限公司 | Method and apparatus for pushing statements |
| CN110795556A (en) * | 2019-11-01 | 2020-02-14 | 中山大学 | A summary generation method based on fine-grained intrusive decoding |
Non-Patent Citations (2)
| Title |
|---|
| LIU, ZHIQIANG; FU, ZUOHUI; CAO, JIE; DE MELO, GERARD; TAM, YIK-CHEUNG; NIU, CHENG; ZHOU, JIE;: "Rhetorically Controlled Encoder-Decoder for Modern Chinese Poetry Generation", PROCEEDINGS OF THE 57TH ANNUAL MEETING OF THE ASSOCIATION-FOR-COMPUTATIONAL-LINGUISTICS (ACL), 31 July 2019 (2019-07-31) * |
| 侯圣峦; 费超群; 张书涵;: "面向中文的修辞结构关系分类体系及无歧义标注方法", 中文信息学报, vol. 33, no. 07, 31 July 2019 (2019-07-31) * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113111664A (en) * | 2021-04-30 | 2021-07-13 | 网易(杭州)网络有限公司 | Text generation method and device, storage medium and computer equipment |
| CN114757188A (en) * | 2022-05-20 | 2022-07-15 | 大连大学 | A method for rewriting canonical medical text based on generative adversarial network |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20220230374A1 (en) | User interface for generating expressive content | |
| CN113689879B (en) | Method, device, electronic equipment and medium for driving virtual person in real time | |
| US20120276504A1 (en) | Talking Teacher Visualization for Language Learning | |
| JP7568201B2 (en) | Method and device for processing the action of virtual objects, and computer program | |
| CN113673261B (en) | Data generation method, device and readable storage medium | |
| US20130332859A1 (en) | Method and user interface for creating an animated communication | |
| CN113920229B (en) | A method, device and storage medium for processing virtual characters | |
| CN109977390B (en) | Method and device for generating text | |
| CN116954437A (en) | Information interactive processing methods, devices, equipment and computer storage media | |
| CN112948565B (en) | Human-computer dialogue method, device, electronic device and storage medium | |
| CN116980718A (en) | A video plot adaptation method, device, electronic device and storage medium | |
| CN113689880B (en) | Method, device, electronic device and medium for real-time driving of virtual human | |
| CN113891150B (en) | Video processing method, device and medium | |
| CN115270995A (en) | Emotion classification method and device | |
| CN112036155A (en) | Text generation method, text generation device and computer readable storage medium | |
| CN117036556A (en) | Virtual image driving method and device and robot | |
| CN117011434A (en) | Animation generation method, device, equipment, medium and product based on virtual character | |
| CN110166844B (en) | Data processing method and device for data processing | |
| CN119741405B (en) | Motion data generation method, device, equipment, storage medium and program product | |
| CN113326706A (en) | Cross-language retrieval method and device and electronic equipment | |
| CN115730048A (en) | Session processing method and device, electronic equipment and readable storage medium | |
| CN112989819A (en) | Chinese text word segmentation method, device and storage medium | |
| CN118741259A (en) | Video generation method, device, electronic device and storage medium | |
| US20240320519A1 (en) | Systems and methods for providing a digital human in a virtual environment | |
| CN115099246B (en) | Knowledge fusion method, device, equipment, medium and product based on machine translation |
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 | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201204 |
|
| RJ01 | Rejection of invention patent application after publication |