WO2020103899A1 - 用于生成图文信息的方法和用于生成图像数据库的方法 - Google Patents

用于生成图文信息的方法和用于生成图像数据库的方法

Info

Publication number
WO2020103899A1
WO2020103899A1 PCT/CN2019/119914 CN2019119914W WO2020103899A1 WO 2020103899 A1 WO2020103899 A1 WO 2020103899A1 CN 2019119914 W CN2019119914 W CN 2019119914W WO 2020103899 A1 WO2020103899 A1 WO 2020103899A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
information
images
database
keywords
Prior art date
Application number
PCT/CN2019/119914
Other languages
English (en)
French (fr)
Inventor
齐镗泉
Original Assignee
连尚(新昌)网络科技有限公司
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 连尚(新昌)网络科技有限公司 filed Critical 连尚(新昌)网络科技有限公司
Publication of WO2020103899A1 publication Critical patent/WO2020103899A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • G06F16/538Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually

Definitions

  • This application relates to the field of computer technology, and in particular to a method for generating graphic information and a method for generating an image database.
  • the embodiments of the present application provide a method for generating graphic information and a method for generating an image database.
  • some embodiments of the present application provide a method for generating graphic information.
  • the method includes: acquiring title keywords and content topics from information to be matched with images; selecting and keyword keywords from an image database Images matching the content theme, where the image database is generated based on the image description; the selected image is inserted into the information to be configured to generate target graphic information.
  • some embodiments of the present application provide a method for generating graphic information.
  • the method includes: acquiring title keywords and content topics from information to be allocated to images; Select a category of images; select an image database that matches the category from at least one image database; select an image that matches the title keywords and content topics from the selected image database, where at least one image database is generated based on the image description; The selected image is inserted into the information to be matched, and the target graphic information is generated.
  • some embodiments of the present application provide a method for generating an image database.
  • the method includes: acquiring an image collection, and the images in the image collection are the matching images in the graphic information; , Obtain the description information of the image, extract at least one keyword from the description information of the image as the image keyword of the image; generate an image database based on the image collection and the extracted image keywords.
  • some embodiments of the present application provide an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, when one or more programs are The processor executes so that one or more processors implement the method as described in the first aspect to the third aspect.
  • some embodiments of the present application provide a computer-readable medium on which a computer program is stored, which when executed by a processor implements the methods described in the first to third aspects.
  • the method for generating graphic information and the method for generating an image database provided by the embodiments of the present application, by acquiring title keywords and content themes from the information to be matched with images, and then selecting from Images with matching title keywords and content themes, and finally insert the selected images into the information to be configured to generate target graphic information, thereby helping to reduce the cost of matching images.
  • FIG. 1 is an exemplary system architecture diagram to which some embodiments of the present application can be applied;
  • FIG. 2 is a flowchart of an embodiment of a method for generating an image database according to the present application
  • FIG. 3 is a schematic diagram of an application scenario of the method for generating an image database according to the present application.
  • FIG. 4 is a flowchart of an embodiment of a method for generating graphic information according to the present application.
  • FIG. 5 is a flowchart of an embodiment of a method for generating graphic information according to the present application.
  • FIG. 6 is a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application
  • FIG. 7 is a schematic structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application.
  • the system architecture 100 may include servers 101 and 103 and a network 102.
  • the network 102 is used as a medium for providing a communication link between the servers 101 and 103.
  • the network 102 may include various connection types, such as wired, wireless communication links, or optical cables, and so on.
  • the server 101 may be a server for generating an image database.
  • the server 101 may acquire an image collection (for example, from the server 103), and then obtain descriptive information of each image and extract image keywords therefrom to generate an image database corresponding to the image-related words.
  • the server 101 may also be a server that maps information information.
  • the server 101 can obtain title keywords and content topics from the information information, and select matching images from the image database generated based on the image description to insert the information information to generate the illustrated information.
  • the server 102 may be a server that stores image or graphic information.
  • the method for generating an image database or the method for generating graphic information provided by the embodiments of the present application is generally executed by the server 101.
  • the servers 101 and 103 may be hardware or software.
  • the servers 101 and 103 can be implemented as a distributed server cluster composed of multiple servers or as a single server.
  • the server is software, it can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module. There is no specific limit here.
  • the server 101 can also directly store the image collection locally, and the server 101 can directly obtain the local image collection.
  • the exemplary system architecture 100 may not include the server 103.
  • FIG. 1 the number of networks and servers in FIG. 1 are only schematic. Depending on the implementation needs, there can be any suitable number of networks and servers.
  • the method for generating an image database may include the following steps 201-203.
  • Step 201 Acquire an image collection.
  • the execution subject of the method for generating an image database may acquire the image collection locally or remotely.
  • the images in the image set may be the matching images in the graphic information.
  • Graphic information can include text content and pictures.
  • the graphic information may be news information such as news and blog posts.
  • the image in the image collection may be the above-mentioned execution subject or a server different from the above-mentioned execution subject is acquired from a server storing images or graphic information.
  • a web crawler crawls a map from a web page in a web server.
  • Step 202 For each image in the image collection, obtain the description information of the image, and extract at least one keyword from the description information of the image as the image keyword of the image.
  • the execution subject of the method for generating an image database may first obtain the description information of the image, and then extract from the obtained description information At least one keyword is used as the image keyword of the image.
  • the description information of the image may be a textual description of the features (for example, scenes in the image, salient objects, etc.) contained in the image.
  • the word segmentation technique can be used to extract keywords from the description information.
  • the description information of the image may be obtained by performing image recognition on the image (for example, through an image recognition model), and then generating the description information of the image according to the image recognition result.
  • image recognition it can be determined that the scene of the image is the living room and the salient object in the image is a chair, then the description information of the image may be "there is a chair in the living room".
  • image description technology may be used to obtain image description information.
  • an image can be input into a trained image description model to obtain description information corresponding to the input image.
  • the image description model can be used to characterize the correspondence between the input image and the description information.
  • the encoder framework of LSTM (Long Short-Term Memory, Long Short-Term Memory Network) unit can be used as the image description model.
  • the above image description model can be obtained by training as follows:
  • the image description database stores images and description information corresponding to the images.
  • each image in the above-mentioned multiple images is used as input, and the description information corresponding to the input image is used as output, and the initial image description model is trained using a machine learning method to obtain an image description model.
  • the above image description database can be generated by the following steps:
  • the image distribution in the graphic information is obtained and the description information corresponding to the image distribution is extracted from the text content of the graphic information.
  • map and its corresponding description information are stored correspondingly to establish an image description database.
  • the description information of each image may be a sentence described in natural language.
  • the at least one keyword may include nouns and / or adjectives contained in sentences described in natural language.
  • extracting at least one keyword from the description information of the image as the image keyword of the image may include the following two steps:
  • the sentence described in the natural language is segmented to obtain the nouns and / or adjectives contained in the sentence described in the natural language.
  • the above nouns and / or adjectives are extracted as image keywords of the image.
  • the description information of an image is "there is a chair in the living room”, and the sentence segmentation is processed to obtain the nouns "living room” and "chair” contained in it.
  • the keyword is extracted as the image keyword of the image.
  • step 203 an image database is generated based on the image collection and the extracted image keywords.
  • the execution subject of the method for generating an image database may use the image collection and the image keywords extracted in step 202 to establish an image database.
  • each image in the above image collection and its image keywords may be stored correspondingly to establish an image database.
  • FIG. 3 shows an application scenario 300 of the method for generating an image database according to the present application.
  • the server 302 obtains an image collection locally, where the image 301 is an image in the image collection.
  • the image 301 is input into the trained image description model, and the description information "a yellow flower stands in the wilderness” is obtained.
  • Perform word segmentation processing on the above description information to obtain the nouns "flower”, “wilderness” and the adjective “yellow”, and the image keywords of the image 301 (ie, "flower”, “wildness”, “yellow”).
  • the image 301 and the image keywords "flower”, “wilderness”, “yellow” are stored in the database as one data record.
  • other images in the image collection are processed and stored in the same way, and the image database is finally obtained.
  • the method for generating an image database collects the imagery in the graphic information, then obtains the description information of each imagery, and extracts image keywords from the description information, and finally based on the collected imagery And the extracted image keywords generate an image database, thereby helping to reduce the cost of image matching.
  • the method for generating an image database may include the following steps 401-405.
  • Step 401 Acquire an image collection.
  • the execution subject of the method for generating an image database may acquire the image collection locally or remotely.
  • the images in the image set may be the matching images in the graphic information.
  • Graphic information can include text content and pictures.
  • the graphic information may be news information such as news and blog posts.
  • Step 402 For each image in the image set, obtain the description information of the image, and extract at least one keyword from the description information of the image as the image keyword of the image.
  • the execution subject of the method for generating an image database may first obtain the description information of the image, and then extract from the obtained description information At least one keyword is used as the image keyword of the image.
  • the description information of the image may be a textual description of the features (for example, scenes in the image, salient objects, etc.) contained in the image.
  • the word segmentation technique can be used to extract keywords from the description information.
  • Step 403 Determine the similarity between the image keywords of different images in the image set.
  • the execution subject of the method for generating an image database may determine the similarity between image keywords of different images in the image collection.
  • the similarity between the image keyword of image A and the image keyword of image B may be calculated.
  • Step 404 Based on the similarity between the image keywords of different images, classify the images in the image set to obtain at least one sub-image set.
  • the execution subject of the method for generating an image database can use the similarity between image keywords of different images to classify each image in the above image collection (for example , Classification by clustering) to obtain at least one sub-image set (each sub-image set represents an image of a category).
  • Step 405 Generate at least one image database corresponding to at least one sub-image set respectively.
  • the execution subject of the method for generating an image database may select each image in the sub-image set and The image keywords are stored correspondingly to obtain an image database corresponding to the sub-image set.
  • the image set includes 1 million images
  • the similarity between the image keywords can be used to divide the image set into 1000 sub-image sets (assuming each sub-image set includes 1000 images), and then establish a 1000 image database. If only one image database is to be established, it takes at most 1 million matches to obtain an image.
  • an image needs to be matched up to 2000 times (the matching image database needs to be matched up to 1,000 times, and the matching database needs to be matched up to 1,000 times), thereby effectively improving the efficiency of retrieving images.
  • the process 400 of the method for generating an image database in this embodiment embodies the use of similarity between image keywords to classify images and The steps of creating different image databases for different types of images. Therefore, the solution described in this embodiment can effectively improve the efficiency of retrieving images.
  • FIG. 5 shows a flow 500 of an embodiment of a method for generating graphic information according to the present application.
  • the method for generating graphic information may include the following steps 501-503.
  • Step 501 Acquire title keywords and content topics from the information to be matched.
  • the execution subject of the method for generating graphic information may acquire the title keyword and content theme from the image information to be configured.
  • the to-be-mapped information may be information information (for example, news containing only text content) that needs to be configured.
  • step 501 may specifically include the following steps:
  • the keyword segmentation technology is used to extract keywords from the title as title keywords.
  • the text content is input into the trained text theme model to obtain the content theme of the information to be matched.
  • the content theme may include theme keywords.
  • the text topic model can characterize the correspondence between text content and content topics.
  • the text topic model is a modeling method for the hidden topics in the text. It is generally believed that each word of an article is through "select a certain topic with a certain probability, and select a certain word from this topic with a certain probability”.
  • Text topic model training methods can include LSA (Latent semantic analysis), pLSA (Probabilistic latent semantic analysis), LDA (Latent Dirichlet allocation, implicit Dirichlet allocation), etc. The training of text topic models is a well-known technology that has been widely researched and applied at present, and will not be repeated here.
  • Step 502 Select an image matching the title keyword and content theme from the image database.
  • the execution subject of the method for generating graphic information may select an image in the image database that matches the title keyword and content theme acquired in step 502. Among them, the image database is generated based on the image description.
  • step 502 may specifically include the following steps: First, determine the similarity between the image keywords of the image included in the image database and the above-mentioned title keywords and the above-mentioned content topics; then, select Images with a similarity greater than or equal to a preset threshold.
  • a similarity threshold for example, 90%
  • the image database may be specifically generated through the following three steps:
  • the first step is to obtain an image collection.
  • the images in the image set are the matching images in the graphic information.
  • the description information of the image is obtained, and at least one keyword is extracted from the description information of the image as the image keyword of the image.
  • an image database is generated based on the image collection and the extracted image keywords.
  • the description information of the image can be obtained through image description technology (Image Caption Technology).
  • image can be input into the trained image description model to obtain the description information corresponding to the input image.
  • the image description model can be used to characterize the correspondence between the input image and the description information.
  • the encoder framework of LSTM (Long Short-Term Memory, Long Short-Term Memory Network) unit can be used as the image description model.
  • the above image description model can be obtained by training as follows:
  • the image description database stores images and description information corresponding to the images.
  • each image in the above-mentioned multiple images is used as input, and the description information corresponding to the input image is used as output, and the initial image description model is trained using a machine learning method to obtain an image description model.
  • the above image description database can be generated by the following steps:
  • the image distribution in the graphic information is obtained and the description information corresponding to the image distribution is extracted from the text content of the graphic information.
  • map and its corresponding description information are stored correspondingly to establish an image description database.
  • the description information of each image may be a sentence described in natural language.
  • the at least one keyword may include nouns and / or adjectives contained in sentences described in natural language.
  • extracting at least one keyword from the description information of the image as the image keyword of the image may include the following two steps:
  • the sentence described in the natural language is segmented to obtain the nouns and / or adjectives contained in the sentence described in the natural language.
  • the above nouns and / or adjectives are extracted as image keywords of the image.
  • the description information of an image is "there is a chair in the living room”, and the sentence segmentation is processed to obtain the nouns "living room” and "chair” contained in it.
  • the keyword is extracted as the image keyword of the image.
  • step 503 the selected image is inserted into the information to be matched to generate target graphic information.
  • the executive body of the method for generating graphic information may insert the selected image according to a preset insertion rule (for example, after inserting the paragraph where the image keyword is located, etc.) To the information to be matched, generate the information with both pictures and texts.
  • a preset insertion rule for example, after inserting the paragraph where the image keyword is located, etc.
  • the method for generating graphic information provided by the embodiment of the present application, by acquiring the title keywords and content topics of the image information to be matched, then selecting matching images from the image database generated based on the image description, and finally inserting the selected images
  • the target graphic information is generated from the information to be matched, which helps to reduce the cost of matching.
  • FIG. 6 shows a flow 600 of another embodiment of a method for generating graphic information according to the present application.
  • the method for generating graphic information may include the following steps 601-605.
  • Step 601 Obtain title keywords and content topics from the information to be matched.
  • the execution subject of the method for generating graphic information may acquire the title keyword and content theme from the image information to be configured.
  • the to-be-mapped information may be information information (for example, news containing only text content) that needs to be configured.
  • Step 602 Determine the category of the image to be selected based on the title keyword and the content theme.
  • the execution subject of the method for generating graphic information may determine the category of the image to be selected based on the title keyword and the content theme.
  • the title keywords and content topics acquired in step 601 may be fused to determine the category of the image to be selected.
  • Step 603 Select an image database matching the category from at least one image database.
  • the execution subject of the method for generating graphic information may select an image database matching the category determined in step 602 from at least one image database.
  • the at least one image database is generated based on the image description.
  • the image database may be specifically generated through the following five steps:
  • the first step is to obtain an image collection.
  • the images in the image set are the matching images in the graphic information.
  • the description information of the image is obtained, and at least one keyword is extracted from the description information of the image as the image keyword of the image.
  • the third step is to determine the similarity between the image keywords of different images in the image collection.
  • the images in the image set are classified based on the similarity between the image keywords of different images to obtain at least one sub-image set.
  • At least one image database corresponding to the at least one sub-image set is generated.
  • Step 604 Select an image matching the title keyword and content theme from the selected image database.
  • the execution subject of the method for generating graphic information may select an image matching the title keyword and content theme from the image database selected in step 603.
  • an image whose image keyword is similar to the title keyword and the content topic is greater than or equal to a similarity threshold (for example, 90%) may be selected from the selected image database.
  • step 605 the selected image is inserted into the information to be matched to generate target graphic information.
  • the executive body of the method for generating graphic information may insert the selected image according to a preset insertion rule (for example, after inserting the paragraph where the image keyword is located, etc.) To the information to be matched, generate the information with both pictures and texts.
  • a preset insertion rule for example, after inserting the paragraph where the image keyword is located, etc.
  • the process 600 of the method for generating graphic information in this embodiment embodies the use of title keywords and categories determined by the content theme to select matching images Database and the steps of selecting images from the matching image database. Therefore, the solution described in this embodiment can effectively improve the mapping efficiency.
  • FIG. 7 shows a schematic structural diagram of a computer system 700 suitable for implementing an electronic device (for example, the server 101 of FIG. 1) of an embodiment of the present application.
  • the electronic device shown in FIG. 7 is only an example, and should not bring any limitation to the functions and use scope of the embodiments of the present application.
  • the computer system 700 includes one or more central processing units (CPUs) 701, which can be loaded into a random access memory (RAM) according to programs stored in a read-only memory (ROM) 702 or from the storage section 708
  • the program in 703 performs various appropriate actions and processes.
  • various programs and data necessary for the operation of the system 700 are also stored.
  • the CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704.
  • An input / output (I / O) interface 705 is also connected to the bus 704.
  • the following components are connected to the I / O interface 705: an input portion 706 including a mouse, a keyboard, etc .; an output portion 707 including an organic light emitting diode (OLED) display, a liquid crystal display (LCD), etc., and a speaker, etc .; a storage portion including a hard disk, etc. 708; and a communication section 709 including a network interface card such as a LAN card, a modem, etc.
  • the communication section 709 performs communication processing via a network such as the Internet.
  • the drive 710 is also connected to the I / O interface 705 as needed.
  • a removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed on the drive 710 as necessary, so that the computer program read out therefrom is installed into the storage portion 708 as needed.
  • the process described above with reference to the flowchart may be implemented as a computer software program.
  • embodiments of the present disclosure include a computer program product that includes a computer program carried on a computer-readable medium, the computer program containing program code for performing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication section 709, and / or installed from the removable medium 711.
  • CPU central processing unit
  • the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable removable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • the computer-readable signal medium may include a data signal that is propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. .
  • the program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the foregoing.
  • the computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, the programming languages including object-oriented programming languages-such as Java, Smalltalk, C ++, as well as conventional Procedural programming language-such as "C" language or similar programming language.
  • the program code may be executed entirely on the user's computer, partly on the user's computer, as an independent software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, through an Internet service provider Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider Internet connection for example, AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of code that contains one or more logic functions Executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks represented in succession may actually be executed in parallel, and they may sometimes be executed in reverse order, depending on the functions involved.
  • each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts can be implemented with dedicated hardware-based systems that perform specified functions or operations Or, it can be realized by a combination of dedicated hardware and computer instructions.
  • the present application also provides a computer-readable medium, which may be contained in the server described in the foregoing embodiments; or may exist alone without being assembled into the server.
  • the computer-readable medium carries one or more programs.
  • the server is caused to: obtain title keywords and content topics from the information to be allocated; select and select from the image database. Images with matching title keywords and content themes, where the image database is generated based on the image description; the selected images are inserted into the information to be configured to generate target graphic information.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请实施例公开了用于生成图文信息的方法和用于生成图像数据库的方法。该用于生成图文信息方法的一具体实施方式包括:从待配图信息中获取标题关键词和内容主题;从图像数据库中选取与标题关键词和内容主题匹配的图像,其中,图像数据库基于图像描述生成;将选取的图像插入待配图信息中,生成目标图文信息。该实施方式有助于降低配图成本。

