CN111291738A - Element extraction method and device in front-end page image and electronic equipment - Google Patents

Element extraction method and device in front-end page image and electronic equipment Download PDF

Info

Publication number
CN111291738A
CN111291738A CN202010384142.8A CN202010384142A CN111291738A CN 111291738 A CN111291738 A CN 111291738A CN 202010384142 A CN202010384142 A CN 202010384142A CN 111291738 A CN111291738 A CN 111291738A
Authority
CN
China
Prior art keywords
image
text
end page
determining
content data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010384142.8A
Other languages
Chinese (zh)
Inventor
谢杨易
崔恒斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202010384142.8A priority Critical patent/CN111291738A/en
Publication of CN111291738A publication Critical patent/CN111291738A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/413Classification of content, e.g. text, photographs or tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Character Input (AREA)

Abstract

One or more embodiments of the application provide a method and a device for extracting elements in a front-end page image and an electronic device. The method comprises the steps of responding to an element extraction instruction, inputting received image data of a target front-end page image into an element detection model for calculation, and obtaining element image data corresponding to elements included in the target front-end page image. The element type of the above-mentioned element is determined. And if the element is a text element, further determining the text content data of the text element, and storing the text content data to finish the element extraction aiming at the target front page image.

Description

Element extraction method and device in front-end page image and electronic equipment
Technical Field
The present application relates to the field of computer network technologies, and in particular, to a method and an apparatus for extracting elements from front-end page images, and an electronic device.
Background
In the front-end page development work, when a developer receives a front-end page image designed by a page image designer, it is necessary to extract page elements included in the front-end page image, and then construct a front-end page based on the extracted page elements.
Currently, when extracting page elements included in a front-end page image, a developer generally needs to extract the page elements through manual operation. Therefore, when extracting page elements, the problems of low extraction efficiency, high cost, high error rate and the like occur.
Disclosure of Invention
The application provides a method for extracting elements in a front-end page image. The method comprises the following steps:
in response to an element extraction instruction, inputting the received image data of the target front-end page image into an element detection model for calculation to obtain element image data corresponding to elements included in the target front-end page image;
determining an element type of the element based on the element image data;
and if the element is a text element, further determining the text content data of the text element, and storing the text content data to finish the element extraction aiming at the target front page image.
In an embodiment, the method further includes:
and if the element is an image element, storing element image data corresponding to the image element, generating a corresponding download address based on the address for storing the element image data, and storing the download address to finish element extraction for the target front-end page image.
In an embodiment, the determining the element type of the element includes:
performing OCR recognition on the element image data corresponding to the element to obtain a recognition result corresponding to the element;
determining whether the recognition confidence included in the recognition result reaches a preset threshold value;
if so, determining the element type of the element as a text element.
If not, determining the element type of the element as an image element.
In an embodiment, the determining the text content data of the text element further includes:
acquiring character content data included in the identification result;
and determining the acquired text content data as the text content data of the text element.
In an embodiment, the determining the element type of the element includes:
inputting element image data corresponding to the elements into a pre-trained classifier for calculation, and determining the element types of the elements based on the calculation result; the classifier is obtained by training on the basis of a plurality of element image samples marked with element types; the element types include an image element or a text element.
In an embodiment, the determining the text data of the text element further includes:
performing OCR recognition on the element image data corresponding to the elements to obtain character content data;
and determining the text content data as the text content data of the text element.
In an embodiment shown, the element detection model is a detection model constructed based on a deep neural network.
The application provides a front-end page construction method. The method comprises the following steps:
in response to an element extraction instruction, inputting the received image data of the target front-end page image into an element detection model for calculation to obtain element image data corresponding to elements included in the target front-end page image;
determining an element type of the element based on the element image data;
if the element is a text element, further determining the text content data of the text element, and storing the text content data to complete element extraction aiming at the target front page image;
if the element is an image element, storing element image data corresponding to the image element, generating a corresponding download address based on an address for storing the element image data, and storing the download address to complete element extraction for the target front-end page image;
and constructing a front-end page corresponding to the target front-end page image based on the stored download address of the image element and the text content data of the text element.
Correspondingly, the application also provides an element extraction device in the front-end page image. The above-mentioned device includes:
the computing module responds to the element extraction instruction, inputs the received image data of the target front-end page image into the element detection model for computing, and obtains element image data corresponding to elements included in the target front-end page image;
the determining module is used for determining the element type of the element;
and the first storage module is used for further determining the character content data of the text element if the element is the text element and storing the character content data so as to finish the element extraction aiming at the target front-end page image.
In an embodiment, the apparatus further includes:
and the second storage module is used for storing element image data corresponding to the image elements if the elements are the image elements, generating corresponding download addresses based on the addresses for storing the element image data, and storing the download addresses to finish element extraction of the target front-end page image.
In an embodiment, the determining module includes:
performing OCR recognition on the element image data corresponding to the element to obtain a recognition result corresponding to the element;
determining whether the recognition confidence included in the recognition result reaches a preset threshold value;
if so, determining the element type of the element as a text element.
If not, determining the element type of the element as an image element.
In an embodiment, the first storage module includes:
acquiring character content data included in the identification result;
and determining the acquired text content data as the text content data of the text element.
In an embodiment, the determining module includes:
inputting element image data corresponding to the elements into a pre-trained classifier for calculation, and determining the element types of the elements based on the calculation result; the classifier is obtained by training on the basis of a plurality of element image samples marked with element types; the element types include an image element or a text element.
In an embodiment, the first storage module includes:
performing OCR recognition on the element image data corresponding to the elements to obtain character content data;
and determining the text content data as the text content data of the text element.
In an embodiment shown, the element detection model is a detection model constructed based on a deep neural network.
The application also provides a front-end page constructing device. The above-mentioned device includes:
the element extraction module in the front-end page image responds to an element extraction instruction, inputs the received image data of the target front-end page image into an element detection model for calculation, and obtains element image data corresponding to elements included in the target front-end page image;
determining the element type of the element;
if the element is a text element, further determining the text content data of the text element, and storing the text content data to complete element extraction aiming at the target front page image;
if the element is an image element, storing element image data corresponding to the image element, generating a corresponding download address based on an address for storing the element image data, and storing the download address to complete element extraction for the target front-end page image;
and the construction module is used for constructing a front-end page corresponding to the target front-end page image based on the stored download address of the image element and the text content data of the text element.
According to the technical scheme, on one hand, after the element extraction instruction is received, the received image data of the target front-end page image can be input into the element detection model to be calculated in response to the element extraction instruction, so that the element image data corresponding to the element included in the target front-end page image is obtained, and then the element is stored according to the element type of the element, so that the element can be efficiently, accurately and inexpensively extracted from the designed front-end page image, and the problems of low extraction efficiency, high cost, high error rate and the like caused by manual participation are solved.
On the other hand, when the front-end page is constructed, after the elements are extracted from the target page image, the front-end page can be constructed based on the extracted elements, so that the construction efficiency and the construction accuracy of the front-end page can be improved.
Drawings
FIG. 1 is a flowchart of a method for extracting elements from a front-end page image according to the present application;
fig. 2 is a schematic method flow diagram of a front-end page construction method shown in the present application;
FIG. 3 is a flow chart of a method for extracting elements shown in the present application;
fig. 4 is a block diagram of an element extraction apparatus in a front-end page image shown in the present application;
FIG. 5 is a block diagram of a front end page construction apparatus shown in the present application;
fig. 6 is a hardware configuration diagram of an element extraction device in a front-end page image according to the present application;
fig. 7 is a hardware configuration diagram of a front-end page building device according to the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It should also be understood that the word "if" as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
The application aims to provide an element extraction method in a front-end page image, and when the front-end page image extracts page elements, a page element extraction system realizes segmentation and extraction aiming at the page elements included in the front-end page image, so that the problems of low extraction efficiency, high cost, high error rate and the like caused by manual participation are solved.
The technical solutions disclosed in the present application are described below with reference to specific examples.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for extracting elements from a front-end page image according to the present application. The method is applied to a page element extraction system. As shown in fig. 1, the method includes:
s102, responding to an element extraction instruction, inputting the received image data of the target front-end page image into an element detection model for calculation, and obtaining element image data corresponding to elements included in the target front-end page image.
And S104, determining the element type of the element based on the element image data.
And S106, if the element is a text element, further determining the text content data of the text element, and storing the text content data to finish the element extraction aiming at the target front page image.
The page element extraction system (hereinafter, referred to as "system") may be specifically a piece of logic code loaded in the terminal device. When the above-described element extraction method is executed as an execution subject, the above-described page element extraction system needs to provide computing power through a terminal device mounted thereon.
In practical application, the system can provide an interactive platform for interaction with developers. Through the interactive platform, on one hand, a developer can provide a front-end page image of a page element to be extracted to the system and initiate a related instruction for extracting the page element to the system; on the other hand, after the page elements are extracted, the system can output the extracted page elements to the developer.
The front-end page image is specifically a page image designed by a page image designer. In practical situations, when a developer develops a front-end page, the developer usually needs to refer to a page image designed by a page image designer to develop the front-end page, so that the finally developed front-end page can have the same display effect as the page image.
The above elements are, specifically, front-end page elements (hereinafter referred to as "elements"). The above elements are main components constituting the front page, and may include picture elements and text elements.
In practical application, when a front-end page needs to be constructed, the corresponding position of each element on the front-end page needs to be determined according to the coordinate position of each element on the page image and the size of the space occupied by each element on the front-end page. After determining that each element is located in the front page, the specific content of each element may be added to the determined location, so as to exhibit the corresponding effect of the page image.
Here, it should be noted that, when the element types of the elements are different, the way of adding the specific contents of the elements to the front page is also different. When the element is a text element, when the specific content of the element is added, the text content data included in the text element may be added to the front page. When the element is an image element, a download address of the image element may be added to the front page when adding the specific content of the element. Of course, if the image elements are stored in a preset format (e.g., base64 format), the stored data in the format may be added to the front page.
The element extraction instruction is specifically a related instruction for causing the system to initiate element extraction.
In one case, the instruction may be initiated by a developer through an interactive platform with the system described above. For example, when a developer receives a page image designed by a page image designer, the page image may be provided to the system, and the system may be caused to start the extraction of elements by triggering a start extraction button.
In one case, the instruction may be a fetch instruction that is initiated by the system itself when it detects that a front-end page image for which element fetching is required is detected. For example, the system may set a section of monitoring program, and when it is monitored that the terminal device installed in the system receives the page image designed by the page image designer, the system automatically initiates an element extraction instruction.
When the system receives the element extraction instruction, the system may execute the step S102, and in response to the element extraction instruction, input the received image data of the target front-end page image into an element detection model for calculation, so as to obtain element image data corresponding to the elements included in the target front-end page image.
The image data specifically refers to image data stored in the terminal device of the target front-end page image. The storage format of the image data is not limited herein, as long as the element detection model can be input and calculated.
The element detection model may be a model that is capable of obtaining element image data corresponding to each element included in the target front-end page image by performing element image segmentation on the target front-end page image.
In practical applications, the element detection model may be a detection model constructed based on a neural network and/or a deep neural network. For example, the target detection model may be a mask rcnn, fasternn, SSD, YoLo, or the like model. In one aspect, the specific type of the element detection model used in the present application is not limited herein. On the other hand, the training process of the above element detection model is not described in the present application, and reference may be made to related art if necessary.
It will be appreciated that when developing the front-end page, the specific contents of the different types of elements are added to the front-end page in a different manner, and therefore the specific contents of the different types of elements are stored in a different manner. Thus, after obtaining the element image data corresponding to the elements included in the target front-end page image, the system may determine the element type of each element. Then, after the element type of each element is determined, the element type is stored for each element, so that the element extraction for the target front-end page image is completed.
In an embodiment, when determining the element type of an element, the system may perform OCR recognition on the element image data corresponding to the element to obtain a recognition result corresponding to the element, and then determine the element type of each element according to the recognition result.
Before describing the specific steps, the present application first introduces the principle of determining element types by OCR recognition.
An OCR (Optical Character Recognition) technology, specifically a technology for directly converting text contents on pictures and photos into editable texts. The principle is that the image characteristics of the target image are compared with the image characteristics of the Chinese characters in the existing Chinese character library, and the Chinese character which is most matched with the image characteristics of the target image is output as an identification result and the identification confidence of the identification result. The recognition confidence may indicate a degree of similarity between the image feature of the target image and the recognition result to some extent.
For example, if the target image includes a character content of "medium" character, since the target image includes exactly one character, the recognition confidence of the recognition result obtained after OCR detection is relatively high. However, assuming that the specific content included in the target image is a pattern similar to a chinese character, "middle", although the corresponding recognition result can be obtained after performing OCR recognition on the target image, the recognition confidence is relatively low because the specific content included in the target image is only the pattern similar to a chinese character.
It can be seen that, when the element type of the element is determined by means of OCR recognition, after OCR recognition is performed on an element image of the element, the element type of the element may be determined by determining whether a recognition confidence corresponding to the recognition result reaches a preset threshold. The preset threshold may be specifically set by a developer according to experience or trained through a large number of samples, and is not limited herein. When the recognition confidence reaches the preset threshold, determining that the element type of the element is a text element; otherwise, the element type of the element is determined to be the image element.
In practical applications, when S104 is executed, the system may perform OCR recognition on the element image data of the element obtained in S102 to obtain a corresponding recognition result and a recognition confidence corresponding to the recognition result.
After obtaining the recognition confidence, the system may compare the recognition confidence with a preset threshold to determine whether the recognition confidence reaches the preset threshold. If the recognition confidence reaches the preset threshold, determining that the element type of the element is a text element; otherwise, the element type of the element is determined to be the image element.
In one case, assuming that the element is determined to be a text element, the system may then execute S106, further determine the text content data of the text element, and store the text content data to complete the element extraction for the target front page image.
In this step, when the character content data of the text element is determined, the system may use the recognition result obtained by the OCR recognition as the character content data of the text element. After determining the textual content data for the text element, the system may store the textual content data to complete element extraction for the target front-end page image.
In practical applications, when the system stores the text content data, identification information corresponding to the text element may be determined, and then the correspondence between the text content data and the identification information may be stored locally or at a server.
At this time, when a developer develops a front page, the text content data of the text element may be acquired based on the identification information corresponding to the text element, and the text content data may be added to the front page, so that the text image may be displayed in the front page.
In another case, assuming that the element is determined to be an image element, the system may execute S106, store the element image data corresponding to the image element, and generate a corresponding download address based on an address where the element image data is stored. The system may then store the download address to complete element extraction for the target front-end page image.
In this step, if the element is an image element, the element image data corresponding to the image element may be stored in a local or server, and the storage address is mapped to the download address corresponding to the image element through a preset mapping algorithm. Then, the device may store a correspondence between the download address and identification information corresponding to the image element.
At this time, when a developer develops a front page, a download address of element image data of the image element may be acquired based on identification information corresponding to the image element, and the download address may be added to the front page, so that the element image may be displayed in the front page.
Of course, in one case, after determining that the element is an image element, the system may convert the element image data corresponding to the image element into a preset format for storage. For example, when the element is determined to be an image element, the system may convert the element image data corresponding to the image element into data in base64 format for storage. The device may then store the correspondence between the data in base64 format and the identification information corresponding to the image element.
In this case, when developing the front page, the developer may acquire data in base64 format corresponding to the image element based on the identification information corresponding to the image element, and add the data in base64 format to the front page, so that the element image may be displayed on the front page.
Therefore, the element extraction method in the front-end page image can efficiently, accurately and inexpensively extract elements from the designed front-end page image, so that the problems of low extraction efficiency, high cost, high error rate and the like caused by manual participation are solved.
In another embodiment, when determining the element type of an element, the system may input the image data of the element corresponding to the element into a pre-trained classifier for calculation, and determine the element type of the element based on the calculation result.
The classifier can be obtained by training based on a plurality of element image samples marked with element types; the element types include an image element or a text element.
It should be noted that the structure and type of the classifier are not limited herein. In one implementation, the classifier may be a binary classifier constructed based on a neural network.
At this time, if it is determined that the element is a text element, the system may perform OCR recognition on the element image data corresponding to the element to obtain the character content data.
After obtaining the text content data, the system may determine the text content data as text content data of the text element, and store the text content data.
At this time, if it is determined that the element is an image element, the element image data corresponding to the image element may be stored, a corresponding download address may be generated based on the address where the element image data is stored, and the download address may be stored to complete the element extraction for the target front-end page image (the specific storage method may refer to the above-mentioned contents, and will not be described in detail here).
In the embodiment described in the present application, for convenience of subsequent development of the front page, when extracting the element, information such as the coordinate position of the element in the page image and the size of the space occupied by the element in the front page may be extracted. No pixels are performed here.
According to the technical scheme, after the system receives the element extraction instruction, the system can respond to the element extraction instruction, input the received image data of the target front-end page image into the element detection model for calculation to obtain the element image data corresponding to the elements included in the target front-end page image, and then store the elements according to the element types of the elements, so that the elements can be efficiently, accurately and inexpensively extracted from the designed front-end page image, and the problems of low extraction efficiency, high cost, high error rate and the like caused by manual participation are solved.
Referring to fig. 2, fig. 2 is a schematic flow chart of a method for constructing a front-end page according to the present application.
As shown in fig. 2, the method may include:
s202, in response to an element extraction instruction, inputting the received image data of the target front-end page image into an element detection model for calculation to obtain element image data corresponding to elements included in the target front-end page image;
s204, determining the element type of the element based on the element image data;
s206, if the element is a text element, further determining the text content data of the text element, and storing the text content data to complete the element extraction of the target front page image;
s208, if the element is an image element, storing element image data corresponding to the image element, generating a corresponding download address based on the address for storing the element image data, and storing the download address to complete element extraction of the target front-end page image;
s210, constructing a front-end page corresponding to the target front-end page image based on the stored download address of the image element and the text content data of the text element.
In the method, when the page elements are extracted from the target front-end page image, the received image data of the target front-end page image can be input into the element detection model to be calculated in response to the element extraction instruction, so as to obtain the element image data corresponding to the elements included in the target front-end page image, and then the elements are stored according to the element types of the elements, so that the elements can be efficiently, accurately and inexpensively extracted from the designed front-end page image, and therefore, the efficiency and the accuracy of constructing the front-end page can be further improved.
In the present application, constructing the front-end page can be divided into two links, which are respectively: firstly, extracting elements from a designed front-end cloud image; and secondly, constructing a front-end page based on the extracted elements. The following description will be made for each of the above two links.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for extracting elements according to the present application. The method can be applied to an element extracting system (hereinafter referred to as a system).
When the system receives the front-end page image, the image data of the front-end page image may be input into an element detection model (mask rcnn) to obtain element image data corresponding to each element included in the target front-end page image, and information such as position coordinates and spatial size of each element in the target front-end page image.
After acquiring the element image data corresponding to each of the elements, the system may perform the following steps for each of the elements:
and performing OCR recognition on the element image data corresponding to the element to obtain a recognition result corresponding to the element and a recognition confidence corresponding to the recognition result. After obtaining the recognition confidence, the system may compare the recognition confidence with a preset threshold to determine whether the recognition confidence reaches the preset threshold. If the recognition confidence reaches the preset threshold, determining that the element type of the element is a text element; otherwise, the element type of the element is determined to be the image element.
At this time, when the element is determined to be a text element, the system may further determine the text content data of the text element. When the character content data of the text element is determined, the system may use the recognition result obtained by the OCR recognition as the character content data of the text element. After determining the text data of the text element, the system may store the text data, the position coordinates, the space size, and other information of the text element in a database of a server using the identification information of the text element as an index.
When the element is determined to be an image element, the system may upload the element image data corresponding to the image element to a pre-constructed CDN (Content Delivery Network). Then, the system may map the storage address stored in the CDN to a download address URL corresponding to the image element through a preset mapping algorithm, and store the URL, information such as a position coordinate and a space size of the element, and the identification information of the element as an index in a database of a server.
And when the system executes the steps aiming at each element, the link of extracting the element is already executed. And then entering a link of constructing a front-end page.
In one embodiment, the front page may be constructed manually. Specifically, the developer may obtain the related data of each element by accessing the server storing each element, and then, based on the front-end page development tool, the developer may determine the position of each element corresponding to the front-end page according to the coordinate position of each element in the page image and the size of the space occupied in the front-end page. After determining the position of each element in the front-end page, the developer may add the specific content of each element to the determined position, thereby completing the development of the front-end page.
In another embodiment, the front-end page building model may be trained in advance based on a deep neural network. When the front-end page is constructed, the stored relevant data of each element can be input into a pre-trained front-end page construction model, so that the corresponding front-end page is automatically generated. .
According to the technical scheme, when the front-end page is constructed, after the elements are extracted from the target page image, the front-end page can be constructed based on the extracted elements, so that the construction efficiency and the construction accuracy of the front-end page can be improved.
At this point, the task of constructing the front page according to the designed front page image is completed.
Correspondingly, the application also provides an element extraction device in the front-end page image. Referring to fig. 4, fig. 4 is a structural diagram of an element extraction apparatus in a front page image according to the present application.
As shown in fig. 4, the apparatus 400 may include:
a calculating module 410, configured to, in response to the element extraction instruction, input the received image data of the target front-end page image into the element detection model for calculation, to obtain element image data corresponding to an element included in the target front-end page image;
a determining module 420 for determining an element type of the element based on the element image data;
the first storage module 430, if the element is a text element, further determines text content data of the text element, and stores the text content data to complete element extraction for the target front page image.
In an embodiment, the apparatus 400 further comprises:
and the second storage module is used for storing element image data corresponding to the image elements if the elements are the image elements, generating corresponding download addresses based on the addresses for storing the element image data, and storing the download addresses to finish element extraction of the target front-end page image.
In an embodiment, the determining module 420 includes:
performing OCR recognition on the element image data corresponding to the element to obtain a recognition result corresponding to the element;
determining whether the recognition confidence included in the recognition result reaches a preset threshold value;
if so, determining the element type of the element as a text element.
If not, determining the element type of the element as an image element.
In an embodiment, the first storage module 430 includes:
acquiring character content data included in the identification result;
and determining the acquired text content data as the text content data of the text element.
In an embodiment, the determining module 420 includes:
inputting element image data corresponding to the elements into a pre-trained classifier for calculation, and determining the element types of the elements based on the calculation result; the classifier is obtained by training on the basis of a plurality of element image samples marked with element types; the element types include an image element or a text element.
In an embodiment, the first storage module 430 includes:
performing OCR recognition on the element image data corresponding to the elements to obtain character content data;
and determining the text content data as the text content data of the text element.
In an embodiment shown, the element detection model is a detection model constructed based on a deep neural network.
The present application further proposes a front-end page constructing apparatus 500. Referring to fig. 5, fig. 5 is a structural diagram of a front-end page constructing apparatus shown in the present application.
As shown in fig. 5, the apparatus 500 includes:
the element extraction module 540 in the front-end page image, in response to the element extraction instruction, inputs the received image data of the target front-end page image into the element detection model for calculation, and obtains element image data corresponding to the elements included in the target front-end page image;
determining the element type of the element;
if the element is a text element, further determining the text content data of the text element, and storing the text content data to complete element extraction aiming at the target front page image;
if the element is an image element, storing element image data corresponding to the image element, generating a corresponding download address based on an address for storing the element image data, and storing the download address to complete element extraction for the target front-end page image;
the constructing module 520 constructs a front-end page corresponding to the target front-end page image based on the stored download address of the image element and the text content data of the text element.
The embodiment of the element extraction device in the front page image shown in the application can be applied to the element extraction device in the front page image. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. In terms of hardware, as shown in fig. 6, a hardware structure diagram of an element extraction device in a front-end page image shown in this application is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 6, an electronic device where the apparatus is located in the embodiment may also include other hardware according to an actual function of the electronic device, which is not described again.
Referring to fig. 6, an apparatus for extracting elements from a front page image includes: a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to call executable instructions stored in the memory to implement the element extraction method in the front-end page image according to any one of claims 1 to 7.
The embodiment of the front-end page building device shown in the application can be applied to the front-end page building equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. In terms of hardware, as shown in fig. 7, a hardware structure diagram of a front-end page constructing device shown in this application is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 7, an electronic device where a device is located in an embodiment may also include other hardware according to an actual function of the electronic device, which is not described again.
Please refer to fig. 7, which illustrates a front-end page constructing apparatus, where the apparatus includes: a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to call the executable instructions stored in the memory to implement the method for constructing a front-end page as claimed in claim 8.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the claims that follow.
The above description is only exemplary of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application should be included in the scope of the present application.

