WO2025199829A1 - 用于插图生成的方法、装置、设备和存储介质 - Google Patents

用于插图生成的方法、装置、设备和存储介质

Info

Publication number
WO2025199829A1
WO2025199829A1 PCT/CN2024/084222 CN2024084222W WO2025199829A1 WO 2025199829 A1 WO2025199829 A1 WO 2025199829A1 CN 2024084222 W CN2024084222 W CN 2024084222W WO 2025199829 A1 WO2025199829 A1 WO 2025199829A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
text
information
role
illustration
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
PCT/CN2024/084222
Other languages
English (en)
French (fr)
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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to PCT/CN2024/084222 priority Critical patent/WO2025199829A1/zh
Priority to CN202480003590.5A priority patent/CN121039706A/zh
Publication of WO2025199829A1 publication Critical patent/WO2025199829A1/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0475Generative networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/00Two-dimensional [2D] image generation

Definitions

  • Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to methods, devices, apparatuses, and computer-readable storage media for generating illustrations for textual works.
  • a method for generating illustrations comprises: determining, from a text work, descriptive information of a text segment and character information of at least one character; wherein the text work includes multiple text segments, and the character information includes attribute information of the character in at least one dimension; generating, for each of the at least one characters, a character image based on the character information; and generating an illustration for the text segment based on the descriptive information of the text segment and the character image.
  • a device for generating illustrations includes: a determination module configured to determine, based on a text work, description information of a text segment and role information of at least one character; wherein the text work includes multiple text segments, and the role information includes attribute information of the character in at least one dimension; an image generation module configured to generate, for a character in the at least one character, a character image based on the role information; and an image generation module configured to generate, based on the description information of the text segment and the role information, a character image.
  • character image graph to generate illustrations for text snippets.
  • a computer-readable storage medium wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.
  • FIGS. 2A and 2B are schematic diagrams of example architectures for generating illustrations for textual works, respectively, according to some embodiments of the present disclosure
  • FIG3 shows a schematic diagram of an example character image according to some embodiments of the present disclosure
  • FIG4 shows a schematic diagram of an example illustration according to some embodiments of the present disclosure
  • FIG7 illustrates a block diagram of an electronic device in which one or more embodiments of the present disclosure may be implemented.
  • the term “including” and similar terms should be understood as open inclusion, i.e., “including but not limited to”.
  • the term “based on” should be understood as “based at least in part on”.
  • the term “one embodiment” or “the embodiment” should be understood as “at least one embodiment”.
  • the term “some embodiments” should be understood as “at least some embodiments”.
  • Other explicit and implicit definitions may be included below.
  • executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.
  • a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information, so that the user can independently choose whether to provide personal information to the electronic device, application, server or storage medium and other software or hardware that performs the operation of the technical solution of the present disclosure based on the prompt message.
  • model can learn the association between corresponding inputs and outputs from training data, so that after training is completed, corresponding outputs can be generated for given inputs.
  • the generation of the model can be based on machine learning technology.
  • Deep learning is a machine learning algorithm that processes inputs and provides corresponding outputs by using multiple layers of processing units.
  • a neural network model is an example of a model based on deep learning.
  • model may also be referred to as “machine learning model”, “learning model”, “machine learning network” or “learning network”, and these terms are used interchangeably in this article.
  • a “neural network” is a machine learning network based on deep learning.
  • a neural network is capable of processing inputs and providing corresponding outputs. It typically includes an input layer, an output layer, and one or more hidden layers between the input and output layers. Neural networks used in deep learning applications typically include many hidden layers, thereby increasing the depth of the network. The layers of a neural network are connected in sequence so that the output of the previous layer is provided as input to the next layer, where the input layer receives the input of the neural network and the output of the output layer serves as the final output of the neural network.
  • Each layer of a neural network includes one or more nodes (also called processing nodes or neurons), each of which processes the input from the previous layer.
  • machine learning can be roughly divided into three stages, namely the training stage, the testing stage, and the application stage (also called the inference stage).
  • the training stage a given model can be trained using a large amount of training data, and the parameter values are continuously updated iteratively until the model can obtain consistent inferences that meet the expected goals from the training data.
  • the model can be considered to be able to learn the association between input and output (also called input-to-output mapping) from the training data.
  • the parameter values of the trained model are determined.
  • the testing stage the test input is applied to the trained model to test whether the model can provide the correct output, thereby determining the performance of the model.
  • the testing stage can sometimes be integrated into the training stage.
  • the trained model can be used to process the actual model input based on the parameter values obtained through training to determine the corresponding model output.
  • illustrations can be inserted into e-books to increase the fun of e-books, thereby increasing the user's interest. Illustrations are created and inserted into novels. This requires significant manpower and is inefficient in generating illustrations.
  • textual works may include, but are not limited to, novels, essays, prose, poems, and scripts.
  • a method for generating illustrations is proposed.
  • descriptive information of a text segment and character information of at least one character are determined based on a text work; the text work includes multiple text segments, and the character information includes attribute information of the character in at least one dimension.
  • a character image is generated based on the character information.
  • An illustration for the text segment is generated based on the descriptive information of the text segment and the character image.
  • FIG1 shows a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented.
  • the environment 100 may include an electronic device 110 .
  • the electronic device 110 may obtain the target novel 102 and generate at least one illustration 112 that matches the target novel 102 (for example, it may include illustrations 112-1, 112-2, ..., 112-N, where N is a positive integer. For ease of description, the one or more illustrations may be collectively referred to as illustrations 112 below). In some embodiments, the electronic device 110 may obtain the text content of the target novel 102 and generate the at least one illustration 112 based on the obtained text content of the target novel 102. In some embodiments, if the at least one illustration 112 includes multiple illustrations, different illustrations may correspond to different text segments of the target novel 102.
  • the electronic device 110 can generate at least one illustration 112 that matches the target novel 102 with the help of a trained machine learning model 120.
  • the machine learning model can be, for example, an image generation model.
  • the machine learning model 120 can include, but is not limited to, any appropriate model such as a Transformer model, a convolutional neural network (CNN), a recurrent neural network (RNN), a deep neural network (DNN), etc.
  • the machine learning model 120 can be a model local to the electronic device 110, or a model installed in another electronic device 110 (for example, installed in a remote device). It should be noted that the machine learning model 120 can be
  • the machine learning model 120 may include multiple models, and the present disclosure does not limit the number and type of models that the machine learning model 120 specifically includes.
  • the electronic device 110 may include any computing system with computing capabilities, such as various computing devices/systems, terminal devices, server devices, etc.
  • the terminal device may be any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a handheld computer, a portable game terminal, a VR/AR device, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio/video player, a digital camera/camcorder, a positioning device, a television receiver, a radio broadcast receiver, an e-book device, a gaming device or any combination thereof, including accessories and peripherals of these devices or any combination thereof.
  • PCS personal communication system
  • PDA personal digital assistant
  • the server device may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data and artificial intelligence platforms.
  • the server device may include, for example, a computing system/server, such as a mainframe, an edge computing node, a computing device in a cloud environment, and the like.
  • Figure 2A shows a schematic diagram of an example architecture 200A for generating illustrations for a text work according to some embodiments of the present disclosure.
  • the architecture 200A can be implemented at the electronic device 110.
  • the architecture 200A will be described with reference to the environment 100 of Figure 1.
  • Figure 2A shows an overview of the illustration generation process, where the text work 201 may include multiple text segments 202-1, ..., 202-N (individually and/or collectively referred to as text segments 202).
  • Descriptive information 204 of a text segment e.g., text segment 202-1
  • Role information 203 of at least one role of the text work 201 can be determined, and the role information 203 includes attribute information of the role in at least one dimension.
  • the dimension may include, for example The name, gender, age, occupation, appearance, expression, and clothing of the character, etc.
  • a character image 205 of the character can be generated based on the character information 203 of the character.
  • illustrations of the text segment 202 can be generated based on the description information 204 of the text segment 202 and the character image 205. In this way, corresponding illustrations can be generated for each text segment in the text work, thereby increasing the interest of readers when reading the text work.
  • the text work 201 may include multiple text fragments, and each text fragment may be determined based on the following method: obtaining structural information of the text work, and dividing the text work into the multiple text fragments based on the structural information.
  • the structural information may include the directory structure of the text work, for example, the multiple text fragments may be determined according to the hierarchy of multi-level titles defined in the directory structure. Rules for dividing text fragments may be pre-specified, for example, a text fragment may include a "chapter", a "section", or one or more paragraphs, etc. In this way, text fragments may be divided according to different precisions, and illustrations that better match the content of the text fragment may be generated.
  • FIG2B illustrates a schematic diagram of an example architecture 200B for generating illustrations for a text work according to some embodiments of the present disclosure.
  • the architecture 200B may be implemented at the electronic device 110.
  • the architecture 200B will be described with reference to the environment 100 of FIG1 .
  • architecture 200B includes a description information extraction unit 210 and a character information acquisition unit 220.
  • the description information extraction unit 210 can be used, for example, to extract description information 215 (e.g., a summary) from a text segment of a novel.
  • description information 215 e.g., a summary
  • the electronic device 110 can obtain various text segments from the novel and provide them to the description information extraction unit 210.
  • the electronic device 110 can then process the various text segments based on predetermined rules to obtain description information for the multiple text segments.
  • the predetermined rule here may indicate, for example, the maximum number of text units (e.g., chapters, paragraphs, sentences, or words, etc.) included in each text segment.
  • the predetermined rule may indicate that each text segment may include at most one chapter, one section, one paragraph, or 50 text units, etc.
  • the full text of the novel may be Segmentation processing is performed (for example, taking a chapter, a section, a paragraph, or 50 text units as a text segment) to obtain multiple text segments.
  • the description information extraction unit 210 can then extract description information corresponding to each of the multiple text segments.
  • the text segment here may be, for example, a text segment within a predetermined range of the current page presented in the e-book reader.
  • the electronic device 110 may, for example, obtain a text segment within a predetermined range of the current page presented in the e-book reader in response to a page turning operation detected in the e-book reader, and provide the text segment to the description information extraction unit 210.
  • the current page presents at least one text segment.
  • the text segment within the predetermined range of the current page obtained by the electronic device 110 is at least a portion of at least one text segment.
  • the description information extraction unit 210 may, for example, extract description information 215 for the text segment only from the obtained text segment.
  • the electronic device 110 can obtain text segments and generate illustrations as the reader turns pages.
  • the description information may include environmental information about the character's environment and the character's action information.
  • the description information extraction unit 210 may, for example, determine description information 215 for a text segment by summarizing at least one character in the text segment and the environmental information and action information associated with the at least one character. For example, for text segment A, "Character A woke up early, made breakfast, put away the mess of toys in the living room, mopped the floor, and then took two steamed buns and went out.”
  • the description information extraction unit 210 may determine that text segment A only includes character A.
  • the description information generated by the description information extraction unit 210 may include, for example, the environment information "home,” and the action information, for example, "Character A gets up early to do housework.” It should be noted that not every text segment includes characters. For example, text segment B, "From now on, they will split the bill, regardless of expenses, half each," does not include either a character or an action associated with the character. Therefore, the description information extraction unit 210 may not generate description information corresponding to text segment B.
  • the role information acquisition unit 220 can acquire role information 225 of at least one role.
  • the at least one role here can be the role information acquisition unit 220 based on the full text of the text work, Alternatively, the current text segment may be determined by the electronic device 110 itself, or it may be determined and provided to the character information acquisition unit 220 by the electronic device 110. Specifically, the electronic device 110/character information acquisition unit 220 may determine at least one character in the novel.
  • the electronic device 110/character information acquisition unit 220 may determine that the three characters are "Character A,”"Dad,” and "Mom.”
  • the role information acquisition unit 220 can also determine the number of occurrences of the target role in the text segment for the target role among at least one role, and then determine the main role.
  • the role information of the target role can be acquired in response to determining that the number of occurrences meets a predetermined condition.
  • the predetermined condition here can, for example, indicate a predetermined number of times (for example, 3 times, 5 times, or any other number), and the role information acquisition unit 220 can, for example, acquire the role information of the target role in response to determining that the number of occurrences reaches a predetermined number.
  • the role information of the character can still be acquired.
  • the role information 225 of at least one role may include multiple attributes of the at least one role.
  • the multiple attributes here may include, for example, any one or more of the role's name, gender, age, occupation, appearance, demeanor, and clothing.
  • the character information of the target character can be determined based on the portion of the text work associated with the target character. Furthermore, the character information of the target character can be updated based on the portion of the text segment associated with the target character. For example, the basic attributes of the character, such as name, gender, age, and occupation, can be determined from the entire text work. Furthermore, the special attributes of the character in the current segment of the text being processed, such as the current appearance, expression, and clothing, etc., can be determined.
  • multiple attributes can be divided into two parts, wherein the first part can be directly determined from the novel, and the second part can be indirectly determined from the novel, or can be manually set.
  • the name, gender, etc. of the character in the multiple attributes can be the attributes of the first part.
  • the character information acquisition unit 220 can, for example, determine the attributes of the first part from the novel. It should be noted that the character information acquisition unit 220 can obtain the first part of the attributes of character A from the full text of the novel, and is not limited to the text fragment.
  • the electronic device 110 can receive user input from a user (e.g., a relevant staff member) and determine the attributes of the second portion based on the user input.
  • a user e.g., a relevant staff member
  • the electronic device 110 can provide a setting control in an e-book reader for setting the second portion of the character's multiple attributes, and in response to receiving a setting operation on the setting control, set the second portion of the multiple attributes based on the setting operation.
  • a setting control can be, for example, an input box.
  • the electronic device 110 can, for example, receive user input via the input box and determine the second portion of the multiple attributes based on the user input.
  • the electronic device 110 can, for example, provide the determined attributes of the second portion to the character information acquisition unit 220 so that the character information acquisition unit 220 acquires the attributes of the second portion.
  • the user is allowed to specify the attributes of the character (e.g., clothing style and color, etc.) according to their needs during the reading process, thereby generating illustrations that meet their needs.
  • the electronic device 110 can generate illustrations 112 of the novel based on the description information 215 of the text segment and the role information 225 of at least one character.
  • the electronic device 110 can generate illustrations 112 based on any appropriate method and using the description information 215 of the text segment and the role information 225 of at least one character.
  • the present disclosure does not limit the specific method of generating illustrations.
  • the electronic device 110 can generate illustrations 112 based on pre-acquired rules or algorithms.
  • the electronic device 110 can generate illustrations with the help of a trained machine learning model.
  • the architecture 200B can also include a prompt word determination Unit 230 and machine learning model 120.
  • the prompt word determination unit 230 can, for example, be configured to generate prompt words 235 for the machine learning model 120 based on the description information and the role information.
  • the prompt word determination unit 230 can, for example, obtain a predetermined prompt word template and fill the prompt word template with the description information and the role information to generate the prompt word 235.
  • the prompt word template can include: environmental information, role information, and action information. The obtained various information can be filled into the corresponding positions of the template to generate the prompt word.
  • the prompt word determination unit 230 may also call the character image determination unit 250 and the character model generation unit 260.
  • the character image may, for example, represent the character image of the character from multiple angles, and the character image determination unit 250 may, for example, determine the character image 255 for at least one character based on the character information of at least one character in the novel.
  • the character image determination unit 250 may determine the character image 255 in any appropriate manner.
  • the character image determination unit 250 may generate the character image 255 for at least one character based on the character information of at least one character using a trained image generation model.
  • the character image determination unit 250 may also directly obtain the character image input by the user (e.g., the character image drawn by the illustrator for at least one character).
  • FIG3 illustrates a schematic diagram of an example character image 300 according to some embodiments of the present disclosure.
  • Character image determination unit 250 may, for example, generate character image 300 for character A based on character information for character A, such as "character A, 25 years old, female, curly hair, wearing a dress.”
  • Character image 300 may include multiple images of character A at various angles (e.g., image 301 tilted 45 degrees to the side, a side view image 302, a front view image 303, and a back view image 304).
  • the character model generation unit 260 can generate a character model 265 describing the character based on the character image 255 corresponding to the character.
  • Character model 265 can be, for example, a LoRA model.
  • the LoRA model can be understood as a plug-in to the Stable Diffusion (SD) model (a generative model), which can be used to meet a specific style or specified character attributes.
  • SD Stable Diffusion
  • the process of generating a character model based on a character image can be understood as The image is stored in the form of a character model.
  • the prompt word determination unit 230 can subsequently flexibly call different character models to call different character images.
  • the prompt word determination unit 230 can obtain a character model 265 for at least one character and determine a prompt word 235 based on the character model 265 and the description information 215 of the text segment. For example, the prompt word determination unit 230 can generate the prompt word "Character A ⁇ Model A> makes breakfast at home” based on the description information "Character A gets up early to do housework" and the character model A corresponding to character A.
  • the prompt word determination unit 230 can also update the prompt word 235 based on the weight index of the character model.
  • the weight index can be used to indicate the similarity between the character in the illustration and the character image corresponding to the character. For example, if the prompt word is "Character A ⁇ Model A, 0.5> makes breakfast at home", then the prompt word indicates that the similarity between the character A in the subsequently generated illustration and the character image corresponding to character A is 50%. It can be understood that the higher the weight index, the higher the similarity between the character in the illustration and the character image corresponding to the character, and the more similar the two are. Using the embodiments of the present disclosure, the character details in each illustration can be adjusted while ensuring the consistency of the appearance of the novel characters.
  • the prompt word determination unit 230 can also determine the style of the illustration based on the background environment of the novel, and update the prompt word 235 based on the style. For example, if the background of the novel is a modern urban background, the style of the illustration can be determined to be "comic style", and the prompt word can be, for example, "Character A ⁇ Model A, 0.5> makes breakfast at home in comic style.” If the background of the novel is an ancient martial arts background, the style of the illustration can be determined to be "ink style", and the prompt word can be, for example, "Character A ⁇ Model A, 0.5> makes breakfast at home in ink style.” Using the embodiments of the present disclosure, illustrations with richer visual effects can be generated in a more flexible manner.
  • the prompt word determination unit 230 may provide the determined prompt word 235 to the machine learning model 120.
  • the machine learning model 120 may then generate an illustration 112 based on the acquired prompt word 235.
  • FIG4 shows a schematic diagram of an example illustration 400 according to some embodiments of the present disclosure. If the prompt word is "Character A ⁇ Model A, 0.5> making breakfast at home," the machine learning model 120 may call Model A and generate an illustration 400 showing Character A making breakfast at home based on a weight index of 0.5.
  • the electronic device 110 may obtain the corresponding One less illustration (each character can correspond to multiple illustrations), and insert the illustration into the position associated with the text segment in the novel.
  • the electronic device 110 can insert illustration A into text segment A (for example, inside text segment A, before/after text segment A, etc.).
  • the electronic device 110 can also, for example, adjust the illustration based on the adjustment operation in response to receiving an adjustment operation for adjusting the illustration.
  • the adjustment operation here can, for example, include an update operation, a delete operation, and/or a move operation for the illustration.
  • the electronic device 110 can delete illustration A inserted in the novel in response to receiving a delete operation from the user for illustration A.
  • the electronic device 110 can move illustration A in response to receiving a move operation from the user to move illustration A from position A to position B, and the moved illustration A is located at position B.
  • multiple illustrations can be generated based on the text content of a novel conveniently and quickly while ensuring the quality of the illustrations, which can improve the efficiency of generating illustrations.
  • inserting illustrations into a novel based on the content of the novel can increase the interest of readers when reading the novel.
  • FIG5 shows a flowchart of a process 500 for generating an illustration for a text work according to some embodiments of the present disclosure.
  • Process 500 can be implemented at electronic device 110.
  • Process 500 is described below with reference to FIG1.
  • description information of a text segment and role information of at least one role are determined based on the text work; wherein the text work includes a plurality of text segments, and the role information includes attribute information of the role in at least one dimension.
  • a character avatar diagram of the role is generated based on the role information of the role.
  • an illustration of the text segment is generated based on the description information of the text segment and the character image of the character.
  • the plurality of text segments is determined based on: obtaining structural information of the text work; and dividing the text work into the plurality of text segments based on the structural information.
  • At least one role is determined based on: A target character among multiple characters in the work, determining the number of occurrences of the target character in the text segment; and in response to determining that the number of occurrences meets a predetermined condition, using the target character as a character among at least one character.
  • determining role information of at least one role includes: determining the role information of the target role based on a portion of the text work associated with the target role; and updating the role information of the target role based on a portion of the text segment associated with the target role.
  • the descriptive information includes environmental information of the character's environment and action information of the character
  • generating illustrations of text fragments includes: generating a character model for describing the character based on the character image; generating prompt words for the machine learning model using the environmental information, action information and character model; and generating illustrations based on the prompt words.
  • generating the prompt word further includes: updating the prompt word based on the weight index of the role model.
  • generating the prompt word further includes: determining a style of the illustration based on the context of the text work; and updating the prompt word based on the style.
  • the attribute information of at least one dimension includes at least any one of the following: the character's name, gender, age, occupation, appearance, expression, and clothing, and the first part of the attribute information of at least one dimension is determined from the text work.
  • the process 500 is implemented in an electronic book reader for reading a text work, and the process 500 further includes: providing a setting control in the electronic book reader for setting a second part of the attribute information of at least one dimension; and in response to receiving a setting operation for the setting control, setting the second part of the attribute information of at least one dimension based on the setting operation.
  • the text segment is a text segment within a predetermined range of a current page presented in an electronic book reader, and the method is responsive to the electronic book reader.
  • the page turning operation is detected in the reader and executed.
  • FIG. 6 shows a schematic block diagram of a device 600 for generating illustrations for a text work according to some embodiments of the present disclosure.
  • Device 600 can be implemented as or included in electronic device 110.
  • the various modules/components in device 600 can be implemented using hardware, software, firmware, or any combination thereof.
  • the device 600 includes: a determination module 610, which is configured to determine the description information of the text segment and the role information of at least one character based on the text work; wherein the text work includes multiple text segments, and the role information includes attribute information of the character in at least one dimension; an image generation module 620, which is configured to generate a character image diagram of the character based on the role information of the character in at least one character; and an image generation module 630, which is configured to generate an illustration of the text segment based on the description information of the text segment and the role image diagram of the character.
  • the plurality of text segments is determined based on: obtaining structural information of the text work; and dividing the text work into the plurality of text segments based on the structural information.
  • At least one role is determined based on: determining the number of occurrences of a target role among multiple roles in a text work in a text segment; and in response to determining that the number of occurrences meets a predetermined condition, using the target role as a role among at least one role.
  • the determination module 610 is further configured to: determine the role information of the target role based on the portion of the text work associated with the target role; and update the role information of the target role based on the portion of the text segment associated with the target role.
  • the descriptive information includes environmental information of the character's environment and action information of the character
  • the image generation module is further configured to: generate a character model for describing the character based on the character image; generate prompt words for the machine learning model using the environmental information, action information and character model; and generate illustrations based on the prompt words.
  • the image generation module 630 is further configured to: The weight index of the color model is used to update the prompt word.
  • the image generation module 630 is further configured to: determine the style of the illustration based on the context of the textual work; and update the prompt word based on the style.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Machine Translation (AREA)