Description

用于生成图文信息的方法和用于生成图像数据库的方法 技术领域
本申请涉及计算机技术领域,具体涉及用于生成图文信息的方法和用于生成图像数据库的方法。
背景技术
互联网技术的快速发展与移动终端的普及改变了传统资讯(例如新闻)展示平台与内容展现形式。与传统的纯文本资讯信息相比,图文并茂的资讯信息更能吸引读者的注意。
相关技术中通过人工配图实现图文并茂的资讯信息,然而人工配图是一件费时费力并且低效的工作。
发明内容
本申请实施例提出了用于生成图文信息的方法和用于生成图像数据库的方法。
第一方面,本申请的一些实施例提供了一种用于生成图文信息的方法,该方法包括:从待配图信息中获取标题关键词和内容主题;从图像数据库中选取与标题关键词和内容主题匹配的图像,其中,图像数据库基于图像描述生成;将选取的图像插入待配图信息中,生成目标图文信息。
第二方面,本申请的一些实施例提供了一种用于生成图文信息的方法,该方法包括:从待配图信息中获取标题关键词和内容主题;基于标题关键词和内容主题确定待选取图像的类别;从至少一个图像数据库中选取与类别匹配的图像数据库;从选取的图像数据库中选取与标题关键词和内容主题匹配的图像,其中,至少一个图像数据库是基于图像描述生成;将选取的图像插入待配图信息中,生成目标图文信息。
第三方面,本申请的一些实施例提供了一种用于生成图像数据库的方法, 该方法包括:获取图像集合,图像集合中的图像为图文信息中的配图;对于图像集合中的图像,获取该图像的描述信息,从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词;基于图像集合和所提取的图像关键词,生成图像数据库。
第四方面,本申请的一些实施例提供了一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面至第三方面描述的方法。
第五方面,本申请的一些实施例提供了一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如第一方面至第三方面描述的方法。
本申请实施例提供的用于生成图文信息的方法和用于生成图像数据库的方法,通过从待配图信息中获取标题关键词和内容主题,之后从基于图像描述生成的图像数据库中选取与标题关键词和内容主题匹配的图像,最后将选取的图像插入待配图信息中生成目标图文信息,从而有助于降低配图成本。
附图说明
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:
图1是本申请一些实施例可以应用于其中的示例性系统架构图;
图2是根据本申请的用于生成图像数据库的方法的一个实施例的流程图;
图3是根据本申请的用于生成图像数据库的方法的一个应用场景的示意图;
图4是根据本申请的用于生成图文信息的方法的一个实施例的流程图;
图5是根据本申请的用于生成图文信息的方法的一个实施例的流程图;
图6是适于用来实现本申请实施例的电子设备的计算机系统的结构示意图;
图7是适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。
具体实施方式
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此 处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。
如图1所示,系统架构100可以包括服务器101、103和网络102。网络102用以在服务器101和103之间提供通信链路的介质。网络102可以包括各种连接类型,例如有线、无线通信链路或者光线电缆等等。
服务器101可以是用于生成图像数据库的服务器。服务器101可以获取图像集合(例如,从服务器103获取图像集合),之后获取每个图像的描述信息并从中提取图像关键词,生成图像与图相关词相对应的图像数据库。
服务器101还可以是对资讯信息进行配图的服务器。服务器101可以从资讯信息中获取标题关键词和内容主题,并从基于图像描述生成的图像数据库中选择匹配的图像插入资讯信息中生成图文并茂的资讯信息。
服务器102可以是储存有图像或图文信息的服务器。
需要说明的是,本申请实施例所提供的用于生成图像数据库的方法或用于生成图文信息的方法一般由服务器101执行。
需要说明的是,服务器101、103可以是硬件,也可以是软件。当服务器101、103为硬件时,可以实现成多个服务器组成的分布式服务器集群,也可以实现成单个服务器。当服务器为软件时,可以实现成多个软件或软件模块(例如用来提供分布式服务),也可以实现成单个软件或软件模块。在此不做具体限定。
需要指出的是,服务器101的本地也可以直接存储图像集合,服务器101可以直接获取本地的图像集合。此时,示例性系统架构100可以不包括服务器103。
应该理解,图1中的网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意合适数目的网络和服务器。
继续参考图2,示出了根据本申请的用于生成图像数据库的方法的一个实施例的流程200。该用于生成图像数据库的方法,可以包括以下步骤201~203。
步骤201,获取图像集合。
在本实施例中,用于生成图像数据库的方法的执行主体(例如图1的服务器101)可以从本地或远程获取图像集合。其中,图像集合中的图像可以是图文信息中的配图。图文信息可以包括文本内容和配图。例如,图文信息可以是新闻、博文等资讯信息。
这里,图像集合中的图像可以是上述执行主体或不同于上述执行主体的服务器从存储图像或图文信息的服务器中获取。例如,通过网络爬虫从网页服务器中的网页中爬取配图。
步骤202,对于图像集合中的每个图像,获取该图像的描述信息,从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词。
在本实施例中,对于图像集合中的每个图像,用于生成图像数据库的方法的执行主体(例如图1的服务器101)可以首先获取该图像的描述信息,然后从获取的描述信息中提取至少一个关键词作为该图像的图像关键词。图像的描述信息可以是对图像中包含的特征(例如,图像中的场景、显著性物体等)的文字表述。这里,可以利用分词技术从描述信息中提取关键词。
在本实施例的一些可选的实现方式中,可以通过如下步骤获取图像的描述信息:对图像进行图像识别(例如通过图像识别模型),然后根据图像识别结果生成图像的描述信息。作为示例,对于某一图像,经过图像识别,可以确定图像的场景为客厅以及图像中的显著性物体为一把椅子,则该图像的描述信息可以为“客厅中有一把椅子”。
在本实施例的一些可选的实现方式中,可以通过图像描述技术(Image Caption Technique)来获取图像的描述信息。例如,可以将图像输入到训练好的图像描述模型中,得到与输入图像对应的描述信息。这里,图像描述模型可以用于表征输入图像与描述信息之间的对应关系。该示例中,可以采用LSTM(Long Short-Term Memory,长短期记忆网络)单元的编码器框架作为图像描述模型。
可选地,上述图像描述模型可以通过如下步骤训练得到:
首先,从预先生成的图像描述数据库中获取多个图像以及与每个图像对应的描述信息。其中,图像描述数据库中存储有图像和与图像对应的描述信息。
然后,将上述多个图像中的每个图像作为输入,将与输入图像对应的描述信息作为输出,利用机器学习的方法对初始图像描述模型进行训练,得到图像描述模型。
可选地,上述图像描述数据库可以通过如下步骤生成:
首先,从本地或远程获取图文信息集合。
之后,对于上述图文信息集合中的每个图文信息,获取该图文信息中的配图以及从该图文信息的文本内容中提取与配图对应的描述信息。
最后,将配图及其对应的描述信息对应地进行存储,建立图像描述数据库。
在本实施例的一些可选的实现方式中,每个图像的描述信息可以是自然语言描述的句子。上述至少一个关键词可以包括自然语言描述的句子中所包含的名词和/或形容词。对应地,对于图像集合中的每个图像,从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词,可以包括如下两步:
第一步,对自然语言描述的句子进行分词,得到该自然语言描述的句子所包含的名词和/或形容词。
第二步,将上述名词和/或形容词提取为该图像的图像关键词。
作为示例,一图像的描述信息为“客厅中有一把椅子”,对该句子进行分词处理,得到其中包含的名词“客厅”、“椅子”,则可以将“客厅”、“椅子”这两个关键词提取为该图像的图像关键词。
步骤203,基于图像集合和所提取的图像关键词,生成图像数据库。
在本实施例中,用于生成图像数据库的方法的执行主体(例如图1的服务器101)可以使用图像集合和步骤202所提取的图像关键词建立图像数据库。作为示例,可以将上述图像集合中的每个图像及其图像关键词对应地进行存储,建立图像数据库。
继续参考图3,其示出了根据本申请的用于生成图像数据库的方法的一个应用场景300。在图3的应用场景300中,服务器302从本地获取图像集合,其中图像301为图像集合中的一个图像。之后,将图像301输入到训练好的图像描述模型中,得到描述信息“一朵黄色的花矗立于荒野”。对上述描述信息进行分词处理,获取其中的名词“花”、“荒野”和形容词“黄色”,并由上述三个关键词组成图像301的图像关键词(即,“花”、“荒野”、“黄色”)。 然后,将图像301和图像关键词“花”、“荒野”、“黄色”作为一条数据记录存储到数据库中。类似地,对图像集合中的其他图像进行同样的处理和存储,最终得到图像数据库。
本申请实施例提供的用于生成图像数据库的方法,通过收集图文信息中的配图,之后获取每个配图的描述信息,并从描述信息中提取图像关键词,最后基于收集的配图和提取的图像关键词生成图像数据库,从而有助于降低配图成本。
进一步参考图4,示出了根据本申请的用于生成图像数据库的方法的另一实施例的流程400。该用于生成图像数据库的方法,可以包括以下步骤401~405。
步骤401,获取图像集合。
在本实施例中,用于生成图像数据库的方法的执行主体(例如图1的服务器101)可以从本地或远程获取图像集合。其中,图像集合中的图像可以是图文信息中的配图。图文信息可以包括文本内容和配图。例如,图文信息可以是新闻、博文等资讯信息。
步骤402,对于图像集合中的每个图像,获取该图像的描述信息,从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词。
在本实施例中,对于图像集合中的每个图像,用于生成图像数据库的方法的执行主体(例如图1的服务器101)可以首先获取该图像的描述信息,然后从获取的描述信息中提取至少一个关键词作为该图像的图像关键词。图像的描述信息可以是对图像中包含的特征(例如,图像中的场景、显著性物体等)的文字表述。这里,可以利用分词技术从描述信息中提取关键词。
步骤403,确定图像集合中不同图像的图像关键词之间的相似度。
在本实施例中,用于生成图像数据库的方法的执行主体(例如图1的服务器101)可以确定图像集合中不同图像的图像关键词之间的相似度。作为示例,对于图像集合中的任意两个图像A和B,可以计算图像A的图像关键词与图像B的图像关键词之间的相似度。
步骤404,基于不同图像的图像关键词之间的相似度,对图像集合中的图 像进行分类,得到至少一个子图像集合。
在本实施例中,用于生成图像数据库的方法的执行主体(例如图1的服务器101)可以利用不同图像的图像关键词之间的相似度大小对上述图像集合中的各个图像进行分类(例如,通过聚类进行分类),得到至少一个子图像集合(每个子图像集合代表一个类别的图像)。
步骤405,生成与至少一个子图像集合分别对应的至少一个图像数据库。
在本实施例中,对于上述至少一个子图像集合中的每个子图像集合,用于生成图像数据库的方法的执行主体(例如图1的服务器101)可以将该子图像集合中的每个图像及其图像关键词对应地进行存储,得到与该子图像集合对应的图像数据库。
作为示例,图像集合包括100万个图像,利用图像关键词之间的相似度可以将该图像集合划分为1000个子图像集合(假定每个子图像集合包括1000个图像),进而建立1000个图像数据库。若仅建立一个图像数据库时,则获取一个图像最多需要匹配100万次。相比之下,本实施例中获取一个图像最多需要匹配2000次(确定匹配的图像数据库最多需要匹配1000次,检索匹配的数据库最多需要匹配1000次),从而有效提高了检索图像的效率。
从图4中可以看出,与图2对应的实施例相比,本实施例中的用于生成图像数据库的方法的流程400体现了利用图像关键词之间的相似度对图像进行分类以及根据不同类别的图像建立不同的图像数据库的步骤。由此,本实施例描述的方案可以有效提高检索图像的效率。
进一步参考图5,其示出了根据本申请的用于生成图文信息的方法的一个实施例的流程500。该用于生成图文信息的方法可以包括以下步骤501~503。
步骤501,从待配图信息中获取标题关键词和内容主题。
在本实施例中,用于生成图文信息的方法的执行主体(例如图1的服务器101)可以从待配图信息中获取标题关键词和内容主题。这里,待配图信息可以是需要进行配图的资讯信息(例如,仅包含文本内容的新闻)。
在本实施例的一些可选的实现方式中,步骤501具体可以包括以下步骤:
首先,获取待配图信息的标题和文本内容。
之后,利用分词技术从标题中提取关键词作为标题关键词。
然后,将文本内容输入到训练好的文本主题模型中,得到待配图信息的内容主题。其中,内容主题可以包括主题关键词。这里,文本主题模型可以表征文本内容与内容主题之间的对应关系。
文本主题模型是对文字中隐含主题的一种建模方法。一般认为一篇文章的每个词都是通过“以一定概率选择了某个主题,并从这个主题中以一定概率选择某个词语”。文本主题模型训练方法可以包括LSA(Latent semantic analysis,隐性语义分析)、pLSA(Probabilistic latent semantic analysis,概率隐性语义分析)、LDA(Latent Dirichlet allocation,隐狄利克雷分配)等。文本主题模型的训练是目前广泛研究和应用的公知技术,在此不再赘述。
步骤502,从图像数据库中选取与标题关键词和内容主题匹配的图像。
在本实施例中,用于生成图文信息的方法的执行主体(例如图1的服务器101)可以图像数据库中选取与步骤502获取的标题关键词和内容主题相匹配的图像。其中,图像数据库是基于图像描述生成的。
在本实施例的一些可选的实现方式中,步骤502具体可以包括如下步骤:首先,确定图像数据库所包括的图像的图像关键词与上述标题关键词和上述内容主题的相似度;然后,选取相似度大于或等于预设阈值的图像。作为示例,可以从图像数据库中选取图像关键词与标题关键词和内容主题的相似度大于或等于相似度阈值(例如90%)的图像。
在本实施例的一些可选的实现方式中,图像数据库具体可以通过如下三个步骤生成:
第一步,获取图像集合。其中,图像集合中的图像为图文信息中的配图。
第二步,对于图像集合中的每个图像,获取该图像的描述信息,从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词。
第三步,基于图像集合和所提取的图像关键词,生成图像数据库。
上述第一步至第三步的具体描述可以参考图2对应的实施例中关于步骤201~步骤203的具体描述,在此不做赘述。
可选地,可以通过图像描述技术(Image Caption Technique)来获取图像的描述信息。例如,可以将图像输入到训练好的图像描述模型中,得到与输入 图像对应的描述信息。这里,图像描述模型可以用于表征输入图像与描述信息之间的对应关系。该示例中,可以采用LSTM(Long Short-Term Memory,长短期记忆网络)单元的编码器框架作为图像描述模型。
可选地,上述图像描述模型可以通过如下步骤训练得到:
首先,从预先生成的图像描述数据库中获取多个图像以及与每个图像对应的描述信息。其中,图像描述数据库中存储有图像和与图像对应的描述信息。
然后,将上述多个图像中的每个图像作为输入,将与输入图像对应的描述信息作为输出,利用机器学习的方法对初始图像描述模型进行训练,得到图像描述模型。
可选地,上述图像描述数据库可以通过如下步骤生成:
首先,从本地或远程获取图文信息集合。
之后,对于上述图文信息集合中的每个图文信息,获取该图文信息中的配图以及从该图文信息的文本内容中提取与配图对应的描述信息。
最后,将配图及其对应的描述信息对应地进行存储,建立图像描述数据库。
在本实施例的一些可选的实现方式中,每个图像的描述信息可以是自然语言描述的句子。上述至少一个关键词可以包括自然语言描述的句子中所包含的名词和/或形容词。对应地,对于图像集合中的每个图像,从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词,可以包括如下两步:
第一步,对自然语言描述的句子进行分词,得到该自然语言描述的句子所包含的名词和/或形容词。
第二步,将上述名词和/或形容词提取为该图像的图像关键词。
作为示例,一图像的描述信息为“客厅中有一把椅子”,对该句子进行分词处理,得到其中包含的名词“客厅”、“椅子”,则可以将“客厅”、“椅子”这两个关键词提取为该图像的图像关键词。
步骤503,将选取的图像插入待配图信息中,生成目标图文信息。
在本实施例中,用于生成图文信息的方法的执行主体(例如图1的服务器101)可以将选取的图像按照预设的插入规则(例如,插入图像关键词所在的段落之后等)插入到待配图信息中,生成图文并茂的资讯信息。
本申请实施例提供的用于生成图文信息的方法,通过获取待配图信息的标 题关键词和内容主题,之后从基于图像描述生成的图像数据库中选取匹配的图像,最后将选取的图像插入待配图信息中生成目标图文信息,从而有助于降低配图成本。
进一步参考图6,其示出了根据本申请的用于生成图文信息的方法的另一实施例的流程600。该用于生成图文信息的方法可以包括以下步骤601~605。
步骤601,从待配图信息中获取标题关键词和内容主题。
在本实施例中,用于生成图文信息的方法的执行主体(例如图1的服务器101)可以从待配图信息中获取标题关键词和内容主题。这里,待配图信息可以是需要进行配图的资讯信息(例如,仅包含文本内容的新闻)。
获取标题关键词和内容主题的具体步骤可以参考图5对应的实施例中关于获取标题关键词和内容主题的具体步骤的描述,在此不再赘述。
步骤602,基于标题关键词和内容主题确定待选取图像的类别。
在本实施例中,用于生成图文信息的方法的执行主体(例如图1的服务器101)可以基于标题关键词和内容主题确定待选取图像的类别。作为示例,可以将步骤601获取的标题关键词和内容主题进行融合,确定待选取的图像的类别。
步骤603,从至少一个图像数据库中选取与类别匹配的图像数据库。
在本实施例中,用于生成图文信息的方法的执行主体(例如图1的服务器101)可以从至少一个图像数据库中选取与步骤602确定的类别相匹配的图像数据库。其中,上述至少一个图像数据库是基于图像描述生成的。
在本实施例的一些可选的实现方式中,图像数据库具体可以通过如下五个步骤生成:
第一步,获取图像集合。其中,图像集合中的图像为图文信息中的配图。
第二步,对于图像集合中的每个图像,获取该图像的描述信息,从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词。
第三步,确定图像集合中不同图像的图像关键词之间的相似度。
第四步,基于不同图像的图像关键词之间的相似度,对图像集合中的图像进行分类,得到至少一个子图像集合。
第五步,生成与上述至少一个子图像集合中分别对应的至少一个图像数据 库。
上述第一步至第五步的具体描述可以参考图4对应的实施例中关于步骤401~步骤405的具体描述,在此不做赘述。
步骤604,从选取的图像数据库中选取与标题关键词和内容主题匹配的图像。
在本实施例中,用于生成图文信息的方法的执行主体(例如图1的服务器101)可以步骤603选取的图像数据库中选取与标题关键词和内容主题匹配的图像。作为示例,可以从选取的图像数据库中选取图像关键词与标题关键词和内容主题的相似度大于或等于相似度阈值(例如90%)的图像。
步骤605,将选取的图像插入待配图信息中,生成目标图文信息。
在本实施例中,用于生成图文信息的方法的执行主体(例如图1的服务器101)可以将选取的图像按照预设的插入规则(例如,插入图像关键词所在的段落之后等)插入到待配图信息中,生成图文并茂的资讯信息。
从图6中可以看出,与图5对应的实施例相比,本实施例中的用于生成图文信息的方法的流程600体现了利用标题关键词和内容主题确定的类别选取匹配的图像数据库以及从匹配的图像数据库中选取图像的步骤。由此,本实施例描述的方案可以有效提高配图效率。
下面参考图7,其示出了适于用来实现本申请实施例的电子设备(例如图1的服务器101)的计算机系统700的结构示意图。图7示出的电子设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图7所示,计算机系统700包括一个或多个中央处理单元(CPU)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有系统700操作所需的各种程序和数据。CPU 701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。
以下部件连接至I/O接口705:包括鼠标、键盘等的输入部分706;包括诸如有机发光二极管(OLED)显示器、液晶显示器(LCD)等以及扬声器等的输出部分707;包括硬盘等的存储部分708;以及包括诸如LAN卡、调制解调器等 的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器710也根据需要连接至I/O接口705。可拆卸介质711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器710上,以便于从其上读出的计算机程序根据需要被安装入存储部分708。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质711被安装。在该计算机程序被中央处理单元(CPU)701执行时,执行本申请的方法中限定的上述功能。
需要说明的是,本申请所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言-诸如 Java、Smalltalk、C++,还包括常规的过程式程序设计语言-诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)-连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的服务器中所包含的;也可以是单独存在,而未装配入该服务器中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该服务器执行时,使得该服务器:从待配图信息中获取标题关键词和内容主题;从图像数据库中选取与标题关键词和内容主题匹配的图像,其中,图像数据库基于图像描述生成;将选取的图像插入待配图信息中,生成目标图文信息。
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成 的技术方案。

