CN109685085B - Main graph extraction method and device - Google Patents

Main graph extraction method and device Download PDF

Info

Publication number
CN109685085B
CN109685085B CN201710969326.9A CN201710969326A CN109685085B CN 109685085 B CN109685085 B CN 109685085B CN 201710969326 A CN201710969326 A CN 201710969326A CN 109685085 B CN109685085 B CN 109685085B
Authority
CN
China
Prior art keywords
image
extracted
word vector
description information
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.)
Active
Application number
CN201710969326.9A
Other languages
Chinese (zh)
Other versions
CN109685085A (en
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710969326.9A priority Critical patent/CN109685085B/en
Publication of CN109685085A publication Critical patent/CN109685085A/en
Application granted granted Critical
Publication of CN109685085B publication Critical patent/CN109685085B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Abstract

The application discloses a main graph extraction method, which comprises the following steps: acquiring characteristic information of an image contained in an object to be extracted; determining the relevance of the image and the object to be extracted based on the characteristic information; and extracting the image with the correlation degree meeting the preset extraction condition as a main image of the object to be extracted. The main graph extraction method determines the correlation between the image and the object to be extracted at the content level, and accordingly realizes main graph extraction of the object to be extracted, and is higher in adaptability and accuracy.

Description

Main graph extraction method and device
Technical Field
The application relates to the technical field of Internet, in particular to a main graph extraction method. The application also relates to a main graph extraction device and a readable storage medium.
Background
With the development of internet technology, the expression forms of web pages are more and more diversified, images appearing in the web pages are more and more attractive to users than simple characters, and the expression effect is more efficient and obvious. At present, a plurality of information aggregation applications generally need to collect a large amount of non-self information, the collected information is aggregated and then displayed to a user, the image is taken as an example of image collection, the information aggregation applications download the required image and store the image in a storage space of the user, and the image is loaded from the storage space of the user in the aggregation display process. However, if the information aggregation application downloads and stores all the images related to the web page in the acquisition process, larger network and storage resources are inevitably consumed, so that the images in the web page need to be identified, and only representative images (main images) in the web page are extracted for aggregation display.
In the prior art, the information aggregation type is applied in the process of extracting the webpage primary image, firstly, all images in the webpage are extracted through image links in the webpage, then, the width and the height of the images are obtained, the size of the images is calculated according to the width and the height, afterwards, the images which do not meet the requirements are filtered according to a preset image filtering rule, the width, the height and the size threshold are generally set for filtering out the images which are too vertical, too flat or too small in area, or the images which do not meet the domain name rule are filtered according to the set domain name filtering rule, finally, the filtered images are sequenced according to a specific rule, and the webpage primary image is extracted according to the sequencing result.
In the extraction method of the webpage main graph provided by the prior art, the set filtering rule is mainly relied on in the extraction process of the webpage main graph, the images which do not meet the requirements are filtered through the filtering rule, and the accuracy fluctuation of filtering results obtained by filtering for different data sources and the filtering rule is large, so that the universality is low.
Disclosure of Invention
The application provides a main graph extraction method, which aims to overcome the defect of low universality in the prior art. The application also relates to a main graph extraction device and a readable storage medium.
The application provides a main graph extraction method, which comprises the following steps:
acquiring characteristic information of an image contained in an object to be extracted;
determining the relevance of the image and the object to be extracted based on the characteristic information;
and extracting the image with the correlation degree meeting the preset extraction condition as a main image of the object to be extracted.
Optionally, the feature information includes at least one of the following: image description information, location, size, labels, keywords, and sequence identification.
Optionally, the determining the relevance between the image and the object to be extracted based on the feature information is implemented in the following manner:
and determining the semantic similarity of the image description information and the theme name according to the image description information and the theme name of the object to be extracted contained in the feature information.
Optionally, the determining, according to the image description information and the topic name of the object to be extracted included in the feature information, the semantic similarity between the image description information and the topic name includes:
determining a first word vector mapped by the theme name of the object to be extracted and a second word vector mapped by the image description information of the image;
And calculating the vector distance between the first word vector and the second word vector as the semantic similarity between the image and the resource to be extracted.
Optionally, the first word vector mapped by the subject name of the object to be extracted and the second word vector mapped by the image description information of the image are determined in the following manner:
word segmentation is carried out on the theme name and the image description information;
removing invalid words contained in the word set obtained after word segmentation and performing duplication removal to obtain an effective word set;
determining a numerical representation of valid words contained in the set of valid words;
and determining a first word vector mapped by the theme name according to a first array formed by the numerical representations of the effective words contained in the theme name, and determining a second word vector mapped by the image description information according to a second array formed by the numerical representations of the effective words contained in the image description information.
Optionally, a vector dimension of the first word vector and the second word vector is determined by a number of valid words contained in the valid word set, and the vector dimension is consistent with the number of valid words.
Optionally, the extracting the image with the correlation degree meeting the preset extraction condition is implemented as a main graph of the object to be extracted by adopting the following manner:
Determining weighted sums of the semantic similarity, the size of the image and the sequence position and the respective corresponding weights;
sorting the images contained in the object to be extracted in a descending order according to the determined weighted sum;
extracting at least one image from the ordered images as a main image of the object to be extracted;
the semantic similarity between the image description information of the main graph and the theme name is larger than that between the image description information of the non-extracted image and the theme name.
Optionally, before the step of determining the weighted sum of the semantic similarity, the size of the image, and the sequence position and the respective corresponding weights is performed, the following operations are performed:
and normalizing the semantic similarity of the image description information and the theme name.
Optionally, the extracting the image with the correlation degree meeting the preset extraction condition is implemented as a main graph of the object to be extracted by adopting the following manner:
sorting images contained in the object to be extracted in a descending order according to the semantic similarity;
extracting at least one image from the ordered images as a main image of the object to be extracted;
The semantic similarity between the image description information of the main graph and the theme name is larger than that between the image description information of the non-extracted image and the theme name.
Optionally, before the determining the semantic similarity sub-step of the image description information and the topic name of the object to be extracted according to the image description information and the topic name contained in the feature information is performed, the following operations are performed:
and acquiring the theme name of the object to be extracted and the text content of the object to be extracted.
Optionally, after the step of obtaining the feature information of the image included in the object to be extracted is performed, and before the step of determining the relativity between the image and the object to be extracted based on the feature information is performed, the following operations are performed:
judging whether the characteristic information of the image meets a preset characteristic threshold value or not, if so, executing the step of determining the relativity of the image and the object to be extracted based on the characteristic information; if not, the image is removed from the image contained in the object to be extracted.
Optionally, after the step of obtaining the feature information of the image included in the object to be extracted is performed, and before the step of determining the relativity between the image and the object to be extracted based on the feature information is performed, the following operations are performed:
Judging whether the acquired characteristic information of the image is empty or not, if so, setting a preset reference characteristic as the characteristic information of the image; and if not, executing the step of judging whether the characteristic information of the image meets the preset characteristic threshold value.
The application also provides a main graph extraction device, which comprises:
the characteristic information acquisition unit is used for acquiring characteristic information of an image contained in the object to be extracted;
a correlation determination unit for determining a correlation between the image and the object to be extracted based on the feature information;
and the main image extraction unit is used for extracting the image with the correlation degree meeting the preset extraction condition as the main image of the object to be extracted.
Optionally, the feature information includes at least one of the following: image description information, location, size, labels, keywords, and sequence identification.
Optionally, the relevance determining unit is specifically configured to determine, according to the image description information and the topic name of the object to be extracted, the semantic similarity between the image description information and the topic name.
Optionally, the correlation determining unit includes:
A word vector determining subunit, configured to determine a first word vector mapped by a topic name of the object to be extracted and a second word vector mapped by image description information of the image;
the semantic similarity calculating subunit is used for calculating the vector distance between the first word vector and the second word vector as the semantic similarity between the image and the resource to be extracted.
The present application also provides a readable storage medium having instructions stored thereon that are executable to:
acquiring characteristic information of an image contained in an object to be extracted;
determining the relevance of the image and the object to be extracted based on the characteristic information;
and extracting the image with the correlation degree meeting the preset extraction condition as a main image of the object to be extracted.
The main graph extraction method provided by the application comprises the following steps: acquiring characteristic information of an image contained in an object to be extracted; determining the relevance of the image and the object to be extracted based on the characteristic information; and extracting the image with the correlation degree meeting the preset extraction condition as a main image of the object to be extracted.
According to the main graph extraction method, in the process of extracting the main graph of the object to be extracted, the characteristic information of the image contained in the object to be extracted is obtained, the correlation between the image and the object to be extracted is determined on the content level based on the characteristic information, and finally the main graph of the object to be extracted is extracted according to the correlation between the image and the object to be extracted, so that the main graph extraction is realized on the content level, the adaptability is higher, and the accuracy is higher.
Drawings
FIG. 1 is a process flow diagram of an embodiment of a method for extracting a main graph provided by the application;
fig. 2 is a schematic diagram of an embodiment of a main drawing extraction device provided by the application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The present application may be embodied in many other forms than those herein described, and those skilled in the art will readily appreciate that the present application may be similarly embodied without departing from the spirit or essential characteristics thereof, and therefore the present application is not limited to the specific embodiments disclosed below.
The application provides a main graph extraction method, a main graph extraction device and a readable storage medium. The following detailed description is provided with reference to the accompanying drawings of the embodiments of the application.
The embodiment of the main graph extraction method provided by the application is as follows:
referring to fig. 1, a process flow diagram of an embodiment of a method for extracting a main graph according to the present application is shown.
Step S101, obtaining feature information of an image contained in an object to be extracted.
The main graph extraction method provided by the application can be realized in various application scenes, such as an information aggregation application or a browser, and when the information aggregation application is realized, the information aggregation application extracts images with the content most representative or the characteristic meaning from other application pages or webpage pages, and aggregates the main graphs extracted from other application pages or webpage pages and displays the images to a user. When the method is implemented in a browser, the main image of the webpage is extracted, for example, the main image of the news page, the blog page or the advertisement page is extracted, and the extracted main image is displayed to a user after aggregation. Therefore, according to the main graph extraction method provided by the application, on one hand, the extracted main graph is displayed to the user after aggregation, so that the efficiency of information browsing by the user is improved; on the other hand, only the main graph of the webpage is needed to be downloaded and stored in the aggregation process, so that network resources required for downloading the images and storage resources required for storing the images are saved.
The object to be extracted in the embodiment of the application refers to an application page, a webpage page and other pages or data sources of the extracted main graph. The image contained in the object to be extracted refers to an image displayed in an application page or a webpage page. The main image refers to an image with the most representative content or the most characteristic meaning among the images contained in the object to be extracted.
In addition, the image may be an application page or other similar elements shown in a web page, such as a moving image, where the moving image may be regarded as a combination of a plurality of still images, so that main image extraction may be performed on the moving image, specifically, when the moving image is extracted, one of the plurality of still images that form one moving image may be extracted as a main image, one of the plurality of moving images included in the object to be extracted may be extracted as a main image, and one of the plurality of moving images included in the object to be extracted may be extracted as a main image.
The feature information of the image refers to attribute features related to the attribute of the application page or the webpage including the image, and when the image is implemented, the feature information may be one or more of the following provided feature information: image description information, location, size, labels, keywords, and sequence identification. The image description information refers to text description of the image, the information expressed by the image is used for describing the position of the image in an application page or a webpage, the sequence identification refers to the sequence of the image in the application page or the webpage, and the size of the image is used for representing the width and the height of the image in the application page or the webpage.
In the process of extracting the main graph of the application page or the webpage, firstly, the characteristic information of the image contained in the application page or the webpage is acquired. For example, processing HTML source codes of a webpage, extracting images in the HTML source codes through a regular expression, and thus obtaining all images contained in the webpage; for the obtained images, extracting the width, height, position, sequence identification and corresponding image description information of each image.
In a preferred embodiment of the present application, in the process of acquiring the feature information of the image included in the application page or the web page, the theme name of the application page or the web page and/or the text content of the application page or the web page are acquired at the same time. For example, in the process of extracting the attribute information of the news page or the image included in the blog page, the title and the corresponding text of the news shown in the news page are extracted, or the title and the corresponding text of the blog content shown in the blog page are extracted.
In addition, the above-mentioned obtaining of the theme name and/or text content of the application page or the web page may be performed before or after the obtaining of the feature information of the image included in the application page or the web page, but in this embodiment, the following step S102 determines the relevance of the image to the application page or the web page based on the feature information, which is performed on the basis of obtaining of the theme name and/or text content of the application page or the web page, so that the process of obtaining the theme name and/or text content of the application page or the web page needs to be performed before the following step S102.
In practical applications, due to the difference of the data sources to which the application page or the web page belongs, the obtained feature information of all the images in the application page or the web page may be affected, for example, the feature information of the images contained in the application page or the web page cannot be obtained, that is: in this case, preferably, after the feature information of the image included in the application page or the web page is obtained, whether the obtained feature information is empty is determined, if so, it indicates that the feature information of the image is failed to be obtained, the reference feature of the preset image may be used as the feature information of the current image, for example, when the size of the image is failed to be obtained, the size of the image may be set to 300 pixels as a default value; if not, the processing of the subsequent steps is continued. Further, in the case where a plurality of image sizes included in an application page or a web page have been acquired, if one or more image sizes of the application page or the web page are subsequently failed to be acquired, an average value of the acquired image sizes may be taken as the acquisition failure image size as a size. On the basis, when the average value of the acquired image sizes of the application page or the webpage is obviously larger or smaller, or all the images contained in the application page or the webpage are failed to acquire, the default value of the preset image size can be used as the size of the acquisition failure image.
In a preferred embodiment of the present application, after the feature information of the image included in the application page or the web page is obtained, the image may be filtered according to the obtained feature information, and whether the feature information of the image meets a preset feature threshold may be determined by preset general filtering rules, if yes, the processing of the subsequent steps may be continued; if not, the current image is removed from the image contained in the application page or the webpage. For example, the width and height of each image are required to be larger than 200 pixels, whether the width and height of each image are larger than 200 pixels is judged, and if the width or height of each image is smaller than 200 pixels, the image is discarded. Alternatively, the image with the too large or too small width to height ratio is discarded by judging whether the image with the too large or too small width to height ratio is too large or too small.
Step S102, determining the correlation degree between the image and the object to be extracted based on the characteristic information.
After the feature information of the image included in the application page or the web page is obtained in the step S101, in this step, the relevance between the image and the application page or the web page where the image is located is determined according to the obtained feature information. Specifically, in an preferred embodiment of the present application, according to the obtained image description information contained in the feature information and the obtained theme name of the application page or the web page, the correlation between the image and the application page or the web page where the image description information and the theme name are located is determined by determining the semantic similarity between the image description information and the theme name.
Preferably, the semantic similarity between the image description information and the topic name can be determined by the following ways:
(1) Determining a first word vector mapped by the theme name of the application page or the webpage and a second word vector mapped by the image description information of the image;
in specific implementation, the first word vector mapped by the theme name of the page or the webpage and the second word vector mapped by the image description information of the image can be determined by the following ways:
word segmentation is carried out on the theme name and the image description information;
removing invalid words contained in the word set obtained after word segmentation and performing duplication removal to obtain an effective word set;
determining a numerical representation of valid words contained in the set of valid words;
and determining a first word vector mapped by the theme name according to a first array formed by the numerical representations of the effective words contained in the theme name, and determining a second word vector mapped by the image description information according to a second array formed by the numerical representations of the effective words contained in the image description information.
It should be noted that, the vector dimension of the first word vector and the second word vector is determined by the number of valid words contained in the valid word set, and the vector dimension is consistent with the number of valid words. In addition, in the implementation, the valid words with similar or similar semantics can be corresponding to the same vector dimension, and corresponding weights are given to the valid words or corresponding values are set according to the number of the valid words corresponding to each vector dimension.
For example, the title of a news page is: "beautiful scene is generated by a certain city-xx scenic spot due to climate, and tourists are led to watch"; two images are arranged in the news page, and text description (image description information) corresponding to the image A is as follows: "xx scenery region", i.e. image a is the image of the displayed xx scenery region; the image description information corresponding to the image B is as follows: the masses take a photo by taking a camera at the lake water where the beauty is located, and the image B shows the scene of taking a photo by taking a camera at the lake water where the beauty is located; the three texts are segmented, duplicate removal and invalid words are removed, and total effective words in the obtained effective word set are 15: "certain city, xx scenic spot, climate, production, beauty, scene, tourist, ornamental, masses, surrounding, beauty, lake water, holding, mobile phone, photographing". Mapping the three texts into 15-dimensional vectors, wherein the title of the news page, "a beautiful scene is generated in a certain city-xx scenic spot due to weather, and the mapped word vector X for guiding tourists to view" is as follows: [1,1,1,1,1,1,1,1,1,0,0,0,0,0,0]; the word vector A1 mapped by the image description information "xx scenic spot" corresponding to the image A is: [0,1,0,0,0,0,0,0,0,0,0,0,0,0,0]; the word vector B1 mapped by the image description information 'mobile phone taking in lake water where the masses enclose the beautiful scenery' corresponding to the image B is as follows: [0,0,0,0,0,0,0,0,1,1,1,1,1,1,1] assuming that a word vector model exists, then the word vector with semantic meaning is obtained by replacing the current 1 with index of the word corresponding to 1 in the current word vector in the word vector model.
(2) And calculating the vector distance between the first word vector and the second word vector to obtain the semantic similarity between the image description information of the image and the topic name of the application page or the webpage where the image description information is located.
Here, the vector distance between the first word vector and the second word vector is calculated, so that in the case that the image has a text description, the vector distance between the first word vector and the second word vector is calculated through a similarity algorithm, that is: and calculating the semantic similarity between the image description information of the image and the topic name of the application page or the webpage where the image description information is located through a similarity algorithm. In specific implementation, a similarity algorithm such as cosine Distance, EMD (Earth Mover's Distance), jaccard similarity coefficient, hamming Distance, euclidean Distance or mahalanobis Distance can be used to calculate the vector Distance between the first word vector and the second word vector, so as to obtain the semantic similarity between the image description information of the image and the topic name of the application page or the web page where the image description information is located. In practical application, one of the similarity algorithms can be selected to calculate the vector distance according to practical needs, and in addition, other similarity algorithms besides the similarity algorithms can be selected to calculate the vector distance, so that the semantic similarity between the image description information of the image and the topic name of the application page or the webpage where the image description information is located is obtained.
Preferably, after the semantic similarity between the image description information of the image and the topic name of the application page or the webpage where the image description information is located is calculated and obtained, the semantic similarity obtained by calculation can be normalized. For example, the semantic similarity calculation result of the word vector A1 mapped by the image description information "xx scenic spot" corresponding to the image a and the word vector X mapped by the headline of the news page is A1, the semantic similarity calculation result of the word vector A1 mapped by the image description information corresponding to the image B and the word vector X mapped by the headline of the news page is B1, and the normalized semantic similarity calculation result is sequentially: a1/(a1+b1), b 1/(a1+b1).
Similar to the above embodiment, in implementation, the relevance between the image and the application page or the web page can be determined according to other information besides the theme name of the application page or the web page and other attribute information besides the image description information of the image included in the application page or the web page. For example, according to the text content of the application page or the webpage and the label and/or the keyword of the image, the relativity of the image and the application page or the webpage where the image is positioned is determined by determining the semantic similarity of the text content and the label and/or the keyword. Or according to the text content of the application page or the webpage and the image description information of the image, determining the relativity of the image and the application page or the webpage where the image is positioned by determining the semantic similarity of the text content and the image description information. And determining the relativity of the image and the application page or the webpage page where the image is positioned by determining the semantic similarity of the theme name and the label and/or the keyword according to the theme name of the application page or the webpage page and the label and/or the keyword of the image.
In practical application, the process of calculating the semantic similarity between the image description information of the image and the topic name of the application page or the webpage where the image description information is located can be realized through a pre-constructed similarity calculation model, model training is performed in advance through a large number of news pages, blog pages or advertisement pages and the like, after training of the similarity calculation model is completed, only the image description information corresponding to the image A and the image B and the headline of the news pages need to be input into the similarity calculation model, mapping from the image description information and the news headline to word vectors is performed by the similarity calculation model, and the semantic similarity between the image description information corresponding to the image A and the image B and the headline of the news pages is calculated according to a similarity algorithm configured by the similarity calculation model, and finally normalized semantic similarity is output. In addition, the calculation parameters of the similarity calculation model can be optimized in the calculation process, so that the semantic similarity obtained by calculation is more accurate.
Step S103, extracting the image with the correlation degree meeting the preset extraction condition as a main image of the object to be extracted.
In a preferred implementation manner provided by the embodiment of the present application, the extracting of the image with the correlation degree meeting the preset extraction condition as the main map of the application page or the web page is implemented in the following manner:
(1) Determining weighted sums of the semantic similarity, the size of the image and the sequence position and the respective corresponding weights;
the weighting purpose is to more comprehensively consider the factors influencing the image in the application page or the webpage to become the main graph, and corresponding weights are given to the factors influencing the image in the application page or the webpage to become the main graph, so that the correlation degree between the image and the application page or the webpage where the image is located is more comprehensive and more accurate under the action of the weights. In this embodiment, in addition to considering semantic similarity, both the size of the image and the sequential position L are also used as influencing factors of the image, where the weight of the sequential position L is w l The weight of the size F is w f The weight of the semantic similarity S is w s The formula for the weighted sum W of the images is: w=l×w l +F*w f +S*w s
It should be noted that, when calculating the weighted sum, the semantic similarity S corresponding to the image is the value after normalization; similarly, the size F of an image refers to a value after normalization, and specifically can be normalized by dividing the size of each image by the maximum value of the image size. For example, if the size of the image a is 300 pixels by 500 pixels and the size of the image B is 400 pixels by 400 pixels, the normalized value of the size of the image a is: (300×500)/(400×400), the normalized values of the size of image B are: (400*400)/(400*400).
(2) Sorting the images in the application page or the webpage in a descending order according to the determined weighted sum;
(3) Extracting at least one image from the sequenced images to be used as a main image of an application page or a webpage page;
the semantic similarity between the image description information of the main graph and the theme name is larger than that between the image description information of the non-extracted image and the theme name.
Therefore, the implementation mode of extracting the main graph of the application page or the webpage through weighted sequencing not only considers the relevance of the image and the application page or the webpage where the image is located from the aspect of content, but also considers the influence of the size and the sequence position of the image, so that the main graph of the application page or the webpage which is finally extracted is more representative and more accurate, and the display effect on a user is better.
In another implementation manner provided by the embodiment of the present application, the image with the correlation degree meeting the preset extraction condition is extracted as the main diagram of the application page or the web page through the following implementation manner: sorting images in the application page or the webpage in a descending order according to the semantic similarity; extracting at least one image from the sequenced images to be used as a main image of an application page or a webpage page; the semantic similarity between the image description information of the main graph and the theme name is larger than that between the image description information of the non-extracted image and the theme name.
In summary, in the main graph extraction method, in the process of extracting the main graph of the application page or the webpage, the feature information of the image contained in the application page or the webpage is obtained, the correlation between the image and the application page or the webpage where the image is located is determined on the content level based on the feature information, and finally the main graph of the application page or the webpage is extracted according to the correlation between the image and the application page or the webpage where the image is located, so that the main graph extraction is realized on the content level, the adaptability is higher, and the accuracy is higher.
The embodiment of the application provides a main graph extraction device, which comprises the following steps:
in the foregoing embodiments, a main image extraction method is provided, and correspondingly, the present application also provides a main image extraction device, which is described below with reference to the accompanying drawings.
Referring to fig. 2, a schematic diagram of an embodiment of a main image extraction device provided by the application is shown.
Since the apparatus embodiments are substantially similar to the method embodiments, the description is relatively simple, and reference should be made to the corresponding descriptions of the method embodiments provided above for relevant parts. The device embodiments described below are merely illustrative.
The application provides a main graph extraction device, comprising:
a feature information obtaining unit 201, configured to obtain feature information of an image included in an object to be extracted;
a correlation determination unit 202 configured to determine a correlation between the image and the object to be extracted based on the feature information;
a main image extracting unit 203, configured to extract, as a main image of the object to be extracted, the image whose correlation meets a preset extraction condition.
Optionally, the feature information includes at least one of the following: image description information, location, size, labels, keywords, and sequence identification.
Optionally, the relevance determining unit 202 is specifically configured to determine, according to the image description information and the topic name of the object to be extracted, the semantic similarity between the image description information and the topic name.
Optionally, the correlation determining unit 202 includes:
a word vector determining subunit, configured to determine a first word vector mapped by a topic name of the object to be extracted and a second word vector mapped by image description information of the image;
the semantic similarity calculating subunit is used for calculating the vector distance between the first word vector and the second word vector as the semantic similarity between the image and the resource to be extracted.
Optionally, the word vector determining subunit includes:
the word segmentation subunit is used for segmenting the theme name and the image description information;
the de-duplication filtering subunit is used for removing invalid words contained in the word set obtained after word segmentation and de-duplication to obtain an effective word set;
a numerical representation determination subunit configured to determine a numerical representation of a valid word included in the valid word set;
and the word vector mapping subunit is used for determining a first word vector mapped by the theme name according to a first array formed by the numerical representations of the effective words contained in the theme name, and determining a second word vector mapped by the image description information according to a second array formed by the numerical representations of the effective words contained in the image description information.
Optionally, a vector dimension of the first word vector and the second word vector is determined by a number of valid words contained in the valid word set, and the vector dimension is consistent with the number of valid words.
Optionally, the main graph extracting unit 203 includes:
a weighted sum determining subunit, configured to determine a weighted sum of the semantic similarity, the size of the image, and the sequential position and the respective corresponding weights;
A sorting subunit, configured to sort the images contained in the object to be extracted in descending order according to the determined weighted sum;
an extraction subunit, configured to extract at least one image from the ordered images as a main image of the object to be extracted;
the semantic similarity between the image description information of the main graph and the theme name is larger than that between the image description information of the non-extracted image and the theme name.
Optionally, the main map extracting device includes:
and the normalization unit is used for normalizing the semantic similarity between the image description information and the theme name.
Optionally, the main graph extracting unit 203 includes:
a descending order sorting subunit, configured to sort images included in the object to be extracted in descending order according to the semantic similarity;
a main image extraction subunit, configured to extract at least one image from the ordered images as a main image of the object to be extracted;
the semantic similarity between the image description information of the main graph and the theme name is larger than that between the image description information of the non-extracted image and the theme name.
Optionally, the main map extracting device includes:
the extraction device comprises an extraction object information acquisition unit, a text extraction unit and a text extraction unit, wherein the extraction object information acquisition unit is used for acquiring the theme name of the extraction object and the text content of the extraction object.
Optionally, the main map extracting device includes:
a first feature information determining unit, configured to determine whether feature information of the image meets a preset feature threshold, if yes, operate the relevance determining unit 202; if not, operating an image rejection unit; the image eliminating unit is used for eliminating the image from the image contained in the object to be extracted.
Optionally, the main map extracting device includes:
the second characteristic information judging unit is used for judging whether the acquired characteristic information of the image is empty or not, and if yes, the preset reference characteristic is set as the characteristic information of the image; and if not, operating the first characteristic information judging unit.
An embodiment of a readable storage medium provided by the present application is as follows:
in the above-described embodiments, a main map extraction method is provided, and in addition, the present application also provides a readable storage medium for implementing the main map extraction method. The embodiment of the readable storage medium provided by the application is described more simply, and the relevant parts are just referred to the corresponding description of the embodiment of the main graph extraction method provided above. The embodiments described below are merely illustrative.
The present application provides a readable storage medium having instructions stored thereon that are executable to:
acquiring characteristic information of an image contained in an object to be extracted;
determining the relevance of the image and the object to be extracted based on the characteristic information;
and extracting the image with the correlation degree meeting the preset extraction condition as a main image of the object to be extracted.
Optionally, the feature information includes at least one of the following: image description information, location, size, labels, keywords, and sequence identification.
Optionally, the determining the relevance between the image and the object to be extracted based on the feature information is implemented in the following manner:
and determining the semantic similarity of the image description information and the theme name according to the image description information and the theme name of the object to be extracted contained in the feature information.
Optionally, the determining, according to the image description information and the topic name of the object to be extracted included in the feature information, the semantic similarity between the image description information and the topic name includes:
determining a first word vector mapped by the theme name of the object to be extracted and a second word vector mapped by the image description information of the image;
And calculating the vector distance between the first word vector and the second word vector as the semantic similarity between the image and the resource to be extracted.
Optionally, the first word vector mapped by the subject name of the object to be extracted and the second word vector mapped by the image description information of the image are determined in the following manner:
word segmentation is carried out on the theme name and the image description information;
removing invalid words contained in the word set obtained after word segmentation and performing duplication removal to obtain an effective word set;
determining a numerical representation of valid words contained in the set of valid words;
and determining a first word vector mapped by the theme name according to a first array formed by the numerical representations of the effective words contained in the theme name, and determining a second word vector mapped by the image description information according to a second array formed by the numerical representations of the effective words contained in the image description information.
Optionally, a vector dimension of the first word vector and the second word vector is determined by a number of valid words contained in the valid word set, and the vector dimension is consistent with the number of valid words.
Optionally, the extracting the image with the correlation degree meeting the preset extraction condition is implemented as a main graph of the object to be extracted by adopting the following manner:
Determining weighted sums of the semantic similarity, the size of the image and the sequence position and the respective corresponding weights;
sorting the images contained in the object to be extracted in a descending order according to the determined weighted sum;
extracting at least one image from the ordered images as a main image of the object to be extracted;
the semantic similarity between the image description information of the main graph and the theme name is larger than that between the image description information of the non-extracted image and the theme name.
Optionally, before the step of determining the weighted sum instruction of the semantic similarity, the size and the sequential position of the image and the weights corresponding to the three steps is performed, the following instruction is executed:
and normalizing the semantic similarity of the image description information and the theme name.
Optionally, the extracting the image with the correlation degree meeting the preset extraction condition is implemented as a main graph of the object to be extracted by adopting the following manner:
sorting images contained in the object to be extracted in a descending order according to the semantic similarity;
extracting at least one image from the ordered images as a main image of the object to be extracted;
The semantic similarity between the image description information of the main graph and the theme name is larger than that between the image description information of the non-extracted image and the theme name.
Optionally, before the determining, according to the image description information and the topic name of the object to be extracted included in the feature information, the following instructions are executed before the executing of the semantic similarity instruction of the image description information and the topic name:
and acquiring the theme name of the object to be extracted and the text content of the object to be extracted.
Optionally, after the executing of the feature information instruction for acquiring the image included in the object to be extracted and before the executing of the relevance instruction for determining the image and the object to be extracted based on the feature information, the following instructions are executed:
judging whether the characteristic information of the image meets a preset characteristic threshold value or not, if so, executing the correlation degree instruction for determining the image and the object to be extracted based on the characteristic information; if not, the image is removed from the image contained in the object to be extracted.
Optionally, after the executing of the feature information instruction for acquiring the image included in the object to be extracted and before the executing of the relevance instruction for determining the image and the object to be extracted based on the feature information, the following instructions are executed:
Judging whether the acquired characteristic information of the image is empty or not, if so, setting a preset reference characteristic as the characteristic information of the image; and if not, executing the judgment whether the characteristic information of the image meets a preset characteristic threshold instruction.
While the application has been described in terms of preferred embodiments, it is not intended to be limiting, but rather, it will be apparent to those skilled in the art that various changes and modifications can be made herein without departing from the spirit and scope of the application as defined by the appended claims.
In one typical configuration, a computing device includes one or more processors, input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer readable media, as defined herein, does not include non-transitory computer readable media (transmission media), such as modulated data signals and carrier waves.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (13)

1. A method for extracting a main map, comprising:
acquiring characteristic information of an image contained in an object to be extracted;
determining the relativity of the image and the object to be extracted based on the characteristic information, wherein the relativity is determined according to image description information contained in the characteristic information and the semantic similarity of the theme name of the object to be extracted, the semantic similarity is determined according to the vector distance between a first word vector mapped by the theme name of the object to be extracted and a second word vector mapped by the image description information of the image, and the vector dimensions of the first word vector and the second word vector are determined by the number of effective words contained in an effective word set;
Extracting an image with the correlation degree meeting a preset extraction condition as a main image of the object to be extracted;
the method comprises the steps of extracting a first word vector mapped by a theme name of an object to be extracted and a second word vector mapped by image description information of an image, wherein the first word vector mapped by the theme name of the object to be extracted and the second word vector mapped by the image description information of the image are determined in the following mode: word segmentation is carried out on the theme name and the image description information; removing invalid words contained in the word set obtained after word segmentation and performing duplication removal to obtain the valid word set; determining a numerical representation of valid words contained in the set of valid words; and determining a first word vector mapped by the theme name according to a first array formed by the numerical representations of the effective words contained in the theme name, and determining a second word vector mapped by the image description information according to a second array formed by the numerical representations of the effective words contained in the image description information.
2. The main map extraction method according to claim 1, characterized in that the feature information further includes at least one of:
location, size, label, keyword, and order identification.
3. The method of claim 1, wherein the vector dimension corresponds to the number of valid words.
4. The method for extracting a main graph according to any one of claims 1, wherein the extracting the image with the correlation degree meeting a preset extraction condition is implemented as the main graph of the object to be extracted by:
determining weighted sums of the semantic similarity, the size of the image and the sequence position and the respective corresponding weights;
sorting the images contained in the object to be extracted in a descending order according to the determined weighted sum;
extracting at least one image from the ordered images as a main image of the object to be extracted;
the semantic similarity between the image description information of the main graph and the theme name is larger than that between the image description information of the non-extracted image and the theme name.
5. The method according to claim 4, wherein before the step of determining the weighted sum of the semantic similarity, the size of the image, and the sequential position with the respective weights is performed, the following operations are performed:
and normalizing the semantic similarity of the image description information and the theme name.
6. The method for extracting a main graph according to claim 1, wherein the extracting the image with the correlation degree meeting a preset extraction condition is implemented as the main graph of the object to be extracted by:
Sorting images contained in the object to be extracted in a descending order according to the semantic similarity;
extracting at least one image from the ordered images as a main image of the object to be extracted;
the semantic similarity between the image description information of the main graph and the theme name is larger than that between the image description information of the non-extracted image and the theme name.
7. The method according to claim 1, wherein before the sub-step of determining semantic similarity between the image description information and the subject name of the object to be extracted according to the image description information and the subject name contained in the feature information is performed, the following operations are performed:
and acquiring the theme name of the object to be extracted and the text content of the object to be extracted.
8. The main map extraction method according to any one of claims 1 to 7, wherein after the step of obtaining the feature information of the image included in the object to be extracted is performed, and before the step of determining the correlation between the image and the object to be extracted based on the feature information is performed, the following operations are performed:
Judging whether the characteristic information of the image meets a preset characteristic threshold value or not, if so, executing the step of determining the relativity of the image and the object to be extracted based on the characteristic information; if not, the image is removed from the image contained in the object to be extracted.
9. The method according to claim 8, wherein after the step of obtaining the feature information of the image included in the object to be extracted is performed, and before the step of determining the correlation between the image and the object to be extracted based on the feature information is performed, the following operations are performed:
judging whether the acquired characteristic information of the image is empty or not, if so, setting a preset reference characteristic as the characteristic information of the image; and if not, executing the step of judging whether the characteristic information of the image meets the preset characteristic threshold value.
10. A main drawing extraction device, characterized by comprising:
the characteristic information acquisition unit is used for acquiring characteristic information of an image contained in the object to be extracted;
a relevance determining unit, configured to determine, based on the feature information, a relevance between the image and the object to be extracted, where the relevance is determined according to image description information included in the feature information and a semantic similarity of a topic name of the object to be extracted, the semantic similarity is determined according to a vector distance between a first word vector mapped by the topic name of the object to be extracted and a second word vector mapped by the image description information of the image, and vector dimensions of the first word vector and the second word vector are determined by a number of valid words included in an active word set;
The main image extraction unit is used for extracting the image with the correlation degree meeting the preset extraction condition as the main image of the object to be extracted;
the method comprises the steps of extracting a first word vector mapped by a theme name of an object to be extracted and a second word vector mapped by image description information of an image, wherein the first word vector mapped by the theme name of the object to be extracted and the second word vector mapped by the image description information of the image are determined in the following mode: word segmentation is carried out on the theme name and the image description information; removing invalid words contained in the word set obtained after word segmentation and performing duplication removal to obtain the valid word set; determining a numerical representation of valid words contained in the set of valid words; and determining a first word vector mapped by the theme name according to a first array formed by the numerical representations of the effective words contained in the theme name, and determining a second word vector mapped by the image description information according to a second array formed by the numerical representations of the effective words contained in the image description information.
11. The main map extraction apparatus according to claim 10, wherein the feature information further includes at least one of:
location, size, label, keyword, and order identification.
12. The main map extraction apparatus according to claim 10, wherein the correlation determination unit includes:
A word vector determining subunit, configured to determine a first word vector mapped by a topic name of the object to be extracted and a second word vector mapped by image description information of the image;
the semantic similarity calculating subunit is used for calculating the vector distance between the first word vector and the second word vector as the semantic similarity between the image and the object to be extracted.
13. A readable storage medium having instructions stored thereon that are executable to:
acquiring characteristic information of an image contained in an object to be extracted;
determining the relativity of the image and the object to be extracted based on the characteristic information, wherein the relativity is determined according to image description information contained in the characteristic information and the semantic similarity of the theme name of the object to be extracted, the semantic similarity is determined according to the vector distance between a first word vector mapped by the theme name of the object to be extracted and a second word vector mapped by the image description information of the image, and the vector dimensions of the first word vector and the second word vector are determined by the number of effective words contained in an effective word set;
extracting an image with the correlation degree meeting a preset extraction condition as a main image of the object to be extracted;
The method comprises the steps of extracting a first word vector mapped by a theme name of an object to be extracted and a second word vector mapped by image description information of an image, wherein the first word vector mapped by the theme name of the object to be extracted and the second word vector mapped by the image description information of the image are determined in the following mode: word segmentation is carried out on the theme name and the image description information; removing invalid words contained in the word set obtained after word segmentation and performing duplication removal to obtain the valid word set; determining a numerical representation of valid words contained in the set of valid words; and determining a first word vector mapped by the theme name according to a first array formed by the numerical representations of the effective words contained in the theme name, and determining a second word vector mapped by the image description information according to a second array formed by the numerical representations of the effective words contained in the image description information.
CN201710969326.9A 2017-10-18 2017-10-18 Main graph extraction method and device Active CN109685085B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710969326.9A CN109685085B (en) 2017-10-18 2017-10-18 Main graph extraction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710969326.9A CN109685085B (en) 2017-10-18 2017-10-18 Main graph extraction method and device

Publications (2)

Publication Number Publication Date
CN109685085A CN109685085A (en) 2019-04-26
CN109685085B true CN109685085B (en) 2023-09-26

Family

ID=66183277

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710969326.9A Active CN109685085B (en) 2017-10-18 2017-10-18 Main graph extraction method and device

Country Status (1)

Country Link
CN (1) CN109685085B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006022028A1 (en) * 2004-08-27 2006-03-02 Seiko Epson Corporation Image reproduction using particular color space
CN104063489A (en) * 2014-07-04 2014-09-24 百度在线网络技术(北京)有限公司 Method and device for determining webpage image relevancy and displaying retrieved result
CN104123363A (en) * 2014-07-21 2014-10-29 北京奇虎科技有限公司 Method and device for extracting main image of webpage
CN105224521A (en) * 2015-09-28 2016-01-06 北大方正集团有限公司 Key phrases extraction method and use its method obtaining correlated digital resource and device
CN106777143A (en) * 2016-12-19 2017-05-31 北京麒麟合盛网络技术有限公司 A kind of news Aggreagation method and news Aggreagation server
CN106776881A (en) * 2016-11-28 2017-05-31 中国科学院软件研究所 A kind of realm information commending system and method based on microblog
CN107066596A (en) * 2017-04-19 2017-08-18 北京小米移动软件有限公司 The method and apparatus for generating link information

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9092425B2 (en) * 2010-12-08 2015-07-28 At&T Intellectual Property I, L.P. System and method for feature-rich continuous space language models
US9342991B2 (en) * 2013-03-14 2016-05-17 Canon Kabushiki Kaisha Systems and methods for generating a high-level visual vocabulary
US9984309B2 (en) * 2015-09-30 2018-05-29 International Business Machines Corporation Classifying and grouping electronic images
US9811765B2 (en) * 2016-01-13 2017-11-07 Adobe Systems Incorporated Image captioning with weak supervision
US9792534B2 (en) * 2016-01-13 2017-10-17 Adobe Systems Incorporated Semantic natural language vector space

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006022028A1 (en) * 2004-08-27 2006-03-02 Seiko Epson Corporation Image reproduction using particular color space
CN104063489A (en) * 2014-07-04 2014-09-24 百度在线网络技术(北京)有限公司 Method and device for determining webpage image relevancy and displaying retrieved result
CN104123363A (en) * 2014-07-21 2014-10-29 北京奇虎科技有限公司 Method and device for extracting main image of webpage
CN105224521A (en) * 2015-09-28 2016-01-06 北大方正集团有限公司 Key phrases extraction method and use its method obtaining correlated digital resource and device
CN106776881A (en) * 2016-11-28 2017-05-31 中国科学院软件研究所 A kind of realm information commending system and method based on microblog
CN106777143A (en) * 2016-12-19 2017-05-31 北京麒麟合盛网络技术有限公司 A kind of news Aggreagation method and news Aggreagation server
CN107066596A (en) * 2017-04-19 2017-08-18 北京小米移动软件有限公司 The method and apparatus for generating link information

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
郑献,卫张贺.LDA主题抽取模型在互联网旅游评论的应用.工业控制计算机.2014,第27卷(第09期),全文. *
陈枝楠.《供港食品全程溯源与实时监控关键技术及其应用》.中国科学技术大学出版社,2017,第187-189页. *

Also Published As

Publication number Publication date
CN109685085A (en) 2019-04-26

Similar Documents

Publication Publication Date Title
US20210103779A1 (en) Mobile image search system
CN111062871B (en) Image processing method and device, computer equipment and readable storage medium
JP5615932B2 (en) Search method and system
CN106294798A (en) A kind of images share method based on thumbnail and terminal
JP5524219B2 (en) Interactive image selection method
US20220383053A1 (en) Ephemeral content management
US20140250110A1 (en) Image attractiveness based indexing and searching
CN109829108B (en) Information recommendation method and device, electronic equipment and readable storage medium
EP3109775A1 (en) Multimedia content providing method and device
JP2018501579A (en) Semantic representation of image content
CN110019669B (en) Text retrieval method and device
US10853417B2 (en) Generating a platform-based representative image for a digital video
US10990807B2 (en) Selecting representative recent digital portraits as cover images
CN115496820A (en) Method and device for generating image and file and computer storage medium
US20220083587A1 (en) Systems and methods for organizing an image gallery
CN109685085B (en) Main graph extraction method and device
CN111160445A (en) Bid document similarity calculation method and device
CN113139110B (en) Regional characteristic processing method, regional characteristic processing device, regional characteristic processing equipment, storage medium and program product
JP5216887B2 (en) How to provide the latest information
CN106776654B (en) Data searching method and device
CN111914199A (en) Page element filtering method, device, equipment and storage medium
CN112765340A (en) Method and device for determining cloud service resources, electronic equipment and storage medium
CN113743432A (en) Image entity information acquisition method, device, electronic device and storage medium
CN117556079B (en) Remote sensing image content retrieval method, remote sensing image content retrieval device, electronic equipment and medium
CN113407714B (en) Aging-based data processing method and device, electronic 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
GR01 Patent grant
GR01 Patent grant