Abstract

插图生成的方法、装置、设备和存储介质。方法包括根据文本作品确定文本片段的描述信息和至少一个角色的角色信息;其中,文本作品包括多个文本片段,角色信息包括角色在至少一个维度的属性信息(510);针对至少一个角色中的角色,基于角色的角色信息生成角色的角色形象图(520);根据文本片段的描述信息和角色的角色形象图,生成文本片段的插图(530)。基于文本作品内容来为文本作品插入插图,可以为文本作品自动生成图像数据,进而提高读者阅读文本作品时的趣味性。

Description

用于插图生成的方法、装置、设备和存储介质 技术领域
本公开的示例实施例总体涉及计算机领域,特别地涉及用于为文本作品生成插图的方法、装置、设备和计算机可读存储介质。
背景技术
随着数字化技术的发展,越来越多的应用和网站均能够用于呈现电子出版物,也称为电子书籍。为提高用户浏览电子书籍(特别是诸如小说、短文、散文、诗歌、剧本等文本作品)时的用户兴趣,可以通过在电子书籍中插入插图的方式来提高电子书籍的趣味性,进而提高用户的用户兴趣。期望可以方便快捷地获取到与电子书籍相关联的插图。
发明内容
在本公开的第一方面,提供了一种插图生成方法。该方法包括:根据文本作品确定文本片段的描述信息和至少一个角色的角色信息;其中,文本作品包括多个文本片段,角色信息包括角色在至少一个维度的属性信息;针对至少一个角色中的角色,基于角色的角色信息生成角色的角色形象图;以及根据文本片段的描述信息和角色的角色形象图,生成文本片段的插图。
在本公开的第二方面,提供了一种插图生成的装置。该装置包括:确定模块,被配置用于根据文本作品确定文本片段的描述信息和至少一个角色的角色信息;其中,文本作品包括多个文本片段,角色信息包括角色在至少一个维度的属性信息;形象生成模块,被配置用于针对至少一个角色中的角色,基于角色的角色信息生成角色的角色形象图;以及图像生成模块,被配置用于根据文本片段的描述信息和角色 的角色形象图,生成文本片段的插图。
在本公开的第三方面,提供了一种电子设备。该设备包括至少一个处理单元;以及至少一个存储器,至少一个存储器被耦合到至少一个处理单元并且存储用于由至少一个处理单元执行的指令。指令在由至少一个处理单元执行时使设备执行第一方面的方法。
在本公开的第四方面,提供了一种计算机可读存储介质。该计算机可读存储介质上存储有计算机程序,计算机程序可由处理器执行以实现第一方面的方法。
应当理解,本内容部分中所描述的内容并非旨在限定本公开的实施例的关键特征或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的描述而变得容易理解。
附图说明
结合附图并参考以下详细说明,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。在附图中,相同或相似的附图标记表示相同或相似的元素,其中:
图1示出了本公开的实施例能够在其中实现的示例环境的示意图;
图2A和2B分别示出了根据本公开的一些实施例的用于为文本作品生成插图的示例架构的示意图;
图3示出了根据本公开的一些实施例的示例角色图像的示意图;
图4示出了根据本公开的一些实施例的示例插图的示意图;
图5示出了根据本公开的一些实施例的用于为文本作品生成插图的过程的流程图;
图6示出了根据本公开的一些实施例的用于为文本作品生成插图的装置的示意性结构框图;以及
图7示出了其中可以实施本公开的一个或多个实施例的电子设备的框图。
具体实施方式
下面将参照附图更详细地描述本公开的实施例。虽然附图中示出了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反,提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
在本公开的实施例的描述中,术语“包括”及其类似用语应当理解为开放性包含,即“包括但不限于”。术语“基于”应当理解为“至少部分地基于”。术语“一个实施例”或“该实施例”应当理解为“至少一个实施例”。术语“一些实施例”应当理解为“至少一些实施例”。下文还可能包括其他明确的和隐含的定义。
在本文中,除非明确说明,“响应于A”执行一个步骤并不意味着在“A”之后立即执行该步骤,而是可以包括一个或多个中间步骤。
可以理解的是,本技术方案所涉及的数据(包括但不限于数据本身、数据的获得或使用)应当遵循相应法律法规及相关规定的要求。
可以理解的是,在使用本公开各实施例公开的技术方案之前,均应当根据相关法律法规通过适当的方式对本公开所涉及个人信息的类型、使用范围、使用场景等告知用户并获得用户的授权。
例如,在响应于接收到用户的主动请求时,向用户发送提示信息,以明确地提示用户,其请求执行的操作将需要获得和使用到用户的个人信息,从而使得用户可以根据提示信息来自主地选择是否向执行本公开技术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供个人信息。
作为一种可选的但非限制性的实现方式,响应于接收到用户的主动请求,向用户发送提示信息的方式,例如可以是弹窗的方式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或“不同意”向电子设备提供个人信息的选择控件。
可以理解的是,上述通知和获得用户授权过程仅是示意性的,不对本公开的实现方式构成限定,其他满足相关法律法规的方式也可应 用于本公开的实现方式中。
如本文中所使用的,术语“模型”可以从训练数据中学习到相应的输入与输出之间的关联关系,从而在训练完成后可以针对给定的输入,生成对应的输出。模型的生成可以基于机器学习技术。深度学习是一种机器学习算法,通过使用多层处理单元来处理输入和提供相应输出。神经网络模型是基于深度学习的模型的一个示例。在本文中,“模型”也可以被称为“机器学习模型”、“学习模型”、“机器学习网络”或“学习网络”,这些术语在本文中可互换地使用。
“神经网络”是一种基于深度学习的机器学习网络。神经网络能够处理输入并且提供相应输出,其通常包括输入层和输出层以及在输入层与输出层之间的一个或多个隐藏层。在深度学习应用中使用的神经网络通常包括许多隐藏层,从而增加网络的深度。神经网络的各个层按顺序相连,从而前一层的输出被提供作为后一层的输入,其中输入层接收神经网络的输入,而输出层的输出作为神经网络的最终输出。神经网络的每个层包括一个或多个节点(也称为处理节点或神经元),每个节点处理来自上一层的输入。
通常,机器学习大致可以包括三个阶段,即训练阶段、测试阶段和应用阶段(也称为推理阶段)。在训练阶段,给定的模型可以使用大量的训练数据进行训练,不断迭代更新参数值,直到模型能够从训练数据中获得一致的满足预期目标的推理。通过训练,模型可以被认为能够从训练数据中学习从输入到输出之间的关联(也称为输入到输出的映射)。训练后的模型的参数值被确定。在测试阶段,将测试输入应用到训练后的模型,以测试模型是否能够提供正确的输出,从而确定模型的性能。测试阶段有时候可以被融合在训练阶段。在应用或推理阶段,已训练的模型可以被用于基于训练得到的参数值,对实际的模型输入进行处理,确定对应的模型输出。
如前文所简要提及的,为提高用户浏览电子书籍时的用户兴趣,可以通过在电子书籍中插入插图的方式来提高电子书籍的趣味性,进而提高用户的用户兴趣。传统上,通常由工作人员来人工为小说绘制 插图,并将该插图插入小说。这需要耗费大量人力成本,且生成插图的效率较差。为了便于描述,在下文中仅以小说作为文本作品的示例。备选地和/或附加地,文本作品例如可以包括但不限于小说、短文、散文、诗歌、剧本等。
根据本公开的实施例,提出了一种插图生成。根据本公开实施例的方案,根据文本作品确定文本片段的描述信息和至少一个角色的角色信息;其中,文本作品包括多个文本片段,角色信息包括角色在至少一个维度的属性信息。针对至少一个角色中的角色,基于角色的角色信息生成角色的角色形象图。根据文本片段的描述信息和角色的角色形象图,生成文本片段的插图。
以此方式,可以在保证插图质量的同时,方便快捷地基于小说的文本内容来生成多个插图,这可以提高生成插图的效率。此外,基于小说内容来为小说插入插图,可以提高读者阅读小说时的趣味性。
图1示出了本公开的实施例能够在其中实现的示例环境100的示意图。如图1所示,环境100可以包括电子设备110。
电子设备110可以获取目标小说102并生成与目标小说102相匹配的至少一个插图112(例如可以包括插图112-1、112-2、……、112-N,其中N为正整数,为了方便描述,下文可以将一个或多个插图统称为插图112)。在一些实施例中,电子设备110可以获取目标小说102的文本内容,并基于获取到的目标小说102的文本内容来生成至少一个插图112。在一些实施例中,如果至少一个插图112包括多个插图,不同插图可以对应于目标小说102的不同文本片段。
在一些实施例中,电子设备110可以借助经训练的机器学习模型120来生成与目标小说102相匹配的至少一个插图112。机器学习模型例如可以为图像生成模型。机器学习模型120例如可以包括但不限于Transformer模型、卷积神经网络(CNN)、循环神经网络(RNN)、深度神经网络(DNN)等任意适当的模型。机器学习模型120可以是电子设备110本地的模型,也可以是被安装在其他电子设备110的模型(例如安装在远端设备中)。需要注意的是,机器学习模型120可 以包括多个模型,本公开并不限定机器学习模型120具体包括的模型的数目以及类型。
电子设备110可以包括具有计算能力的任何计算系统,例如各种计算设备/系统、终端设备、服务端设备等。终端设备可以是任意类型的移动终端、固定终端或便携式终端,包括移动手机、台式计算机、膝上型计算机、笔记本计算机、上网本计算机、平板计算机、媒体计算机、多媒体平板、掌上电脑、便携式游戏终端、VR/AR设备、个人通信系统(Personal Communication System,PCS)设备、个人导航设备、个人数字助理(Personal Digital Assistant,PDA)、音频/视频播放器、数码相机/摄像机、定位设备、电视接收器、无线电广播接收器、电子书设备、游戏设备或者前述各项的任意组合,包括这些设备的配件和外设或者其任意组合。服务端设备可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络、以及大数据和人工智能平台等基础云计算服务的云服务器。服务端设备例如可以包括计算系统/服务器,诸如大型机、边缘计算节点、云环境中的计算设备,等等。
应当理解,仅出于示例性的目的描述环境100中各个元素的结构和功能,而不暗示对于本公开的范围的任何限制。以下将继续参考附图描述本公开的一些示例实施例。
图2A示出了根据本公开的一些实施例的用于为文本作品生成插图的示例架构200A的示意图。架构200A可以被实现在电子设备110处。为便于讨论,将参考图1的环境100来描述架构200A。图2A示出了插图生成过程的概要,文本作品201可以包括多个文本片段202-1、…、202-N(单独地和/或统称为文本片段202)。可以根据文本作品201来确定文本片段(例如,文本片段202-1)的描述信息204。可以确定文本作品201的至少一个角色的角色信息203,该角色信息203包括角色在至少一个维度的属性信息。在此,维度例如可以包括 所述角色的姓名、性别、年龄、职业、容貌、神态、以及服装,等等。针对至少一个角色中的角色,可以基于角色的角色信息203生成角色的角色形象图205。
进一步,可以根据文本片段202的描述信息204和角色的角色形象图205,生成文本片段202的插图。以此方式,可以为文本作品中的各个文本片段生成相应的插图,进而提高读者阅读文本作品时的趣味性。
在一些实施例中,文本作品201可以包括多个文本片段,并且可以基于如下方式来确定各个文本片段:获取所述文本作品的结构信息,并且基于所述结构信息来将所述文本作品划分为所述多个文本片段。在此,结构信息可以包括文本作品的目录结构,例如可以按照目录结构中定义的多级标题的层次,来确定多个文本片段。可以预先指定用于划分文本片段的规则,例如,文本片段可以包括“章”、“节”、或者包括一个或者多个段落,等等。以此方式,可以按照不同的精度来划分文本片段,并且生成更加匹配于该文本片段的内容的插图。
参见图2B描述有关插图生成的更多细节,该图2B示出了根据本公开的一些实施例的用于为文本作品生成插图的示例架构200B的示意图。架构200B可以被实现在电子设备110处。为便于讨论,将参考图1的环境100来描述架构200B。
如图2B所示,架构200B包括描述信息提取单元210和角色信息获取单元220。描述信息提取单元210例如可以用于从小说的文本片段中提取文本片段的描述信息215(例如,概要等)。在一些实施例中,电子设备110可以获取的小说中的各个文本片段并将其提供给描述信息提取单元210,可以基于预定规则对小说中各个文本片段执行处理以获取多个文本片段的描述信息。
这里的预定规则例如可以指示每个文本片段所包括的文本单元(例如,章节、段落、句子、或者词语,等等)的最大数目。例如,预定规则可以指示每个文本片段最多可以包括一章、一节、一段、或者50个文本单元,等等。可以基于这样的预定规则,对小说的全文 执行分段处理(例如以一章、一节、一段、或者50个文本单元作为一个文本片段),以获取到多个文本片段。描述信息提取单元210进而可以提取多个文本片段各自对应的描述信息。
在一些实施例中,这里的文本片段例如可以是在电子书籍阅读器中呈现的当前页面的预定范围内的文本片段。电子设备110例如可以响应于在电子书籍阅读器中检测到的翻页操作而获取在电子书籍阅读器中呈现的当前页面的预定范围内的文本片段,并将该文本片段提供给描述信息提取单元210。可以理解,当前页面呈现有至少一个文本片段。电子设备110获取的在当前页面的预定范围内的文本片段为至少一个文本片段的至少部分。例如,若当前页面包括2个文本片段,电子设备110获取到的可以是呈现在当前页面上半部分的那一个文本片段。在这种情况下,描述信息提取单元210例如可以仅从获取到的文本片段中提取针对该文本片段的描述信息215。由此,电子设备110可以随着读者的翻页动作来获取文本片段进而生成插图。
在一些实施例中,描述信息可以包括角色所在环境的环境信息、以及角色的动作信息。描述信息提取单元210例如可以通过总结文本片段中的至少一个角色以及与这至少一个角色相关联的环境信息和动作信息来确定针对文本片段的描述信息215。示例性地,针对文本片段A“角色A早起做好了早餐,又把客厅里乱七八糟的玩具收拾好,再拖了地,才拿了两只蒸好的馒头,出门了”。
描述信息提取单元210可以确定文本片段A仅包括角色A。描述信息提取单元210所生成的描述信息中的环境信息例如可以为“家”,并且动作信息例如可以为“角色A早起做家务”。需要注意的是,不是每个文本片段都包括角色,例如文本片段B“从今以后,他们AA制,不管什么费用,都一人一半”,其不包括角色,也不包括与角色相关联的动作,因此,描述信息提取单元210可以不生成文本片段B对应的描述信息。
角色信息获取单元220可以获取至少一个角色的角色信息225。这里的至少一个角色可以是角色信息获取单元220基于文本作品全文、 或者当前文本片段来自行确定的,也可以是电子设备110确定好并提供给角色信息获取单元220的。具体地,电子设备110/角色信息获取单元220可以确定小说中的至少一个角色。例如,若包括“角色A早起做家务”、“角色A听到爸爸妈妈吵架”和“角色A决定出门散心”这3个文本片段的描述信息,电子设备110/角色信息获取单元220可以确定包括“角色A”、“爸爸”和“妈妈”三个角色。
在一些实施例中,角色信息获取单元220还可以针对至少一个角色中的目标角色,确定目标角色在文本片段中的出现次数,进而确定主要角色。例如可以响应于确定出现次数满足预定条件,获取目标角色的角色信息。这里的预定条件例如可以指示预定次数(例如3次、5次等任意次数),角色信息获取单元220例如可以响应于确定出现次数达到预定次数,获取目标角色的角色信息。由此,可以仅获取出现次数较多的角色的角色信息,可以降低最后的插图生成成本。备选地和/或附加地,假设文本片段仅包括一个角色并且该角色的出现次数低于预定次数,仍然可以获取该角色的角色信息。
至少一个角色的角色信息225可以包括至少一个角色的多个属性。这里的多个属性例如可以包括角色的姓名、性别、年龄、职业、容貌、神态、以及服装中的任意一项或多项。
在一些实施例中,为了确定至少一个角色的角色信息,针对目标角色,可以基于文本作品中的与目标角色相关联的部分,确定目标角色的角色信息。进一步,可以基于文本片段中的与目标角色相关联的部分,更新目标角色的角色信息。例如,可以从整个文本作品中确定角色的基础属性,例如,姓名、性别、年龄、职业。进一步,可以从当前正在处理的文本片段中确定该角色当前片段中的特殊属性,例如,当前的容貌、神态和服装,等等。
假设文本片段1涉及冬季场景,则基于该文本片段1可以确定角色的服装为“大衣”。假设文本片段2涉及夏季场景,则基于该文本片段2可以确定角色的服装为“连衣裙”。在角色信息和文本作品的各个文本片段之间可以存在映射关系。以此方式,一方面可以确保角 色信息匹配于该角色的基本特征,另一方面可以确保角色信息可以随着文本作品中的故事推进反映当前状态。
在一些实施例中,按照具体确定方式,多个属性可以被分为两部分,其中的第一部分可以是从小说中直接确定的,第二部分可以是从小说中间接确定的,也可以是人工设置的。示例性地,多个属性中的角色的姓名、性别等可以为第一部分的属性。角色信息获取单元220例如可以从小说中确定第一部分的属性。需要注意的是,角色信息获取单元220可以从小说全文中获取角色A的第一部分的属性,而不会受限于文本片段。
示例性地,如果小说中明确记载了角色的容貌、神态、服装等属性,则可以将上述属性作为第一部分的属性。如果小说中不包括与第二部分的属性相关联的文本,电子设备110可以接收用户(例如相关工作人员)的用户输入,并基于用户输入来确定第二部分的属性。例如,电子设备110可以在电子书籍阅读器中提供用于设置角色的多个属性中的第二部分的设置控件,并响应于接收到针对设置控件的设置操作,基于设置操作来设置多个属性中的第二部分。这样的设置控件例如可以为输入框。电子设备110例如可以经由输入框来接收用户的用户输入,并基于用户输入确定多个属性中的第二部分。电子设备110例如可以将确定的第二部分的属性提供给角色信息获取单元220以使得角色信息获取单元220获取到第二部分的属性。以此方式,允许用户在阅读过程中按照自身的需求来指定角色的属性(例如,服装款式和颜色,等等),进而生成符合自身需求的插图。
电子设备110可以基于文本片段的描述信息215和至少一个角色的角色信息225,生成小说的插图112。电子设备110可以基于任意适当的方式,并利用文本片段的描述信息215和至少一个角色的角色信息225生成插图112,本公开并不对具体的生成插图的方式进行限定。例如,电子设备110可以基于预先获取的规则或算法来生成插图112。在一些实施例中的,电子设备110可以借助经训练的机器学习模型来生成插图。在这种情况下,架构200B还可以包括提示词确定 单元230和机器学习模型120。
提示词确定单元230例如可以用于基于描述信息以及角色信息,生成针对机器学习模型120的提示词235。提示词确定单元230例如可以获取预定的提示词模板,并通过将描述信息以及角色信息填充至该提示词模板来生成提示词235。例如,提示词模板可以包括:环境信息、角色、动作信息,可以将获取的各种信息填充至模板的相应位置,进而生成提示词。
在一些实施例中,为了保证后续生成的插图中的角色的统一性,提示词确定单元230还可以调用角色图像确定单元250和角色模型生成单元260。在此,角色图像例如可以表示该角色的在多个角度下的角色形象图,并且角色图像确定单元250例如可以小说中至少一个角色的角色信息,确定针对至少一个角色的角色图像255。角色图像确定单元250可以采用任意适当的方式来确定角色图像255。例如,角色图像确定单元250可以借助经训练的图像生成模型来基于至少一个角色的角色信息生成针对至少一个角色的角色图像255。备选地或者附加地,在一些实施例中,角色图像确定单元250也可以直接获取用户输入的角色图像(例如插画师针对至少一个角色所绘制的角色图像)。
图3示出了根据本公开的一些实施例的示例角色图像300的示意图。角色图像确定单元250例如可以基于角色A的角色信息“角色A,25岁,女,卷发,穿连衣裙”来生成角色A的角色图像300。角色图像300可以包括角色A在多个角度下的多个图像(例如侧偏45度的图像301,侧面图像302,正面图像303和反面图像304)。
针对每个角色,角色模型生成单元260可以基于该角色对应的角色图像255,生成用于描述该角色的角色模型265。角色模型265例如可以为LoRA模型。LoRA模型可以被理解为稳定扩散(Stable Diffusion,缩写SD)模型(一种生成式模型)的一种插件,其可以使用于满足一种特定的风格,或指定的人物特征属性。
可以将基于角色图像生成角色的角色模型的过程理解为将角色 图像以角色模型的形式进行存储。提示词确定单元230后续可以灵活调用不同的角色模型以调用不同的角色图像。提示词确定单元230可以获取至少一个角色各自的角色模型265,并基于角色模型265和文本片段的描述信息215来确定提示词235。例如,提示词确定单元230可以基于描述信息“角色A早起做家务”和角色A对应的角色模型A,生成提示词“角色A<模型A>在家中做早餐”。
在一些实施例中,提示词确定单元230还可以基于角色模型的权重指标,更新提示词235。权重指标可以用于指示插图中的角色和角色对应的角色图像之间的相似度。例如,若提示词为“角色A<模型A,0.5>在家中做早餐”,则该提示词指示后续生成的插图中的角色A和角色A对应的角色图像之间的相似度为50%。可以理解,权重指标越高,插图中的角色和角色对应的角色图像之间的相似度越高,二者越相像。利用本公开的实施例,可以在确保小说角色的外观一致性的情况下,调整各个插图中的角色细节。
在一些实施例中,提示词确定单元230还可以基于小说的背景环境来确定插图的风格,并基于风格来更新提示词235。例如,若小说背景为现代都市背景,则插图的风格可以被确定为“漫画风”,提示词例如可以为“角色A<模型A,0.5>在家中做早餐漫画风”。若小说背景为古代武侠背景,则插图的风格可以被确定为“水墨风”,提示词例如可以为“角色A<模型A,0.5>在家中做早餐水墨风”。利用本公开的实施例,可以以更为灵活的方式生成具有更为丰富的视觉效果的插图。
提示词确定单元230可以将确定的提示词235提供给机器学习模型120。机器学习模型120进而可以基于获取到的提示词235来生成插图112。示例性地,图4示出了根据本公开的一些实施例的示例插图400的示意图。若提示词为“角色A<模型A,0.5>在家中做早餐”,机器学习模型120可以调用模型A,并基于权重指标0.5来生成一张内容为角色A在家中做早餐的插图400。
在一些实施例中,电子设备110可以获取至少一个角色对应的至 少一个插图(每个角色可以对应于多个插图),并向小说中的与文本片段相关联的位置处插入插图。示例性地,如果电子设备110基于文本片段A生成插图A,电子设备110可以将插图A插入文本片段A处(例如文本片段A的内部、文本片段A之前/之后等)。电子设备110例如还可以响应于接收到用于调整插图的调整操作,基于调整操作来调整插图。这里的调整操作例如可以包括针对插图的更新操作,删除操作,和/或,移动操作。示例性地,电子设备110可以响应于接收到用户针对插图A的删除操作,删除插入小说中的插图A。电子设备110可以响应于接收到用户针对将插图A从位置A处移动到为止B处的移动操作,移动插图A,移动后的插图A位于位置B处。
综上所述,根据本公开的实施例,可以在保证插图质量的同时,方便快捷地基于小说的文本内容来生成多个插图,这可以提高生成插图的效率。此外,基于小说内容来为小说插入插图,可以提高读者阅读小说时的趣味性。
上文已经描述了为文本作品生成插图的各个步骤的具体细节,提供了一种用于为文本作品生成插图的方法。图5示出了根据本公开的一些实施例的用于为文本作品生成插图的过程500的流程图。过程500可以被实现在电子设备110处。下面参考图1描述过程500。
在框510处,根据文本作品确定文本片段的描述信息和至少一个角色的角色信息;其中,文本作品包括多个文本片段,角色信息包括角色在至少一个维度的属性信息。
在框520处,针对至少一个角色中的角色,基于角色的角色信息生成角色的角色形象图。
在框530处,根据文本片段的描述信息和角色的角色形象图,生成文本片段的插图。
在一些实施例中,多个文本片段是基于以下来确定的:获取文本作品的结构信息;以及基于结构信息来将文本作品划分为多个文本片段。
在一些实施例中,至少一个角色是基于以下来确定的:针对文本 作品中的多个角色中的目标角色,确定目标角色在文本片段中的出现次数;以及响应于确定出现次数满足预定条件,将目标角色作为至少一个角色中的角色。
在一些实施例中,确定至少一个角色的角色信息包括:针对目标角色,基于文本作品中的与目标角色相关联的部分,确定目标角色的角色信息;以及基于文本片段中的与目标角色相关联的部分,更新目标角色的角色信息。
在一些实施例中,描述信息包括角色所在环境的环境信息、以及角色的动作信息,并且生成文本片段的插图包括:基于角色形象图,生成用于描述角色的角色模型;利用环境信息、动作信息以及角色模型,生成机器学习模型的提示词;以及基于提示词来生成插图。
在一些实施例中,生成提示词进一步包括:基于角色模型的权重指标,更新提示词。
在一些实施例中,生成提示词进一步包括:基于文本作品的背景环境来确定插图的风格;以及基于风格来更新提示词。
在一些实施例中,过程500进一步包括:向文本作品中的与文本片段相关联的位置处插入插图;以及响应于接收到用于调整插图的调整操作,基于调整操作来调整插图,调整操作包括以下至少任一项:针对插图的更新操作、删除操作、以及移动操作。
在一些实施例中,至少一个维度的属性信息包括以下至少任一项:角色的姓名、性别、年龄、职业、容貌、神态、以及服装,至少一个维度的属性信息中的第一部分是从文本作品中确定的。
在一些实施例中,该过程500在用于阅读文本作品的电子书籍阅读器中被实现,并且过程500进一步包括:在电子书籍阅读器中提供用于设置至少一个维度的属性信息中的第二部分的设置控件;以及响应于接收到针对设置控件的设置操作,基于设置操作来设置至少一个维度的属性信息中的第二部分。
根据本公开的一些实施例,文本片段是在电子书籍阅读器中呈现的当前页面的预定范围内的文本片段,并且方法响应于在电子书籍阅 读器中检测到的翻页操作而被执行。
根据本公开的一些实施例,还提供了一种用于为文本作品生成插图的装置。图6示出了根据本公开的一些实施例的用于为文本作品生成插图的装置600的示意性结构框图。装置600可以被实现为或者被包括在电子设备110中。装置600中的各个模块/组件可以由硬件、软件、固件或者它们的任意组合来实现。
如图6所示,装置600包括:确定模块610,被配置用于根据文本作品确定文本片段的描述信息和至少一个角色的角色信息;其中,文本作品包括多个文本片段,角色信息包括角色在至少一个维度的属性信息;形象生成模块620,被配置用于针对至少一个角色中的角色,基于角色的角色信息生成角色的角色形象图;以及图像生成模块630,被配置用于根据文本片段的描述信息和角色的角色形象图,生成文本片段的插图。
在一些实施例中,多个文本片段是基于以下来确定的:获取文本作品的结构信息;以及基于结构信息来将文本作品划分为多个文本片段。
在一些实施例中,至少一个角色是基于以下来确定的:针对文本作品中的多个角色中的目标角色,确定目标角色在文本片段中的出现次数;以及响应于确定出现次数满足预定条件,将目标角色作为至少一个角色中的角色。
在一些实施例中,确定模块610进一步被配置用于:针对目标角色,基于文本作品中的与目标角色相关联的部分,确定目标角色的角色信息;以及基于文本片段中的与目标角色相关联的部分,更新目标角色的角色信息。
在一些实施例中,描述信息包括角色所在环境的环境信息、以及角色的动作信息,并且图像生成模块进一步被配置用于:基于角色形象图,生成用于描述角色的角色模型;利用环境信息、动作信息以及角色模型,生成机器学习模型的提示词;以及基于提示词来生成插图。
在一些实施例中,图像生成模块630进一步被配置用于:基于角 色模型的权重指标,更新提示词。
在一些实施例中,图像生成模块630进一步被配置用于:基于文本作品的背景环境来确定插图的风格;以及基于风格来更新提示词。
在一些实施例中,该装置600进一步包括:插入模块,被配置用于向文本作品中的与文本片段相关联的位置处插入插图;以及调整模块,被配置用于响应于接收到用于调整插图的调整操作,基于调整操作来调整插图,调整操作包括以下至少任一项:针对插图的更新操作、删除操作、以及移动操作。
在一些实施例中,至少一个维度的属性信息包括以下至少任一项:角色的姓名、性别、年龄、职业、容貌、神态、以及服装,至少一个维度的属性信息中的第一部分是从文本作品中确定的。
在一些实施例中,该装置600在用于阅读文本作品的电子书籍阅读器中被实现,并且装置600进一步包括:提供模块,被配置用于在电子书籍阅读器中提供用于设置至少一个维度的属性信息中的第二部分的设置控件;以及设置模块,被配置用于响应于接收到针对设置控件的设置操作,基于设置操作来设置至少一个维度的属性信息中的第二部分。
在一些实施例中,文本片段是在电子书籍阅读器中呈现的当前页面的预定范围内的文本片段,并且装置响应于在电子书籍阅读器中检测到的翻页操作而被调用。
装置600中所包括的单元和/或模块可以利用各种方式来实现,包括软件、硬件、固件或其任意组合。在一些实施例中,一个或多个单元和/或模块可以使用软件和/或固件来实现,例如存储在存储介质上的机器可执行指令。除了机器可执行指令之外或者作为替代,装置600中的部分或者全部单元和/或模块可以至少部分地由一个或多个硬件逻辑组件来实现。作为示例而非限制,可以使用的示范类型的硬件逻辑组件包括现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准品(ASSP)、片上系统(SOC)、复杂可编程逻辑器件(CPLD),等等。
图7示出了其中可以实施本公开的一个或多个实施例的电子设备700的框图。应当理解,图7所示出的电子设备700仅仅是示例性的,而不应当构成对本文所描述的实施例的功能和范围的任何限制。图7所示出的电子设备700可以用于实现图1的电子设备110,和/或,图6的装置600。
如图7所示,电子设备700是通用计算设备的形式。电子设备700的组件可以包括但不限于一个或多个处理器或处理单元710、存储器720、存储设备730、一个或多个通信单元740、一个或多个输入设备750以及一个或多个输出设备760。处理单元710可以是实际或虚拟处理器并且能够根据存储器720中存储的程序来执行各种处理。在多处理器系统中,多个处理单元并行执行计算机可执行指令,以提高电子设备700的并行处理能力。
电子设备700通常包括多个计算机存储介质。这样的介质可以是电子设备700可访问的任何可以获得的介质,包括但不限于易失性和非易失性介质、可拆卸和不可拆卸介质。存储器720可以是易失性存储器(例如寄存器、高速缓存、随机访问存储器(RAM))、非易失性存储器(例如,只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、闪存)或它们的某种组合。存储设备730可以是可拆卸或不可拆卸的介质,并且可以包括机器可读介质,诸如闪存驱动、磁盘或者任何其他介质,其可以能够用于存储信息和/或数据并且可以在电子设备700内被访问。
电子设备700可以进一步包括另外的可拆卸/不可拆卸、易失性/非易失性存储介质。尽管未在图7中示出,可以提供用于从可拆卸、非易失性磁盘(例如“软盘”)进行读取或写入的磁盘驱动和用于从可拆卸、非易失性光盘进行读取或写入的光盘驱动。在这些情况中,每个驱动可以由一个或多个数据介质接口被连接至总线(未示出)。存储器720可以包括计算机程序产品725,其具有一个或多个程序模块,这些程序模块被配置为执行本公开的各种实现方式的各种方法或动作。
通信单元740实现通过通信介质与其他计算设备进行通信。附加地,电子设备700的组件的功能可以以单个计算集群或多个计算机器来实现,这些计算机器能够通过通信连接进行通信。因此,电子设备700可以使用与一个或多个其他服务器、网络个人计算机(PC)或者另一个网络节点的逻辑连接来在联网环境中进行操作。
输入设备750可以是一个或多个输入设备,例如鼠标、键盘、追踪球等。输出设备760可以是一个或多个输出设备,例如显示器、扬声器、打印机等。电子设备700还可以根据需要通过通信单元740与一个或多个外部设备(未示出)进行通信,外部设备诸如存储设备、显示设备等,与一个或多个使得用户与电子设备700交互的设备进行通信,或者与使得电子设备700与一个或多个其他计算设备通信的任何设备(例如,网卡、调制解调器等)进行通信。这样的通信可以经由输入/输出(I/O)接口(未示出)来执行。
根据本公开的示例性实现方式,提供了一种计算机可读存储介质,其上存储有计算机可执行指令,其中计算机可执行指令被处理器执行以实现上文描述的方法。根据本公开的示例性实现方式,还提供了一种计算机程序产品,计算机程序产品被有形地存储在非瞬态计算机可读介质上并且包括计算机可执行指令,而计算机可执行指令被处理器执行以实现上文描述的方法。
这里参照根据本公开实现的方法、装置、设备和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理单元,从而生产出一种机器,使得这些指令在通过计算机或其他可编程数据处理装置的处理单元执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特 定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
可以把计算机可读程序指令加载到计算机、其他可编程数据处理装置、或其他设备上,使得在计算机、其他可编程数据处理装置或其他设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其他可编程数据处理装置、或其他设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实现的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
以上已经描述了本公开的各实现,上述说明是示例性的,并非穷尽性的,并且也不限于所公开的各实现。在不偏离所说明的各实现的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实现的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其他普通技术人员能理解本文公开的各个实现方式。

