CN117787290A - Drawing prompting method and device based on knowledge graph - Google Patents

Drawing prompting method and device based on knowledge graph Download PDF

Info

Publication number
CN117787290A
CN117787290A CN202311854173.5A CN202311854173A CN117787290A CN 117787290 A CN117787290 A CN 117787290A CN 202311854173 A CN202311854173 A CN 202311854173A CN 117787290 A CN117787290 A CN 117787290A
Authority
CN
China
Prior art keywords
prompt
knowledge
determining
graph
word
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
CN202311854173.5A
Other languages
Chinese (zh)
Inventor
徐峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202311854173.5A priority Critical patent/CN117787290A/en
Publication of CN117787290A publication Critical patent/CN117787290A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Machine Translation (AREA)

Abstract

The embodiment of the application provides a drawing prompting method and device based on a knowledge graph, wherein the method comprises the following steps: receiving a drawing request input by a user; carrying out semantic analysis on the drawing request to obtain at least one keyword; determining target entities corresponding to each keyword through a preset recommendation model based on a knowledge graph, and determining a plurality of drawing prompt words according to the target entities corresponding to all the keywords; the plurality of drawing prompt words are displayed on the client. Therefore, by determining the drawing prompt word by using the recommendation model constructed based on the knowledge graph, the knowledge graph technology and the drawing application are combined, personalized, creative and intelligent drawing prompt can be provided for the user, so that the generated prompt word is ensured to be more in line with the drawing requirement of the user, and the user can easily acquire creative elicitations and guides related to the drawing request, thereby improving the quality and creativity of drawing.

Description