Claims (15)

  1. 一种用于生成图文信息的方法,其特征在于,包括:
    从待配图信息中获取标题关键词和内容主题;
    从图像数据库中选取与所述标题关键词和所述内容主题匹配的图像,其中,所述图像数据库基于图像描述生成;
    将选取的图像插入所述待配图信息中,生成目标图文信息。
  2. 根据权利要求1所述的方法,其特征在于,所述图像数据库具体通过如下步骤生成:
    获取图像集合,所述图像集合中的图像为图文信息中的配图;
    对于所述图像集合中的图像,获取该图像的描述信息,从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词;
    基于所述图像集合和所提取的图像关键词,生成图像数据库。
  3. 根据权利要求2所述的方法,其特征在于,所述获取该图像的描述信息,包括:
    将该图像输入预先训练的图像描述模型中,得到该图像的描述信息,其中,所述图像描述模型用于表征输入图像与描述信息之间的对应关系。
  4. 根据权利要求3所述的方法,其特征在于,所述图像描述模型通过如下步骤训练得到:
    从预先生成的图像描述数据库中获取多个图像以及与所述多个图像对应的描述信息;
    将所述多个图像中的图像作为输入,将与输入图像对应的描述信息作为输出,训练得到所述图像描述模型。
  5. 根据权利要求4所述的方法,其特征在于,所述图像描述数据库通过如下步骤生成:
    获取图文信息集合;
    对于图文信息集合中的图文信息,获取该图文信息中的配图以及与配图对应的描述信息;
    基于所获取的配图以及与配图对应的描述信息,生成所述图像描述数据库。
  6. 根据权利要求2至5中任一项所述的方法,其特征在于,对于所述图像集合中的图像,该图像的描述信息为自然语言描述的句子,所述至少一个关键词包括所述自然语言描述的句子所包含的名词和/或形容词;所述从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词,包括:
    对所述自然语言描述的句子进行分词,得到所述自然语言描述的句子所包含的名词和/或形容词;
    将所述名词和/或形容词提取为该图像的图像关键词。
  7. 根据权利要求2至6中任一项所述的方法,其特征在于,所述基于所述图像集合和所提取的图像关键词,生成图像数据库,包括:
    确定所述图像集合中不同图像的图像关键词之间的相似度;
    基于不同图像的图像关键词之间的相似度,对所述图像集合中的图像进行分类,得到至少一个子图像集合;
    生成与所述至少一个子图像集合分别对应的至少一个图像数据库。
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,所述从图像数据库中选取与所述标题关键词和所述内容主题匹配的图像,包括:
    确定所述图像数据库所包括的图像的图像关键词与所述标题关键词和所述内容主题的相似度;
    选取所述相似度大于或等于预设阈值的图像。
  9. 根据权利要求1至8中任一项所述的方法,其特征在于,所述从待配图信息中获取标题关键词和内容主题,包括:
    获取所述待配图信息的标题和文本内容;
    从所述标题中提取所述标题关键词;
    将所述文本内容输入到预先训练的文本主题模型中,得到所述内容主题。
  10. 一种用于生成图文信息的方法,其特征在于,包括:
    从待配图信息中获取标题关键词和内容主题;
    基于所述标题关键词和所述内容主题确定待选取图像的类别;
    从至少一个图像数据库中选取与所述类别匹配的图像数据库,其中,所述至少一个图像数据库是基于图像描述生成;
    从选取的图像数据库中选取与所述标题关键词和所述内容主题匹配的图像;
    将选取的图像插入所述待配图信息中,生成目标图文信息。
  11. 根据权利要求10所述的方法,其特征在于,所述至少一个图像数据库通过如下步骤生成:
    获取图像集合,所述图像集合中的图像为图文信息中的配图;
    对于所述图像集合中的图像,获取该图像的描述信息,从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词;
    确定所述图像集合中不同图像的图像关键词之间的相似度;
    基于不同图像的图像关键词之间的相似度,对所述图像集合中的图像进行分类,得到至少一个子图像集合;
    生成与所述至少一个子图像集合分别对应的至少一个图像数据库。
  12. 一种用于生成图像数据库的方法,其特征在于,包括:
    获取图像集合,所述图像集合中的图像为图文信息中的配图;
    对于所述图像集合中的图像,获取该图像的描述信息,从该图像的描述信息中提取至少一个关键词作为该图像的图像关键词;
    基于所述图像集合和所提取的图像关键词,生成图像数据库。
  13. 根据权利要求12所述的方法,所述基于所述图像集合和所提取的图像关键词,生成图像数据库,包括:
    确定不同图像的图像关键词之间的相似度;
    基于不同图像的图像关键词之间的相似度,对所述图像集合中的图像进行分类,得到至少一个子图像集合;
    生成与所述至少一个子图像集合分别对应的至少一个图像数据库。
  14. 一种电子设备,包括:
    一个或多个处理器;
    存储装置,其上存储有一个或多个程序;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1至13中任一项所述的方法。
  15. 一种计算机可读介质,其上存储有计算机程序,其中,所述程序被处理器执行时实现如权利要求1至13中任一项所述的方法。