Claims (18)

1. The element extraction method in the front-end page image comprises the following steps:
in response to an element extraction instruction, inputting the received image data of the target front-end page image into an element detection model for calculation to obtain element image data corresponding to elements included in the target front-end page image;
determining an element type of the element based on the element image data;
and if the element is a text element, further determining the text content data of the text element, and storing the text content data to finish the element extraction aiming at the target front page image.
2. The method of claim 1, further comprising:
and if the element is an image element, storing element image data corresponding to the image element, generating a corresponding download address based on the address for storing the element image data, and storing the download address to finish element extraction for the target front-end page image.
3. The method of claim 2, the determining an element type of the element, comprising:
performing OCR recognition on the element image data corresponding to the element to obtain a recognition result corresponding to the element;
determining whether a recognition confidence included in the recognition result reaches a preset threshold;
if so, determining that the element type of the element is a text element;
if not, determining that the element type of the element is an image element.
4. The method of claim 3, the further determining textual content data for the text element, comprising:
acquiring character content data included in the identification result;
and determining the acquired text content data as the text content data of the text element.
5. The method of claim 2, the determining an element type of the element, comprising:
inputting element image data corresponding to the elements into a pre-trained classifier for calculation, and determining element types of the elements based on calculation results; the classifier is obtained by training on the basis of a plurality of element image samples marked with element types; the element type includes an image element or a text element.
6. The method of claim 5, the further determining text data for the text element, comprising:
performing OCR recognition on the element image data corresponding to the element to obtain character content data;
and determining the text content data as the text content data of the text element.
7. The method of claim 1, the element detection model being a deep neural network-based constructed detection model.
8. The construction method of the front-end page comprises the following steps:
in response to an element extraction instruction, inputting the received image data of the target front-end page image into an element detection model for calculation to obtain element image data corresponding to elements included in the target front-end page image;
determining an element type of the element;
if the element is a text element, further determining the text content data of the text element, and storing the text content data to complete element extraction for the target front page image;
if the element is an image element, storing element image data corresponding to the image element, generating a corresponding download address based on an address for storing the element image data, and storing the download address to complete element extraction for the target front-end page image;
and constructing a front-end page corresponding to the target front-end page image based on the stored download address of the image element and the text content data of the text element.
9. Element extraction apparatus in a front-end page image, comprising:
the computing module responds to an element extraction instruction, inputs the received image data of the target front-end page image into an element detection model for computing, and obtains element image data corresponding to elements included in the target front-end page image;
a determination module that determines an element type of the element based on the element image data;
and the first storage module is used for further determining the text content data of the text element if the element is the text element and storing the text content data so as to finish the element extraction aiming at the target front-end page image.
10. The apparatus of claim 9, further comprising:
and the second storage module is used for storing element image data corresponding to the image elements if the elements are the image elements, generating corresponding download addresses based on the addresses for storing the element image data, and storing the download addresses to finish element extraction of the target front-end page images.
11. The apparatus of claim 10, the determination module, comprising:
performing OCR recognition on the element image data corresponding to the element to obtain a recognition result corresponding to the element;
determining whether a recognition confidence included in the recognition result reaches a preset threshold;
if so, determining that the element type of the element is a text element;
if not, determining that the element type of the element is an image element.
12. The apparatus of claim 11, the first storage module, comprising:
acquiring character content data included in the identification result;
and determining the acquired text content data as the text content data of the text element.
13. The apparatus of claim 10, the determination module, comprising:
inputting element image data corresponding to the elements into a pre-trained classifier for calculation, and determining element types of the elements based on calculation results; the classifier is obtained by training on the basis of a plurality of element image samples marked with element types; the element type includes an image element or a text element.
14. The apparatus of claim 13, the first storage module, comprising:
performing OCR recognition on the element image data corresponding to the element to obtain character content data;
and determining the text content data as the text content data of the text element.
15. The apparatus of claim 9, the element detection model being a deep neural network-based constructed detection model.
16. Front end page construction apparatus, comprising:
the element extraction module in the front-end page image responds to an element extraction instruction, inputs the received image data of the target front-end page image into an element detection model for calculation, and obtains element image data corresponding to elements included in the target front-end page image;
determining an element type of the element;
if the element is a text element, further determining the text content data of the text element, and storing the text content data to complete element extraction for the target front page image;
if the element is an image element, storing element image data corresponding to the image element, generating a corresponding download address based on an address for storing the element image data, and storing the download address to complete element extraction for the target front-end page image;
and the construction module is used for constructing a front-end page corresponding to the target front-end page image based on the stored download address of the image element and the text content data of the text element.
17. Element extraction apparatus in a front-end page image, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to invoke executable instructions stored in the memory to implement the element extraction method in the front-end page image of any one of claims 1 to 7.
18. Front-end page construction equipment comprises:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to call executable instructions stored in the memory to implement the method of building a front-end page of claim 8.
CN202010384142.8A 2020-05-09 2020-05-09 Element extraction method and device in front-end page image and electronic equipment Pending CN111291738A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010384142.8A CN111291738A (en) 2020-05-09 2020-05-09 Element extraction method and device in front-end page image and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010384142.8A CN111291738A (en) 2020-05-09 2020-05-09 Element extraction method and device in front-end page image and electronic equipment