Claims (14)

  1. 一种插图生成方法,包括:
    根据文本作品确定文本片段的描述信息和至少一个角色的角色信息;其中,所述文本作品包括多个所述文本片段,所述角色信息包括所述角色在至少一个维度的属性信息;
    针对所述至少一个角色中的角色,基于所述角色的角色信息生成所述角色的角色形象图;以及
    根据所述文本片段的描述信息和所述角色的角色形象图,生成所述文本片段的插图。
  2. 根据权利要求1所述的方法,其中所述多个文本片段是基于以下来确定的:
    获取所述文本作品的结构信息;以及
    基于所述结构信息来将所述文本作品划分为所述多个文本片段。
  3. 根据权利要求1所述的方法,其中所述至少一个角色是基于以下来确定的:
    针对所述文本作品中的多个角色中的目标角色,确定所述目标角色在所述文本片段中的出现次数;以及
    响应于确定所述出现次数满足预定条件,将所述目标角色作为所述至少一个角色中的角色。
  4. 根据权利要求3所述的方法,其中确定所述至少一个角色的所述角色信息包括:
    针对所述目标角色,基于所述文本作品中的与所述目标角色相关联的部分,确定所述目标角色的角色信息;以及
    基于所述文本片段中的与所述目标角色相关联的部分,更新所述目标角色的角色信息。
  5. 根据权利要求1所述的方法,其中所述描述信息包括所述角色所在环境的环境信息、以及所述角色的动作信息,并且生成所述文本片段的所述插图包括:
    基于所述角色形象图,生成用于描述所述角色的角色模型;
    利用所述环境信息、所述动作信息以及所述角色模型,生成机器学习模型的提示词;以及
    基于所述提示词来生成所述插图。
  6. 根据权利要求5所述的方法,其中生成所述提示词进一步包括:基于所述角色模型的权重指标,更新所述提示词。
  7. 根据权利要求5所述的方法,其中生成所述提示词进一步包括:
    基于所述文本作品的背景环境来确定所述插图的风格;以及
    基于所述风格来更新所述提示词。
  8. 根据权利要求1所述的方法,进一步包括:
    向所述文本作品中的与所述文本片段相关联的位置处插入所述插图;以及
    响应于接收到用于调整所述插图的调整操作,基于所述调整操作来调整所述插图,所述调整操作包括以下至少任一项:针对所述插图的更新操作、删除操作、以及移动操作。
  9. 根据权利要求1所述的方法,其中所述至少一个维度的属性信息包括以下至少任一项:所述角色的姓名、性别、年龄、职业、容貌、神态、以及服装,所述至少一个维度的属性信息中的第一部分是从所述文本作品中确定的。
  10. 根据权利要求9所述的方法,其中所述方法在用于阅读所述文本作品的电子书籍阅读器中被实现,并且所述方法进一步包括:
    在所述电子书籍阅读器中提供用于设置所述至少一个维度的属性信息中的第二部分的设置控件;以及
    响应于接收到针对所述设置控件的设置操作,基于所述设置操作来设置所述至少一个维度的属性信息中的第二部分。
  11. 根据权利要求10所述的方法,其中所述文本片段是在所述电子书籍阅读器中呈现的当前页面的预定范围内的文本片段,并且所述方法响应于在所述电子书籍阅读器中检测到的翻页操作而被执行。
  12. 一种插图生成的装置,包括:
    确定模块,被配置用于根据文本作品确定文本片段的描述信息和至少一个角色的角色信息;其中,所述文本作品包括多个所述文本片段,所述角色信息包括所述角色在至少一个维度的属性信息;
    形象生成模块,被配置用于针对所述至少一个角色中的角色,基于所述角色的角色信息生成所述角色的角色形象图;以及
    图像生成模块,被配置用于根据所述文本片段的描述信息和所述角色的角色形象图,生成所述文本片段的插图。
  13. 一种电子设备,包括:
    至少一个处理单元;以及
    至少一个存储器,所述至少一个存储器被耦合到所述至少一个处理单元并且存储用于由所述至少一个处理单元执行的指令,所述指令在由所述至少一个处理单元执行时使所述电子设备执行根据权利要求1至11中任一项所述的方法。
  14. 一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序可由处理器执行以实现根据权利要求1至11中任一项所述的方法。
