Character beautifying method based on text style migration technology

文档序号:1816636 发布日期:2021-11-09 浏览:21次 中文

阅读说明:本技术 一种基于文本风格迁移技术的文字美化方法 (Character beautifying method based on text style migration technology ) 是由 张楠坤 于 2021-06-30 设计创作,主要内容包括:本发明提供一种基于文本风格迁移技术的文字美化方法,包括下列步骤:S1:获取用户的第一输入文本,提取第一输入文本中的关键字,对关键字进行标签分类;S2:获取用户输入的风格要求的第二输入文本,通过语言模型判断风格要求所属的主题;S3:通过语言模型提取描述符合同一风格主题的若干语料文本,并进行排序处理;S4:根据描述主体所属标签类型,引入关联性密切的相关描述主体,并根据带有相关描述主体的语料文本,提取后作为补充描述文本;S5:输出与所述第一输入文本语义相同的第二写作风格的目标文本。本方法实现了文本写作风格的转换,有效解决了文本写作风格领域自适应问题,提高了文本写作风格转换的准确性。(The invention provides a character beautification method based on a text style migration technology, which comprises the following steps: s1: acquiring a first input text of a user, extracting keywords in the first input text, and performing label classification on the keywords; s2: acquiring a second input text of the style requirement input by the user, and judging a theme to which the style requirement belongs through a language model; s3: extracting and describing a plurality of corpus texts which accord with the same style theme through a language model, and sequencing; s4: introducing related description main bodies with close relevance according to the types of the labels to which the description main bodies belong, and extracting the language material texts with the related description main bodies to be used as supplementary description texts; s5: and outputting the target text of the second writing style with the same semantic meaning as the first input text. The method realizes the conversion of the writing style of the text, effectively solves the problem of self-adaption in the field of the writing style of the text, and improves the accuracy of the conversion of the writing style of the text.)

1. A character beautification method based on a text style migration technology comprises the following steps:

s1: acquiring a first input text of a user, extracting keywords in the first input text, and performing label classification on the keywords;

s2: acquiring a second input text of the style requirement input by the user, and judging a theme to which the style requirement belongs through a language model;

s3: extracting and describing a plurality of corpus texts which accord with the same style theme through a language model, and sequencing;

s4: introducing related description main bodies with close relevance according to the types of the labels to which the description main bodies belong, and extracting the language material texts with the related description main bodies to be used as supplementary description texts;

s5: and outputting the target text of the second writing style with the same semantic meaning as the first input text.

2. The method of claim 1, wherein the text style migration technology based beautification of characters comprises: in step S1, the tag types include noun tags and adjective tags.

3. The method of claim 2, wherein the text style migration technology based beautification of characters comprises: the adjective labels are divided into a plurality of set adjective levels with different severity degrees from negative to positive directions, and the adjectives are distributed into different adjective levels according to the weights of the adjective labels.

4. The method of claim 1, wherein the text style migration technology based beautification of characters comprises: in step S2, the theme includes a plurality of target application scenarios, and each target application scenario has a corpus text trained therein.

5. The method of claim 1, wherein the text style migration technology based beautification of characters comprises: in step S3, the corpus text is provided with a tag, and the tag content includes a description main body and a tag font level.

6. The method of claim 1, wherein the text style migration technology based beautification of characters comprises: in step S3, the corpus texts with description subjects are sorted according to a spatial order or a temporal order.

7. The method of claim 1, wherein the text style migration technology based beautification of characters comprises: in step S5, the user further edits and saves the output target text in the second writing style, and the language model performs corpus text training on the determined target text in the second writing style by combining the first input text and the second input text as a training set.

8. A character beautification system based on a text style migration technology is characterized in that: the device comprises an acquisition module and a processing module;

the acquisition module is used for acquiring a first input text of a first writing style and acquiring a second input text of style requirements input by a user;

the processing module is used for processing the first input text by adopting a language model with a pre-training style requirement to obtain a target text with a second writing style, and the semantic meaning of the target text is the same as that of the first input text;

the language model judges the theme to which the style requirement belongs, calls the corpus text which accords with the target application scene environment of the first input text according to the theme, and finishes the processing process by calling a plurality of expected texts and arranging the expected texts in sequence.

Technical Field

The invention relates to a description extension method, in particular to a character beautification method based on a text style migration technology.

Background

Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that enable efficient communication between humans and computers using natural language. Natural language processing is a science integrating linguistics, computer science and mathematics. Therefore, the research in this field will involve natural language, i.e. the language that people use everyday, so it is closely related to the research of linguistics. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robotic question and answer, knowledge mapping, and the like.

In recent years, intelligent writing technology has been greatly developed, and particularly, intelligent writing using a neural network has been rapidly developed. Intelligent authoring generally refers to the generation of a piece of descriptive text related to a sequence of keywords given the sequence of keywords comprising one or more keywords, using a neural network. For example, given several keywords that describe an appearance, a neural network is used to generate a piece of text that describes the appearance from the provided words. However, the sentence pattern and style of the text generated by the currently used neural network are fixed and single, and cannot meet the daily writing or creation requirements of the user.

Disclosure of Invention

The invention provides a character beautification method based on a text style migration technology, which solves the problem of processing text semantics during expansion, and adopts the following technical scheme:

a character beautification method based on a text style migration technology comprises the following steps:

s1: acquiring a first input text of a user, extracting keywords in the first input text, and performing label classification on the keywords;

s2: acquiring a second input text of the style requirement input by the user, and judging a theme to which the style requirement belongs through a language model;