Publications (1)

Publication Number Publication Date
CN111291738A true CN111291738A (en) 2020-06-16

Family

ID=71029678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010384142.8A Pending CN111291738A (en) 2020-05-09 2020-05-09 Element extraction method and device in front-end page image and electronic equipment

Country Status (1)

Country Link
CN (1) CN111291738A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115905767A (en) * 2023-01-07 2023-04-04 珠海金智维信息科技有限公司 Webpage login method and system based on fixed candidate box target detection algorithm

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075892A (en) * 2007-03-28 2007-11-21 腾讯科技(深圳)有限公司 Method, server and customer terminal for releasing advertisement
CN101571875A (en) * 2009-05-05 2009-11-04 程治永 Realization method of image searching system based on image recognition
CN110363049A (en) * 2018-04-10 2019-10-22 阿里巴巴集团控股有限公司 The method and device that graphic element detection identification and classification determine
CN111078979A (en) * 2019-11-29 2020-04-28 上海观安信息技术股份有限公司 Method and system for identifying network credit website based on OCR and text processing technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075892A (en) * 2007-03-28 2007-11-21 腾讯科技(深圳)有限公司 Method, server and customer terminal for releasing advertisement
CN101571875A (en) * 2009-05-05 2009-11-04 程治永 Realization method of image searching system based on image recognition
CN110363049A (en) * 2018-04-10 2019-10-22 阿里巴巴集团控股有限公司 The method and device that graphic element detection identification and classification determine
CN111078979A (en) * 2019-11-29 2020-04-28 上海观安信息技术股份有限公司 Method and system for identifying network credit website based on OCR and text processing technology

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115905767A (en) * 2023-01-07 2023-04-04 珠海金智维信息科技有限公司 Webpage login method and system based on fixed candidate box target detection algorithm