PCT/CN2024/084222 2024-03-27 2024-03-27 用于插图生成的方法、装置、设备和存储介质 Pending WO2025199829A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2024/084222 WO2025199829A1 (zh) 2024-03-27 2024-03-27 用于插图生成的方法、装置、设备和存储介质
CN202480003590.5A CN121039706A (zh) 2024-03-27 2024-03-27 用于插图生成的方法、装置、设备和存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2024/084222 WO2025199829A1 (zh) 2024-03-27 2024-03-27 用于插图生成的方法、装置、设备和存储介质

Publications (1)

Publication Number Publication Date
WO2025199829A1 true WO2025199829A1 (zh) 2025-10-02

Family

ID=97219044

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/084222 Pending WO2025199829A1 (zh) 2024-03-27 2024-03-27 用于插图生成的方法、装置、设备和存储介质

Country Status (2)

Country Link
CN (1) CN121039706A (zh)
WO (1) WO2025199829A1 (zh)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108470036A (zh) * 2018-02-06 2018-08-31 北京奇虎科技有限公司 一种基于故事文本生成视频的方法和装置
US10074200B1 (en) * 2015-04-22 2018-09-11 Amazon Technologies, Inc. Generation of imagery from descriptive text
CN116894881A (zh) * 2023-07-21 2023-10-17 河北烽联信息技术有限公司 图像生成方法、装置、电子设备和存储介质
CN116954437A (zh) * 2023-07-27 2023-10-27 腾讯科技(上海)有限公司 信息互动处理方法、装置、设备及计算机存储介质
CN117171369A (zh) * 2023-09-15 2023-12-05 北京字跳网络技术有限公司 一种内容生成方法、装置、计算机设备及存储介质
CN117332118A (zh) * 2023-10-24 2024-01-02 科大讯飞股份有限公司 一种故事视频的生成方法、装置、存储介质及设备
WO2024049600A1 (en) * 2022-09-02 2024-03-07 Microsoft Technology Licensing, Llc Generating image from text based on prompts
CN117689751A (zh) * 2023-12-08 2024-03-12 广州酷狗计算机科技有限公司 插图生成方法、装置、设备及存储介质
CN117689752A (zh) * 2023-12-08 2024-03-12 广州酷狗计算机科技有限公司 文学作品插图生成方法、装置、设备及存储介质

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10074200B1 (en) * 2015-04-22 2018-09-11 Amazon Technologies, Inc. Generation of imagery from descriptive text
CN108470036A (zh) * 2018-02-06 2018-08-31 北京奇虎科技有限公司 一种基于故事文本生成视频的方法和装置
WO2024049600A1 (en) * 2022-09-02 2024-03-07 Microsoft Technology Licensing, Llc Generating image from text based on prompts
CN116894881A (zh) * 2023-07-21 2023-10-17 河北烽联信息技术有限公司 图像生成方法、装置、电子设备和存储介质
CN116954437A (zh) * 2023-07-27 2023-10-27 腾讯科技(上海)有限公司 信息互动处理方法、装置、设备及计算机存储介质
CN117171369A (zh) * 2023-09-15 2023-12-05 北京字跳网络技术有限公司 一种内容生成方法、装置、计算机设备及存储介质
CN117332118A (zh) * 2023-10-24 2024-01-02 科大讯飞股份有限公司 一种故事视频的生成方法、装置、存储介质及设备
CN117689751A (zh) * 2023-12-08 2024-03-12 广州酷狗计算机科技有限公司 插图生成方法、装置、设备及存储介质
CN117689752A (zh) * 2023-12-08 2024-03-12 广州酷狗计算机科技有限公司 文学作品插图生成方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN121039706A (zh) 2025-11-28