Drawing prompting method and device based on knowledge graph
Technical Field
The embodiment of the application relates to the technical field of internet, in particular to a drawing prompting method, a drawing prompting device, computer equipment and a computer readable storage medium based on a knowledge graph.
Background
In related drawing technology based on artificial intelligence, a series of keywords describing drawing are input into a drawing tool by a user, the drawing tool automatically generates an image according to the keywords input by the user, and finally, drawing conforming to the user description is generated. Users need to understand how to compose accurate and clear keywords and translate their creatives and ideas into succinct, clear words in order for drawing tools to understand and generate the desired images correctly.
However, it is difficult for some common users to write comprehensive and high-quality keywords quickly and conveniently, so that drawing tools cannot understand the actual drawing intention of the users, and the generated images have a larger difference from the intention of the users, and the experience of the users is poor.
Disclosure of Invention
An object of an embodiment of the present application is to provide a knowledge graph-based drawing prompting method, a knowledge graph-based drawing prompting device, a knowledge graph-based drawing prompting computer device, and a knowledge graph-based drawing prompting computer readable storage medium, which are used for solving the following problems: because the common user is difficult to conveniently and quickly write the comprehensive keywords with higher quality, the drawing tool cannot understand the real drawing intention of the user, and the generated image has larger difference with the intention of the user.
An aspect of an embodiment of the present application provides a drawing prompting method based on a knowledge graph, including:
receiving a drawing request input by a user;
carrying out semantic analysis on the drawing request to obtain at least one keyword;
determining target entities corresponding to each keyword through a preset recommendation model based on a knowledge graph, and determining a plurality of drawing prompt words according to the target entities corresponding to all the keywords;
the plurality of drawing prompt words are displayed on the client.
Optionally, the method further comprises:
determining a target drawing prompt word from the plurality of drawing prompt words in response to a selection operation acting on the plurality of drawing prompt words;
drawing according to the target drawing prompt word to generate an AI image.
Optionally, the method further comprises:
displaying a user feedback page on the client, wherein the user feedback page comprises a prompt effect evaluation component;
determining user evaluation data in response to a setting operation acting on the prompt effect evaluation component;
and updating the preset recommendation model based on the knowledge graph according to the user evaluation data.
Optionally, the semantic analysis of the drawing request to obtain at least one keyword includes:
Performing word segmentation processing on the drawing request to obtain a word segmentation sequence;
performing part-of-speech analysis on each word in the word segmentation sequence to determine the part-of-speech corresponding to each word;
performing entity recognition on each word in the word segmentation sequence to determine an entity corresponding to each word;
and extracting keywords according to the parts of speech and the entities corresponding to each vocabulary so as to obtain at least one keyword.
Optionally, the method further comprises:
acquiring a data source related to a drawing prompt;
determining standardized data related to the drawing prompt from the data source related to the drawing prompt;
carrying out structuring treatment on the standardized data to obtain structured data;
and constructing a drawing knowledge graph according to the structured data, wherein the drawing knowledge graph is used for describing the mapping relation between the keywords related to drawing and the entities.
Optionally, the determining standardized data related to the drawing hint from the data sources related to the drawing hint includes:
performing data cleaning on the data sources related to the drawing prompts;
and extracting standardized data related to the drawing prompt from the cleaned data source related to the drawing prompt.
Optionally, the determining a plurality of drawing prompt words according to the target entities corresponding to all the keywords includes:
determining recommended words corresponding to target entities corresponding to all keywords; each recommended word has one-to-one prediction probability;
and sequencing all recommended words according to the prediction probability to obtain a sequencing result, and determining a plurality of drawing prompt words according to the sequencing result.
An aspect of the embodiments of the present application further provides a drawing prompt device based on a knowledge graph, including:
the drawing request receiving module is used for receiving a drawing request;
the semantic analysis module is used for carrying out semantic analysis on the drawing request to obtain at least one keyword;
the drawing prompt word determining module is used for determining a target entity corresponding to each keyword through a preset recommendation model based on a knowledge graph, and determining a plurality of drawing prompt words according to the target entities corresponding to all the keywords;
and the drawing prompt word display module is used for displaying the drawing prompt words on the client.
An aspect of the embodiments of the present application further provides a computer device, where the computer device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the steps of the knowledge-graph-based drawing prompting method are implemented.
An aspect of the embodiments of the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program is executable by at least one processor, so that the at least one processor implements the steps of the knowledge-graph-based drawing prompting method as described above when the computer program is executed.
According to the drawing prompting method, device and equipment based on the knowledge graph and the computer readable storage medium, the keyword is extracted by analyzing the drawing request, and the extracted keyword is used as input of a preset recommendation model based on the knowledge graph so as to output personalized recommended drawing vocabulary. Therefore, by determining the drawing prompt word by using the recommendation model constructed based on the knowledge graph, the knowledge graph technology and the drawing application are combined, personalized, creative and intelligent drawing prompt can be provided for the user, so that the generated prompt word is ensured to be more in line with the drawing requirement of the user, and the user can easily acquire creative elicitations and guides related to the drawing request, thereby improving the quality and creativity of drawing.
Drawings
Fig. 1 schematically illustrates an application environment diagram of a knowledge-graph-based drawing hint method according to an embodiment of the present application;
fig. 2 schematically illustrates a flowchart of a knowledge-graph-based drawing hint method according to an embodiment of the present application;
FIG. 3 schematically illustrates a block diagram of a semantic analysis process;
FIG. 4 schematically illustrates a block diagram of a process for constructing a knowledge-graph;
FIG. 5 schematically illustrates a block diagram of a process for determining recommended words based on a knowledge-based recommendation model;
fig. 6 schematically shows a block diagram of a knowledge-graph-based drawing hint device according to a second embodiment of the present application; and
Fig. 7 schematically illustrates a hardware architecture diagram of a computer device adapted to implement a knowledge-graph-based drawing hint method according to a third embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
It should be noted that the descriptions of "first," "second," etc. in the embodiments of the present application are for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be regarded as not exist and not within the protection scope of the present application.
In related drawing technology based on artificial intelligence, a series of keywords describing drawing are input into a drawing tool by a user, the drawing tool automatically generates an image according to the keywords input by the user, and finally, drawing conforming to the user description is generated. Users need to understand how to compose accurate and clear keywords and translate their creatives and ideas into succinct, clear words in order for drawing tools to understand and generate the desired images correctly.
However, it is difficult for some common users to write comprehensive and high-quality keywords quickly and conveniently, so that drawing tools cannot understand the actual drawing intention of the users, and the generated images have a larger difference from the intention of the users, and the experience of the users is poor.
Currently common CF (Collaborative Filtering ) algorithms that recommend items of possible interest to users by analyzing their behavior and preferences to find similarities between users. However, the CF algorithm is not effective in handling recommendations related to drawing cues, and cannot recommend higher quality keywords to the user.
In view of this, the present application aims to provide a knowledge-graph-based drawing prompting method, which includes: receiving a drawing request input by a user; carrying out semantic analysis on the drawing request to obtain at least one keyword; determining target entities corresponding to each keyword through a preset recommendation model based on a knowledge graph, and determining a plurality of drawing prompt words according to the target entities corresponding to all the keywords; the plurality of drawing prompt words are displayed on the client. Therefore, by determining the drawing prompt word by using the recommendation model constructed based on the knowledge graph, the knowledge graph technology and the drawing application are combined, personalized, creative and intelligent drawing prompt can be provided for the user, so that the generated prompt word is ensured to be more in line with the drawing requirement of the user, and the user can easily acquire creative elicitations and guides related to the drawing request, thereby improving the quality and creativity of drawing.
Various embodiments are provided to further introduce knowledge-graph based drawing hinting schemes, in particular with reference to the following.
In the description of the present application, it should be understood that the numerical references before the steps do not identify the order of performing the steps, but are only used for convenience in describing the present application and distinguishing each step, and thus should not be construed as limiting the present application.
The following is a term explanation of the present application:
NLP: natural Language Processing natural language processing is an important branch in the fields of artificial intelligence and computer science to study how to enable computers to understand, process and generate human natural language. The goal of NLP is to enable natural language interactions between computers and humans. In NLP, a computer can perform a variety of functions by analyzing, understanding, and processing text, including: text classification, information extraction, machine translation, question-answering systems, text generation, and the like.
Knowledge graph: knowledgegraph is a huge Knowledge base constructed by utilizing the concept of semantic net, integrates rich structured data and semantic information, and is used for improving the searching effect and the intelligent degree of artificial intelligence application. The knowledge graph contains a large number of entities, attributes and relations, can provide more accurate and rich search results for users, is an unstructured data processing mode based on a semantic network, can integrate human knowledge and semantic information together in a graph form, and can support various intelligent application scenes, such as a question-answering system, a voice assistant and the like.
Recommendation system: recommendation System, an information filtering system based on data mining and machine learning techniques, is primarily aimed at predicting and providing items or information of possible interest to a user. The recommendation system builds a preference model of the user by analyzing the user's historical behavior and preferences, and uses the model to recommend items that meet the user's interests.
Fig. 1 schematically shows an environmental application schematic according to an embodiment of the present application. As shown in fig. 1:
the computer device 10000 can be connected to the client 30000 via a network 20000.
The computer device 10000 can provide services such as network debugging, or return drawing hint result data based on a knowledge graph to the client 30000, etc.
The computer device 10000 can be located in a data center such as a single venue or distributed in different geographic locations (e.g., in multiple venues). The computer device 10000 can provide services via one or more networks 20000. Network 20000 includes various network devices such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and/or the like. Network 20000 may include physical links such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and the like. Network 20000 may include wireless links such as cellular links, satellite links, wi-Fi links, and the like.
The computer device 10000 can be implemented by one or more computing nodes. One or more computing nodes may include virtualized computing instances. Virtualized computing instances may comprise emulation of virtual machines, e.g., computer systems, operating systems, servers, etc. The computing node may load the virtual machine by the computing node based on the virtual image and/or other data defining the particular software (e.g., operating system, dedicated application, server) used for the emulation. As the demand for different types of processing services changes, different virtual machines may be loaded and/or terminated on one or more computing nodes. A hypervisor may be implemented to manage the use of different virtual machines on the same computing node.
The client 30000 may be configured to access the content and services of the computer device 10000. Client 30000 can include any type of electronic device, such as a mobile device, tablet device, laptop computer, workstation, virtual reality device, gaming device, set top box, digital streaming media device, vehicle terminal, smart television, set top box, and the like.
The client 30000 may output (e.g., display, render, present) knowledge-graph based drawing hint result data, etc., to a user.
The network debugging scheme will be described below by way of various embodiments. The scheme may be implemented by the computer device 10000.
Example 1
Fig. 2 schematically shows a flowchart of a knowledge-graph-based drawing hint method according to an embodiment of the present application. Comprising steps S202-S208, wherein,
step S202, receiving a drawing request input by a user;
specifically, by running a client on a terminal device and displaying a graphical user interface on the client, the content displayed on the graphical user interface may include a drawing request input box, and the user may input a drawing request in the drawing request input box. The terminal equipment running the client can be provided with a user input data acquisition module, and drawing requests input by a user can be acquired through the user input data acquisition module. For example, the drawing request input by the user may be "draw a scenery map of a summer beach".
Step S204, carrying out semantic analysis on the drawing request to obtain at least one keyword;
in this embodiment, for a drawing request input by a user, at least one keyword may be extracted by performing semantic analysis on the drawing request to extract the at least one keyword, and the semantic analysis process may be processed using a semantic analyzer. As an example, a block diagram of a semantic analysis process is shown in fig. 3, in which contents input by a user are input as inputs to a semantic analyzer, keywords are extracted by analysis using the semantic analyzer, and further keywords 1, 2, …, n are output.
In a specific implementation, the semantic analyzer can be constructed based on NLP natural language processing technology, and mainly comprises the following tasks: text preprocessing, word segmentation, part-of-speech tagging, entity recognition and keyword extraction. Text preprocessing is mainly to convert drawing requests input by a user into a form which can be processed by a computer; word segmentation is the process of dividing continuous text data into meaningful vocabulary units; part-of-speech tagging is the task of determining the grammatical roles of each word in a sentence; entity identification may help the system identify specific entities that may be included in the drawing request.
Step S206, determining a target entity corresponding to each keyword through a preset recommendation model based on a knowledge graph, and determining a plurality of drawing prompt words according to the target entities corresponding to all the keywords;
the preset recommendation model based on the knowledge graph can be a pre-trained recommendation model, the recommendation model is constructed based on the knowledge graph and used for predicting according to the input keywords, and then a plurality of recommended drawing prompt words are output to provide relevant creative elicitations and guidance for drawing requests input by users.
In a specific implementation, mapping relations between keywords related to drawing and entities can be recorded in a knowledge graph, after at least one extracted keyword is input into a preset recommendation model based on the knowledge graph, a target entity corresponding to each keyword is first determined through the knowledge graph, and then a plurality of drawing prompt words are determined according to the target entity corresponding to each keyword. For example, if 8 drawing prompt words need to be output, recommending is performed according to the target entity, the prediction probability corresponding to each recommended word is determined, and 8 recommended words with the highest prediction probability are selected as the drawing prompt words according to the prediction probability.
Step S208, the plurality of drawing prompt words are displayed on the client.
In this embodiment, the displaying of the recommended plurality of drawing hint words on the client may be controlled so as to provide personalized, creative and intelligent drawing hints for the user, and the user may directly select one or a plurality of drawing hint words to generate the corresponding AI image according to the drawing hint words.
Several alternative embodiments are provided below to optimize the knowledge-graph-based drawing hint method, specifically as follows:
In a preferred embodiment of the present application, the method may further comprise the steps of:
determining a target drawing prompt word from the plurality of drawing prompt words in response to a selection operation acting on the plurality of drawing prompt words; drawing according to the target drawing prompt word to generate an AI image.
In this embodiment, the user may directly perform a selection operation on a plurality of drawing hint words displayed on the client, so as to select one or more drawing hint words as target drawing hint words. After receiving a selection operation acted by a user on the plurality of drawing prompt words, the client determines a target drawing prompt word from the plurality of drawing prompt words by responding to the selection operation, and then draws according to the target drawing prompt word by using a preset AI drawing tool to generate an AI image.
In a preferred embodiment of the present application, the method further comprises:
displaying a user feedback page on the client, wherein the user feedback page comprises a prompt effect evaluation component; determining user evaluation data in response to a setting operation acting on the prompt effect evaluation component; and updating the preset recommendation model based on the knowledge graph according to the user evaluation data.
In this embodiment, after the drawing prompt word is recommended to the user, a user feedback page may be displayed on the client, where the user feedback page includes a prompt effect evaluation component for collecting the evaluation of the user on the drawing prompt function. After receiving a setting operation performed by a user on the prompt effect evaluation component, the client determines user evaluation data by responding to the setting operation, and then updates a preset recommendation model based on the knowledge graph according to the user evaluation data. Through the user feedback page, the user can evaluate whether the prompt generated by the preset knowledge-based recommendation model is helpful or not, and the feedback can be used for continuously optimizing the accuracy and the recommendation effect of the preset knowledge-based recommendation model.
In a preferred embodiment of the present application, the step S204 may include the steps of:
performing word segmentation processing on the drawing request to obtain a word segmentation sequence; performing part-of-speech analysis on each word in the word segmentation sequence to determine the part-of-speech corresponding to each word; performing entity recognition on each word in the word segmentation sequence to determine an entity corresponding to each word; and extracting keywords according to the parts of speech and the entities corresponding to each vocabulary so as to obtain at least one keyword.
Specifically, the user typically inputs a drawing request in a natural language form, and the drawing request input by the user may be semantically analyzed using a natural language processing technique to extract keywords. Semantic analysis uses natural language processing techniques that involve several tasks: text processing, word segmentation, part-of-speech tagging, entity recognition and keyword extraction:
(1) Text processing: the user typically enters a drawing request in natural language form, such as "draw a landscape of a beach in summer". In semantic analysis, the drawing request is first converted into a computer-processable form by a text processing process that typically includes text preprocessing such as text washing, noise data removal, and special characters.
(2) Word segmentation: word segmentation is the process of segmenting continuous text data into meaningful lexical units. At this stage, sentences input by the user may be divided into words, for example, "scenery of beach in summer" is divided into words of "summer", "beach", "scenery", and the like.
(3) Part of speech tagging: part-of-speech tagging is the task of determining and tagging the grammatical role of each word in a sentence through part-of-speech analysis. For example, by part-of-speech analysis, it can be recognized that "landscape" is a noun and "summer" is an adjective. This is important for understanding the structure and meaning of sentences.
(4) Entity identification: the user drawing request may include physical information such as a specific location, time, and object. These specific entities may be identified by entity identification techniques, such as "eiffel tower in paris". This helps to extract knowledge about the entity.
(5) Keyword extraction: after word segmentation, part-of-speech tagging and entity recognition, the system can recognize keywords in a drawing request input by a user. For example, for "scenery drawing a beach in summer", the extracted keywords may include "summer", "beach", "scenery", and the like.
In a preferred embodiment of the present application, the method may further comprise the steps of:
acquiring a data source related to a drawing prompt; determining standardized data related to the drawing prompt from the data source related to the drawing prompt; carrying out structuring treatment on the standardized data to obtain structured data; and constructing a drawing knowledge graph according to the structured data, wherein the drawing knowledge graph is used for describing the mapping relation between the keywords related to drawing and the entities.
In this embodiment, by selecting a data source related to the drawing hint, this may include an open dataset, a knowledge graph (e.g., DBpedia), a text corpus, domain expert knowledge, and so on. And then, extracting standardized data related to drawing prompts from the data sources, carrying out structuring treatment on the standardized data to obtain structured data, and finally, constructing a drawing knowledge graph according to the structured data, wherein the drawing knowledge graph can be used for recording the mapping relation between keywords related to drawing and entities.
In a preferred embodiment of the present application, the determining standardized data related to the drawing hint from the data sources related to the drawing hint includes:
performing data cleaning on the data sources related to the drawing prompts; and extracting standardized data related to the drawing prompt from the cleaned data source related to the drawing prompt.
In this embodiment, the data source quality may be improved by performing data cleaning on the data source related to the drawing hint to find and correct possible errors in the data source related to the drawing hint. After data cleaning, standardized data related to the drawing prompts are extracted from the cleaned data sources related to the drawing prompts.
As an example, fig. 4 shows a block diagram of a process for constructing a mapping knowledge-graph, and fig. 4 mainly includes the following steps:
data source selection: the data sources associated with the drawing cues are obtained through data source selection. In one example, these data sources may include an open dataset, a knowledge graph (e.g., DBpedia), a text corpus, domain expert knowledge, etc., which is not particularly limited by the present embodiment.
Data extraction and cleaning: normalized data associated with the drawing hint is extracted from the acquired data source. This may include information on entity names, attribute descriptions, relationships between entities, etc., and data cleansing and preprocessing may be performed on the data sources in order to ensure the quality of the data.
Knowledge representation: the extracted standardized data is structured to obtain structured data by a knowledge representation process that may include defining structures of entities, attributes, and relationships and creating a standardized data model.
And (3) constructing a map: structured data of the knowledge representation is used to construct a mapping knowledge-graph. The entity is expressed as a node in the drawing knowledge graph, the attribute and the relationship are expressed as edges, and the association between the entities is established to construct the mapping relationship between the keywords related to the drawing and the entities.
In a preferred embodiment of the present application, the step S206 may include the steps of:
determining recommended words corresponding to target entities corresponding to all keywords; each recommended word has one-to-one prediction probability; and sequencing all recommended words according to the prediction probability to obtain a sequencing result, and determining a plurality of drawing prompt words according to the sequencing result.
In the embodiment, when determining recommended drawing prompt words, determining recommended words corresponding to target entities corresponding to all keywords by using a recommendation model based on a knowledge graph; and then, sorting all the recommended words according to the prediction probabilities to obtain a sorting result, and determining a plurality of drawing prompt words according to the sorting result. For example, assuming that 8 drawing hint words need to be output, 8 recommended words with highest prediction probability are selected as the drawing hint words according to the ranking result.
In this embodiment, a recommendation model based on a knowledge graph can be trained by constructing a drawing knowledge graph to provide personalized drawing prompts for users. The input of the recommendation model based on the knowledge graph is a plurality of keywords extracted from drawing requests input by users, the output of the model is K recommended drawing prompt words, the drawing prompt words are related entities mapped on the drawing knowledge graph through the model based on the extracted keywords, and recommended words are determined according to the entities, so that the recommended drawing prompt words are more representative, and the recommended drawing prompt words represent drawing subjects and elements which are possibly favored by the users.
In order to further describe the knowledge-graph-based drawing prompting method of the present embodiment, a workflow block diagram of a knowledge-graph-based recommendation model is shown in fig. 5, and may be summarized as follows:
1. inputting keywords: a set of keywords extracted from a drawing request entered by a user, the keywords describing the user's current drawing intent, such as "summer beach" or "abstract color blocks.
2. Drawing recommendation model based on knowledge graph: these keywords are matched to related entities in the drawing knowledge-graph by a knowledge-graph based recommendation model. For example, it is possible to map "summer beach" to entities such as "beach landscape", "beach sunlight" and "wave shape".
3. Recommendation generation: based on the entities in the matched knowledge graph, generating K drawing prompt words related to the user request by using a recommendation algorithm. These drawing hint words may cover a number of concepts, attributes, styles, etc. that may motivate the user to create a map of the user's input to the drawing hint words.
The generated drawing prompt words are presented to the user through a recommendation model based on the knowledge graph, and the user can select words suitable for requirements. This selection is personalized in that the drawing hint words are generated based on the user's initial keywords and the drawing knowledge-graph map, and the user can draw from the generated drawing hint words. Through this process, the user can more easily acquire creative elicitations and guides related to his painting request, thereby improving the quality and creativity of painting. Moreover, the recommendation model is constructed based on the knowledge graph, so that the generated prompt vocabulary can be ensured to be more in line with the drawing requirements of the user.
Example two
Fig. 6 schematically illustrates a block diagram of a knowledge-graph-based drawing hint device according to a second embodiment of the present application, which may be divided into one or more program modules, which are stored in a storage medium and executed by one or more processors to complete the embodiments of the present application. Program modules in the embodiments of the present application refer to a series of computer program instruction segments capable of implementing specific functions, and the following description specifically describes the functions of each program module in the embodiments of the present application.
As shown in fig. 6, the knowledge-graph-based drawing prompt device 600 may include the following modules:
a drawing request receiving module 610, configured to receive a drawing request input by a user;
a semantic analysis module 620, configured to perform semantic analysis on the drawing request to obtain at least one keyword;
the drawing prompt word determining module 630 is configured to determine, through a preset knowledge-based recommendation model, a target entity corresponding to each keyword, and determine a plurality of drawing prompt words according to the target entities corresponding to all keywords;
the drawing prompt word display module 640 is configured to display the plurality of drawing prompt words on the client.
In a preferred embodiment of the present application, the apparatus further comprises:
determining a target drawing prompt word from the plurality of drawing prompt words in response to a selection operation acting on the plurality of drawing prompt words;
drawing according to the target drawing prompt word to generate an AI image.
In a preferred embodiment of the present application, the apparatus further comprises:
the user feedback page module is used for displaying a user feedback page on the client, wherein the user feedback page comprises a prompt effect evaluation component;
the user evaluation data determining module is used for responding to the setting operation acted on the prompt effect evaluation component and determining user evaluation data;
and the recommendation model updating module is used for updating the preset recommendation model based on the knowledge graph according to the user evaluation data.
In a preferred embodiment of the present application, the semantic analysis module 620 includes:
the word segmentation processing sub-module is used for carrying out word segmentation processing on the drawing request to obtain a word segmentation sequence;
the part-of-speech analysis sub-module is used for carrying out part-of-speech analysis on each vocabulary in the word segmentation sequence so as to determine the part-of-speech corresponding to each vocabulary;
The entity recognition sub-module is used for carrying out entity recognition on each vocabulary in the word segmentation sequence so as to determine an entity corresponding to each vocabulary;
and the keyword extraction sub-module is used for extracting keywords according to the part of speech and the entity corresponding to each vocabulary so as to obtain at least one keyword.
In a preferred embodiment of the present application, the apparatus further comprises:
the data source acquisition module is used for acquiring a data source related to the drawing prompt;
the data extraction module is used for determining standardized data related to the drawing prompt from the data sources related to the drawing prompt;
the data conversion module is used for carrying out structuring treatment on the standardized data to obtain structured data;
and the knowledge graph construction module is used for constructing a drawing knowledge graph according to the structured data, wherein the drawing knowledge graph is used for describing the mapping relation between the keywords related to drawing and the entities.
In a preferred embodiment of the present application, the data extraction module includes:
the data cleaning sub-module is used for cleaning the data of the data sources related to the drawing prompts;
and the data extraction sub-module is used for extracting standardized data related to the drawing prompt from the cleaned data source related to the drawing prompt.
In a preferred embodiment of the present application, the drawing hint word determining module 630 includes:
the recommended word determining submodule is used for determining recommended words corresponding to target entities corresponding to all keywords; each recommended word has one-to-one prediction probability;
and the drawing prompt word determining sub-module is used for sequencing all recommended words according to the prediction probability to obtain a sequencing result, and determining a plurality of drawing prompt words according to the sequencing result.
Example III
Fig. 7 schematically illustrates a hardware architecture diagram of a computer device 10000 adapted to implement a knowledge-graph-based drawing hint method according to a third embodiment of the present application. In this embodiment, the computer device 10000 is a device capable of automatically performing numerical calculation and/or information processing in accordance with an instruction set or stored in advance. For example, the server may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack-mounted server, a blade server, a tower server, or a cabinet server (including a FEN independent server or a server cluster formed by a plurality of servers), etc. As shown in fig. 7, computer device 10000 includes at least, but is not limited to: the memory 10010, processor 10020, network interface 10030 may be communicatively linked to each other via a system bus. Wherein:
Memory 10010 includes at least one type of computer-readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, memory 10010 may be an internal storage module of computer device 10000, such as a hard disk or memory of computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like. Of course, the memory 10010 may also include both an internal memory module of the computer device 10000 and an external memory device thereof. In this embodiment, the memory 10010 is generally used for storing an operating system installed in the computer device 10000 and various application software, such as program codes of a drawing prompt method based on a knowledge graph. In addition, the memory 10010 may be used to temporarily store various types of data that have been output or are to be output.
The processor 10020 may be a central processing unit (Central Processing Unit, simply CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 10020 is typically configured to control overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is configured to execute program codes or process data stored in the memory 10010.
The network interface 10030 may comprise a wireless network interface or a wired network interface, which network interface 10030 is typically used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, establish a data transmission channel and a communication link between the computer device 10000 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, abbreviated as GSM), wideband code division multiple access (Wideband Code Division Multiple Access, abbreviated as WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, etc.
It should be noted that fig. 7 only shows a computer device having components 10010-10030, but it should be understood that not all of the illustrated components are required to be implemented, and more or fewer components may be implemented instead.
In this embodiment, the knowledge-graph-based drawing hint method stored in the memory 10010 may also be divided into one or more program modules and executed by one or more processors (the processor 10020 in this embodiment) to complete the embodiments of the present application.
Example IV
The present application further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the knowledge-graph-based drawing prompting method in the embodiments.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), etc. that are provided on the computer device. Of course, the computer-readable storage medium may also include both internal storage units of a computer device and external storage devices. In this embodiment, the computer readable storage medium is typically used to store an operating system and various application software installed on a computer device, for example, program codes of a drawing prompt method based on a knowledge graph in the embodiment, and the like. Furthermore, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (10)