PCT/CN2019/119914 2018-11-23 2019-11-21 用于生成图文信息的方法和用于生成图像数据库的方法 WO2020103899A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811407298.2A CN109697239B (zh) 2018-11-23 2018-11-23 用于生成图文信息的方法
CN201811407298.2 2018-11-23

Publications (1)

Publication Number Publication Date
WO2020103899A1 true WO2020103899A1 (zh) 2020-05-28

Family

ID=66230118

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/119914 WO2020103899A1 (zh) 2018-11-23 2019-11-21 用于生成图文信息的方法和用于生成图像数据库的方法

Country Status (2)

Country Link
CN (1) CN109697239B (zh)
WO (1) WO2020103899A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112287173A (zh) * 2020-10-30 2021-01-29 北京有竹居网络技术有限公司 用于生成信息的方法和装置
CN117690130A (zh) * 2023-08-18 2024-03-12 荣耀终端有限公司 一种图像标题生成方法及相关装置

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109697239B (zh) * 2018-11-23 2022-05-31 南京尚网网络科技有限公司 用于生成图文信息的方法
CN110209862B (zh) * 2019-05-22 2021-06-25 招商局金融科技有限公司 文本配图方法、电子装置及计算机可读存储介质
CN110222189A (zh) * 2019-06-19 2019-09-10 北京百度网讯科技有限公司 用于输出信息的方法和装置
CN111753078B (zh) * 2019-07-12 2024-02-02 北京京东尚科信息技术有限公司 图像段落描述生成方法、装置、介质及电子设备
CN110413814A (zh) * 2019-07-12 2019-11-05 智慧芽信息科技(苏州)有限公司 图像数据库建立方法、搜索方法、电子设备和存储介质
CN113449139A (zh) * 2020-03-24 2021-09-28 阿里巴巴集团控股有限公司 生成配图的方法、装置和系统
CN112015936B (zh) * 2020-08-27 2021-10-26 北京字节跳动网络技术有限公司 用于生成物品展示图的方法、装置、电子设备和介质
CN112613293B (zh) * 2020-12-29 2024-05-24 北京中科闻歌科技股份有限公司 摘要生成方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090112830A1 (en) * 2007-10-25 2009-04-30 Fuji Xerox Co., Ltd. System and methods for searching images in presentations
CN106951493A (zh) * 2017-03-14 2017-07-14 北京搜狐新媒体信息技术有限公司 无图新闻的自动配图展示方法及装置
CN107193962A (zh) * 2017-05-24 2017-09-22 百度在线网络技术(北京)有限公司 一种互联网推广信息的智能配图方法及装置
CN108733779A (zh) * 2018-05-04 2018-11-02 百度在线网络技术(北京)有限公司 文本配图的方法和装置
CN109697239A (zh) * 2018-11-23 2019-04-30 连尚(新昌)网络科技有限公司 用于生成图文信息的方法和用于生成图像数据库的方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AUPQ589300A0 (en) * 2000-02-28 2000-03-23 Canon Kabushiki Kaisha Automatically selecting fonts
CN102693231B (zh) * 2011-03-23 2019-07-26 百度在线网络技术(北京)有限公司 用于根据来自网络的图像来确定图集的方法、装置和设备
CN104657375B (zh) * 2013-11-20 2018-01-26 中国科学院深圳先进技术研究院 一种图文主题描述方法、装置以及系统
US20180173681A1 (en) * 2016-12-21 2018-06-21 Ten-X, Llc System and method for generating content pertaining to real property assets
CN107103073A (zh) * 2017-04-21 2017-08-29 北京恒冠网络数据处理有限公司 一种图像检索系统
CN108304431B (zh) * 2017-06-14 2021-11-09 腾讯科技(深圳)有限公司 一种图像检索方法及装置、设备、存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090112830A1 (en) * 2007-10-25 2009-04-30 Fuji Xerox Co., Ltd. System and methods for searching images in presentations
CN106951493A (zh) * 2017-03-14 2017-07-14 北京搜狐新媒体信息技术有限公司 无图新闻的自动配图展示方法及装置
CN107193962A (zh) * 2017-05-24 2017-09-22 百度在线网络技术(北京)有限公司 一种互联网推广信息的智能配图方法及装置
CN108733779A (zh) * 2018-05-04 2018-11-02 百度在线网络技术(北京)有限公司 文本配图的方法和装置
CN109697239A (zh) * 2018-11-23 2019-04-30 连尚(新昌)网络科技有限公司 用于生成图文信息的方法和用于生成图像数据库的方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112287173A (zh) * 2020-10-30 2021-01-29 北京有竹居网络技术有限公司 用于生成信息的方法和装置
CN117690130A (zh) * 2023-08-18 2024-03-12 荣耀终端有限公司 一种图像标题生成方法及相关装置