Similar Documents

Publication Publication Date Title
CN110287479B (en) Named entity recognition method, electronic device and storage medium
CN110033018B (en) Graph similarity judging method and device and computer readable storage medium
CN109034069B (en) Method and apparatus for generating information
CN107798001B (en) Webpage processing method, device and equipment
US20190294912A1 (en) Image processing device, image processing method, and image processing program
CN109086834B (en) Character recognition method, character recognition device, electronic equipment and storage medium
CN110781925B (en) Software page classification method and device, electronic equipment and storage medium
CN111612081B (en) Training method, device, equipment and storage medium for recognition model
CN114550051A (en) Vehicle loss detection method and device, computer equipment and storage medium
CN112308069A (en) Click test method, device, equipment and storage medium for software interface
CN114639096B (en) Text recognition method, device, electronic equipment and storage medium
CN111291738A (en) Element extraction method and device in front-end page image and electronic equipment
CN116361502B (en) Image retrieval method, device, computer equipment and storage medium
CN117115823A (en) Tamper identification method and device, computer equipment and storage medium
CN116994267A (en) Nameplate VIN code identification method, device, storage medium and equipment
CN116774973A (en) Data rendering method, device, computer equipment and storage medium
CN111552829A (en) Method and apparatus for analyzing image material
WO2023225335A1 (en) Performing computer vision tasks by generating sequences of tokens
CN113642642B (en) Control identification method and device
CN116225956A (en) Automated testing method, apparatus, computer device and storage medium
CN114064010A (en) Front-end code generation method, device, system and storage medium
CN114842476A (en) Watermark detection method and device and model training method and device
CN113742559A (en) Keyword detection method and device, electronic equipment and storage medium
CN115186240A (en) Social network user alignment method, device and medium based on relevance information
CN115063826A (en) Mobile terminal driver license identification method and system based on deep learning

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200616

RJ01 Rejection of invention patent application after publication