1. The drawing prompting method based on the knowledge graph is characterized by comprising the following steps of:
Receiving a drawing request input by a user;
carrying out semantic analysis on the drawing request to obtain at least one keyword;
determining target entities corresponding to each keyword through a preset recommendation model based on a knowledge graph, and determining a plurality of drawing prompt words according to the target entities corresponding to all the keywords;
the plurality of drawing prompt words are displayed on the client.
2. The knowledge-graph-based drawing hint method according to claim 1, further comprising:
determining a target drawing prompt word from the plurality of drawing prompt words in response to a selection operation acting on the plurality of drawing prompt words;
drawing according to the target drawing prompt word to generate an AI image.
3. The knowledge-graph-based drawing hint method according to claim 1, further comprising:
displaying a user feedback page on the client, wherein the user feedback page comprises a prompt effect evaluation component;
determining user evaluation data in response to a setting operation acting on the prompt effect evaluation component;
and updating the preset recommendation model based on the knowledge graph according to the user evaluation data.
4. The knowledge-graph-based drawing hint method according to claim 1, wherein said semantically analyzing the drawing request to obtain at least one keyword includes:
performing word segmentation processing on the drawing request to obtain a word segmentation sequence;
performing part-of-speech analysis on each word in the word segmentation sequence to determine the part-of-speech corresponding to each word;
performing entity recognition on each word in the word segmentation sequence to determine an entity corresponding to each word;
and extracting keywords according to the parts of speech and the entities corresponding to each vocabulary so as to obtain at least one keyword.
5. The knowledge-graph-based drawing hint method according to claim 1, further comprising:
acquiring a data source related to a drawing prompt;
determining standardized data related to the drawing prompt from the data source related to the drawing prompt;
carrying out structuring treatment on the standardized data to obtain structured data;
and constructing a drawing knowledge graph according to the structured data, wherein the drawing knowledge graph is used for describing the mapping relation between the keywords related to drawing and the entities.
6. The knowledge-graph-based drawing hint method according to claim 5, wherein said determining standardized data related to drawing hints from said data sources related to drawing hints comprises:
performing data cleaning on the data sources related to the drawing prompts;
and extracting standardized data related to the drawing prompt from the cleaned data source related to the drawing prompt.
7. The knowledge-graph-based drawing prompt method according to claim 1, wherein the determining a plurality of drawing prompt words according to target entities corresponding to all keywords comprises:
determining recommended words corresponding to target entities corresponding to all keywords; each recommended word has one-to-one prediction probability;
and sequencing all recommended words according to the prediction probability to obtain a sequencing result, and determining a plurality of drawing prompt words according to the sequencing result.
8. Drawing prompt device based on knowledge graph, characterized by comprising:
the drawing request receiving module is used for receiving a drawing request input by a user;
the semantic analysis module is used for carrying out semantic analysis on the drawing request to obtain at least one keyword;
The drawing prompt word determining module is used for determining a target entity corresponding to each keyword through a preset recommendation model based on a knowledge graph, and determining a plurality of drawing prompt words according to the target entities corresponding to all the keywords;
and the drawing prompt word display module is used for displaying the drawing prompt words on the client.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor is adapted to implement the steps of the knowledge-graph based drawing hinting method according to any one of claims 1 to 7 when the computer program is executed by the processor.
10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and the computer program is executable by at least one processor, so that the at least one processor performs the steps of the knowledge-graph based drawing prompting method according to any one of claims 1 to 7.
CN202311854173.5A 2023-12-28 2023-12-28 Drawing prompting method and device based on knowledge graph Pending CN117787290A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311854173.5A CN117787290A (en) 2023-12-28 2023-12-28 Drawing prompting method and device based on knowledge graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311854173.5A CN117787290A (en) 2023-12-28 2023-12-28 Drawing prompting method and device based on knowledge graph