s3: extracting and describing a plurality of corpus texts which accord with the same style theme through a language model, and sequencing;

s4: introducing related description main bodies with close relevance according to the types of the labels to which the description main bodies belong, and extracting the language material texts with the related description main bodies to be used as supplementary description texts;

s5: and outputting the target text of the second writing style with the same semantic meaning as the first input text.

Further, in step S1, the tag types include noun tags and adjective tags.

The adjective labels are divided into a plurality of set adjective levels with different severity degrees from negative to positive directions, and the adjectives are distributed into different adjective levels according to the weights of the adjective labels.

Further, in step S2, the theme includes a plurality of target application scenarios, and each target application scenario has a corpus text trained therein.

Further, in step S3, the corpus text is provided with a tag, and the tag content includes a description main body and a tag font grade.

In step S3, the corpus texts with description subjects are sorted according to a spatial order or a temporal order.

Further, in step S5, the user further edits and saves the output target text in the second writing style, and the language model performs corpus text training on the determined target text in the second writing style by combining the first input text and the second input text as a training set.

A character beautification system based on a text style migration technology comprises an acquisition module and a processing module;

the acquisition module is used for acquiring a first input text of a first writing style and acquiring a second input text of style requirements input by a user;

the processing module is used for processing the first input text by adopting a language model with a pre-training style requirement to obtain a target text with a second writing style, and the semantic meaning of the target text is the same as that of the first input text;

the language model judges the theme to which the style requirement belongs, calls the corpus text which accords with the target application scene environment of the first input text according to the theme, and finishes the processing process by calling a plurality of expected texts and arranging the expected texts in sequence.

The character beautification method based on the text style migration technology can help a user to write gorgeous description language, realizes the conversion of the text writing style, effectively solves the problem of self-adaption of the field of the text writing style, and improves the accuracy of the conversion of the text writing style.

Drawings

FIG. 1 is a flow chart of the text beautification method based on the text style migration technology.

Detailed Description

As shown in fig. 1, the method for beautifying a character based on the text style migration technology includes the following steps:

s1: acquiring a first input text of a user, extracting keywords in the first input text, and performing label classification on the keywords;

the tag types comprise noun tags and adjective tags, wherein the noun tags are divided into characters, animals, plants, weather, geography, history and the like, the adjective tags are divided into a plurality of setting levels with different severity degrees from negative to positive, each level contains a plurality of adjectives, and the adjectives are distributed into different adjective levels according to the weights of the adjective tags. For example, assuming that the rank of the negative direction is set to 6, the adjective "bad quality" belongs to the sixth rank with the highest degree of severity, and the adjective "stubborn" belongs to the first rank with the lowest degree of severity.

S2: acquiring a second input text of the style requirement input by the user, and judging a theme to which the style requirement belongs through a language model;

the theme comprises a plurality of target application scenes, a large number of corpus texts are trained in each target application scene, the corpus texts are input initially through manual input, network content pasting and the like, and are achieved through language model strengthening training in the later period.

The corpus text is provided with a mark, the mark content comprises a description main body and a mark form and appearance grade, the description main body can be obtained through keywords of the corpus text, and the form and appearance grade is achieved through the strengthening training of a language model.

S3: extracting and describing a plurality of corpus texts which accord with the same style theme through a language model, and sequencing;

and sequencing the extracted corpus texts with the description main bodies according to a spatial sequence or a time sequence.

And the adjective grade of the corpus text accords with the grade of the adjective label of the first input text, so that the content is richer.

S4: introducing related description main bodies with close relevance according to the types of the labels to which the description main bodies belong, and extracting 3-6 sentences as supplementary description texts according to the corpus texts with the related description main bodies;

the description subjects are closely related, such as stars, the sun, the moon, clear sky, the cloud, the sea, the blue sky and the like, so that one of the description subjects is related to the keywords input by the user, but after a plurality of corpus texts of the description subjects are extracted, the corpus texts of the related description subjects can be supplemented to serve as decorations.

Similarly, the corresponding adjective levels of the corpus text of the related description main body accord with the level of the adjective label of the first input text.

S5: and outputting the target text of the second writing style with the same semantic meaning as the first input text.

And the language model combines the first input text and the second input text as a training set to train the corpus text for the determined target text of the second writing style.

The method is realized by a system, and the character beautification system based on the text style migration technology comprises an acquisition module and a processing module;

the acquisition module is used for acquiring a first input text of a first writing style and acquiring a second input text of style requirements input by a user;

the processing module is used for processing the first input text by adopting a language model with a pre-training style requirement to obtain a target text with a second writing style and the same semantic meaning as the first input text,

the language model judges the theme to which the style requirement belongs, calls the corpus text which accords with the target application scene environment of the first input text according to the theme, and finishes the processing process by calling a plurality of expected texts and arranging the expected texts in sequence.

The character beautification method based on the text style migration technology can be applied to social media such as a friend circle and the like, and helps a user write gorgeous description language. The method uses a language model to achieve the aim of text style migration, and a user only needs to write words according to the own hair style and select a beautifying style, so that the algorithm can complete a section of description text with the same meaning. For example, a user takes a picture and inputs a matched text 'weather is good', selects a style 'Versailles', and obtains a beautified text such as 'clear days at the end of late autumn', like an endless calm Bihai; the strong white light jumps in the air as if the microwave is floating on the sea; the sorghum of the mountain foot lower slice always shakes and drags full spikes, which are similar to fluctuating red water; the yellow-faded leaves are colored with withered colors in the field.

6页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种注意力模型、特征提取方法及相关装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!