Similar Documents

Publication Publication Date Title
US20200143248A1 (en) Machine learning model training method and device, and expression image classification method and device
KR20200094627A (ko) 텍스트 관련도를 확정하기 위한 방법, 장치, 기기 및 매체
US11264006B2 (en) Voice synthesis method, device and apparatus, as well as non-volatile storage medium
CN117197292B (zh) 用于生成图像的方法、装置、设备和存储介质
CN120088359A (zh) 风格化图标的自动生成
CN109670047B (zh) 一种抽象笔记生成方法、计算机装置及可读存储介质
US20200005184A1 (en) Skill generating method, apparatus, and electronic device
EP4673876A1 (en) Computed values for knowledge graph
CN110188339B (zh) 景点评价方法、装置、计算机设备和存储介质
WO2025251807A1 (zh) 生成音乐的方法、装置、设备和存储介质
WO2021115115A1 (en) Zero-shot dynamic embeddings for photo search
CN118276746A (zh) 用于图像编辑的方法、装置、设备、介质和程序产品
CN113655895A (zh) 应用于输入法的信息推荐方法、装置及电子设备
CN113392220A (zh) 一种知识图谱生成方法、装置、计算机设备及存储介质
WO2025199829A1 (zh) 用于插图生成的方法、装置、设备和存储介质
WO2025050994A1 (zh) 用于图像生成的方法、装置、设备和存储介质
CN116955763B (zh) 内容推荐方法、装置、计算机设备及计算机可读存储介质
WO2025199827A1 (zh) 用于文本作品呈现的方法、装置、设备和存储介质
WO2024088111A1 (zh) 图像处理方法、装置、设备、介质及程序产品
US20260073152A1 (en) Method, apparatus, device, and storage medium for training model
US20240346811A1 (en) Method, apparatus, device and storage medium for feature aggregation
EP4694148A1 (en) Method, apparatus, device and computer readable storage medium for video interaction
CN119557219A (zh) 生成数据的方法、装置、设备和可读介质
CN112836624B (zh) 一种文本处理方法、装置、存储介质和电子设备
WO2025200895A1 (zh) 用于图像处理的方法、装置、设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24932401

Country of ref document: EP

Kind code of ref document: A1