Also Published As

Publication number Publication date
CN109697239B (zh) 2022-05-31
CN109697239A (zh) 2019-04-30

Similar Documents

Publication Publication Date Title
WO2020103899A1 (zh) 用于生成图文信息的方法和用于生成图像数据库的方法
CN107679039B (zh) 用于确定语句意图的方法和装置
CN112685565B (zh) 基于多模态信息融合的文本分类方法、及其相关设备
CN109388795B (zh) 一种命名实体识别方法、语言识别方法及系统
CN109543058B (zh) 用于检测图像的方法、电子设备和计算机可读介质
WO2018045646A1 (zh) 基于人工智能的人机交互方法和装置
WO2017127296A1 (en) Analyzing textual data
EP3926531B1 (en) Method and system for visio-linguistic understanding using contextual language model reasoners
US20200134398A1 (en) Determining intent from multimodal content embedded in a common geometric space
CN105760363B (zh) 文本文件的词义消歧方法及装置
WO2020052069A1 (zh) 用于分词的方法和装置
CN112131881B (zh) 信息抽取方法及装置、电子设备、存储介质
US9678947B2 (en) Pattern identification and correction of document misinterpretations in a natural language processing system
CN111800650B (zh) 视频配乐方法、装置、电子设备及计算机可读介质
US10558760B2 (en) Unsupervised template extraction
CN114860992A (zh) 视频的标题生成方法、装置、设备及存储介质
CN113038175B (zh) 视频处理方法、装置、电子设备及计算机可读存储介质
JP6446987B2 (ja) 映像選択装置、映像選択方法、映像選択プログラム、特徴量生成装置、特徴量生成方法及び特徴量生成プログラム
CN112199954A (zh) 基于语音语义的疾病实体匹配方法、装置及计算机设备
CN116955591A (zh) 用于内容推荐的推荐语生成方法、相关装置和介质
CN116719915A (zh) 智能问答方法、装置、设备及存储介质
CN112749553B (zh) 视频文件的文本信息处理方法、装置和服务器
US20210295036A1 (en) Systematic language to enable natural language processing on technical diagrams
TWI656448B (zh) 主題提供裝置及其雲儲存檔案提示方法
CN114547435A (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: 19887654

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19887654

Country of ref document: EP

Kind code of ref document: A1