Publications (1)

Publication Number Publication Date
CN117787290A true CN117787290A (en) 2024-03-29

Family

ID=90388980

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311854173.5A Pending CN117787290A (en) 2023-12-28 2023-12-28 Drawing prompting method and device based on knowledge graph

Country Status (1)

Country Link
CN (1) CN117787290A (en)

Similar Documents

Publication Publication Date Title
CN112632385B (en) Course recommendation method, course recommendation device, computer equipment and medium
CN107679039B (en) Method and device for determining statement intention
CN106919655B (en) Answer providing method and device
US10831796B2 (en) Tone optimization for digital content
US9471874B2 (en) Mining forums for solutions to questions and scoring candidate answers
US9652528B2 (en) Prompting subject matter experts for additional detail based on historical answer ratings
US20160293034A1 (en) Question answering system-based generation of distractors using machine learning
CN109697239B (en) Method for generating teletext information
CN112579727B (en) Document content extraction method and device, electronic equipment and storage medium
CN112528001B (en) Information query method and device and electronic equipment
CN111310440A (en) Text error correction method, device and system
CN111597788A (en) Attribute fusion method, device and equipment based on entity alignment and storage medium
CN116737908A (en) Knowledge question-answering method, device, equipment and storage medium
CN111382563B (en) Text relevance determining method and device
CN110795544B (en) Content searching method, device, equipment and storage medium
CN112231554A (en) Search recommendation word generation method and device, storage medium and computer equipment
CN114141384A (en) Method, apparatus and medium for retrieving medical data
CN112102116B (en) Input prediction method, system, equipment and storage medium based on travel session
CN113569018A (en) Question and answer pair mining method and device
CN110807097A (en) Method and device for analyzing data
CN111931034A (en) Data searching method, device, equipment and storage medium
CN111488510A (en) Method and device for determining related words of small program, processing equipment and search system
CN117787290A (en) Drawing prompting method and device based on knowledge graph
CN109857838B (en) Method and apparatus for generating information
CN114021541A (en) Presentation generation method, device, equipment and storage medium

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