Feature information extraction method and device, electronic equipment and storage medium
By identifying and parsing information blocks in web page information, it solves the problem of efficient processing under changes in information formats, realizes flexible processing of information in various formats, and improves processing efficiency and accuracy.
Patent Information
- Application Number
- CN202410877186.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-01
AI Technical Summary
The existing technology cannot flexibly and efficiently process information in various formats, especially when the information format changes. It lacks adaptability and flexibility and cannot effectively process different types of information.
By obtaining the web page information to be identified, the category of the information block is determined, and corresponding parsing methods are used to parse the information blocks of each category according to the category, and the target characteristics of the parsed information block are identified to achieve efficient processing under changes in information format.
It achieves flexible and efficient processing of information in various formats when the information format changes, improves the efficiency and accuracy of information processing, and adapts to the identification and extraction of different types of information.
Smart Images

Figure CN118734039A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a feature information extraction method, device, electronic device, and storage medium. Background Art
[0002] Digital asset institutions usually need to assess the risk status of digital asset applicants. Generally, the information sources and formats used in the assessment are different, for example, some are text information, and some are tables or pictures.
[0003] However, as time goes by, the format of information will change. After obtaining this information, only the format before the information changes is processed, and it has not yet adapted to the format after the information changes. The existing information processing method lacks sufficient flexibility and cannot process information in various formats, and cannot adaptively and efficiently process information when the information format changes.
[0004] Therefore, it is necessary to propose a feature information extraction method to solve at least one of the above technical problems. Summary of the invention
[0005] The embodiments of the present disclosure provide a feature information extraction method, device, electronic device and storage medium to adapt to processing information in various formats and to efficiently process information when the information format changes.
[0006] In a first aspect, the present disclosure provides a method for extracting feature information, comprising:
[0007] Acquire the web page information to be identified, wherein the web page information to be identified includes one or more categories of information blocks;
[0008] Determining the category of each of the information blocks in the web page information to be identified;
[0009] According to the categories of the information blocks, the information blocks of each category are parsed using the parsing methods corresponding to the categories to obtain the parsed information blocks of each category;
[0010] The target features of the parsed information blocks of each category are identified to obtain the target feature information of the web page information to be identified.
[0011] In some optional implementations, the adopting the parsing method corresponding to each category to parse the information blocks of each category to obtain the parsed information blocks of each category includes:
[0012] The information blocks of each category are parsed using the parsing methods corresponding to each category to obtain the structured data corresponding to the information blocks of each category.
[0013] In some optional implementations, the categories of the information blocks include text information presented in text form, table information presented in table form, and image information presented in image form, and the steps of parsing the information blocks of each category using a parsing method corresponding to each category according to the categories of the information blocks to obtain the parsed information blocks of each category include:
[0014] Parsing each of the table information to obtain a set of formatted information of the corresponding table information, where the formatted information includes information in at least one cell;
[0015] Each piece of image information is parsed to obtain a content area image set included in the corresponding image.
[0016] In some optional implementations, parsing each of the table information to obtain a formatted information set of the corresponding table information includes:
[0017] Parsing the table information in the table to obtain information in each cell of the table and a set of cell pairs consisting of two adjacent cells;
[0018] For each of the cell pairs,
[0019] If there is an information association relationship between the information in the two cells corresponding to each of the cell pairs, the information in the two cells corresponding to the cell pair are jointly determined as the first formatting information corresponding to the cell pair;
[0020] If there is no information association relationship between the information in the two cells corresponding to each of the cell pairs, the information in the two cells corresponding to the cell pairs are respectively determined as the second formatting information corresponding to the two cells corresponding to the cell pairs;
[0021] A formatted information set is obtained through each of the first formatted information and each of the second formatted information.
[0022] In some optional implementations, determining whether the information in the two cells corresponding to each of the cell pairs has an information association relationship includes:
[0023] Obtaining the information transfer probability between the information in the two cells corresponding to the cell pair;
[0024] It is determined whether there is an information association relationship between the information in the two cells corresponding to the cell pair according to the information transfer probability.
[0025] In some optional implementations, determining whether the information in the two cells corresponding to the cell pair has an information association relationship according to the information transfer probability includes:
[0026] If the information transfer probability is greater than a preset information transfer probability threshold, determining that there is an information association relationship between the information in the two cells corresponding to the cell pair;
[0027] If the information transfer probability is greater than a preset information transfer probability threshold, it is determined that there is no information association relationship between the information in the two cells corresponding to the cell pair.
[0028] In some optional implementations, parsing each of the image information to obtain a content area image set included in the corresponding image includes:
[0029] Performing denoising processing on each of the image information to obtain denoised image information;
[0030] Performing content region identification on each of the denoised image information to obtain a content region set including preset content in the corresponding denoised image information;
[0031] According to each content region set of the denoised image information, a content region image set included in the corresponding image is generated.
[0032] In some optional implementations, generating a content region image set included in a corresponding image according to the content region set of each denoised image information includes:
[0033] For each of the content regions in the content region set of each of the denoised image information, obtaining the four corner coordinates of the minimum circumscribed rectangle corresponding to each of the content regions;
[0034] A content area image set included in the corresponding image is generated according to the four corner coordinates of the minimum circumscribed rectangle corresponding to each content area.
[0035] In some optional implementations, the identifying and parsing target features of each category of information blocks to obtain target feature information of the web page information to be identified includes:
[0036] Performing target feature information recognition on the text information to obtain target feature information corresponding to the text information;
[0037] Performing target feature information recognition on the formatted information set of each table to obtain target feature information corresponding to each formatted information;
[0038] Target feature information is identified on a set of content region images included in each image to obtain target feature information corresponding to each content region image.
[0039] In a second aspect, the present disclosure provides a feature information extraction device, comprising:
[0040] An acquisition unit, used for acquiring web page information to be identified, wherein the web page information to be identified includes information blocks of one or more categories;
[0041] A determination unit, used to determine the category of each of the information blocks in the web page information to be identified;
[0042] A parsing unit, configured to parse the information blocks of each category according to the category of each information block by using a parsing method corresponding to the category to obtain parsed information blocks of each category;
[0043] The identification unit is used to identify the target features of the information blocks of each category after parsing, and obtain the target feature information of the web page information to be identified.
[0044] In a third aspect, the present disclosure provides an electronic device, including:
[0045] one or more processors;
[0046] a storage device having one or more programs stored thereon,
[0047] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any embodiment of the first aspect of the present disclosure.
[0048] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by one or more processors, implements the method described in any embodiment of the first aspect of the present disclosure.
[0049] In a fifth aspect, the present disclosure provides a computer program product, comprising a computer program / instructions, which, when executed by a processor, implement the method described in any embodiment of the first aspect of the present disclosure.
[0050] The feature information extraction method, device, electronic device and storage medium provided by the embodiments of the present disclosure first obtain the web page information to be identified, which includes one or more categories of information blocks, then determine the category of each information block in the web page information to be identified, and parse the information blocks of each category using the parsing method corresponding to each category according to the category of each information block to obtain the parsed information blocks of each category, and finally identify the target features of the parsed information blocks to obtain the target feature information of the web page information to be identified. The present disclosure can flexibly and efficiently process information of various formats when the information format changes by performing corresponding processing on one or more types of information blocks in the web page information to be identified, and then identifying the target features of each information block to obtain the target feature information of the web page information to be identified. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Other features, objects and advantages of the present disclosure will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the drawings:
[0052] Figure 1 is a system architecture diagram in which an embodiment of the feature information extraction method disclosed herein can be applied;
[0053] Figure 2 is a flow chart of an embodiment of a feature information extraction method according to the present disclosure;
[0054] Figure 3 is a decomposed flow chart of one embodiment of step 203 according to the present disclosure;
[0055] Figure 4 is a decomposed flow chart of one embodiment of step 2031 according to the present disclosure;
[0056] Figure 5 is a decomposed flow chart of one embodiment of step 20312 according to the present disclosure;
[0057] Figure 6 is a structural schematic diagram of an embodiment of a feature information extraction device according to the present disclosure;
[0058] Figure 7 It is a structural diagram of a computer system of an electronic device suitable for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION
[0059] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0060] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0061] Figure 1 An exemplary system architecture 100 is shown to which embodiments of the feature information extraction method, apparatus, terminal device, and storage medium disclosed herein can be applied.
[0062] like Figure 1As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various communication connection types, such as a wired communication link, a wireless communication link, and the like.
[0063] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as information acquisition applications, voice interaction applications, video conferencing applications, short video social applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0064] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with microphones and speakers, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4), portable computers and desktop computers, etc. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, obtaining web page content information), or it can be implemented as a single software or software module. No specific limitation is made here.
[0065] The server 105 may be a server that provides various services, such as a background server that processes webpage content information obtained by the terminal devices 101, 102, and 103. The background server may perform corresponding processing based on the webpage content information obtained by the terminal devices.
[0066] In some cases, the feature information extraction method provided by the present disclosure can be jointly performed by the terminal devices 101, 102, 103 and the server 105. For example, the step of "obtaining webpage content information" can be performed by the terminal devices 101, 102, 103, and the step of "parsing the table information in the table to obtain the formatted information set of the table information" can be performed by the server 105. The present disclosure does not limit this. Accordingly, the feature information extraction device can also be respectively set in the terminal devices 101, 102, 103 and the server 105.
[0067] In some cases, the feature information extraction method provided in the present disclosure may be executed by the server 105 , and accordingly, the feature information extraction device may also be set in the server 105 . In this case, the system architecture 100 may not include the terminal devices 101 , 102 , and 103 .
[0068] In some cases, the feature information extraction method provided in the present disclosure may be executed by the terminal devices 101 , 102 , 103 , and correspondingly, the feature information extraction device may also be set in the terminal devices 101 , 102 , 103 . In this case, the system architecture 100 may not include the server 105 .
[0069] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server 105 is software, it can be implemented as multiple software or software modules (for example, for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0070] It should be understood that Figure 1 The number of terminal devices, networks and servers in the disclosure is only illustrative. Any number of terminal devices, networks and servers may be provided as required. The information, data and signals involved in the disclosure are authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data shall comply with the relevant laws, regulations and standards of relevant countries and regions.
[0071] Continue to refer Figure 2 , Figure 2 A flowchart 200 is shown of an embodiment of a feature information extraction method according to the present disclosure. Figure 2 The feature information extraction method shown can be applied to Figure 1 The process 200 at least includes the following steps 201-204.
[0072] Step 201, obtaining the web page information to be identified.
[0073] The web page information to be identified may refer to the web page from which target feature information needs to be extracted. The web page information to be identified may include one or more categories of information blocks. For example, the categories of information blocks may include text information presented in text form, table information presented in table form, and image information presented in image form. For another example, the categories of information blocks in the web page information to be identified may also include information presented in card form, view form, link form, attachment form, block form, etc.
[0074] The text information may refer to information content in the form of characters, including any one or combination of the following: letters, numbers, symbols, and combinations thereof.
[0075] Table information can be a way of organizing and displaying information in a table. Tables are usually composed of rows and columns. Information can exist in each cell of the table. The information type in each cell includes, but is not limited to, characters such as text, numbers, and symbols. Table information on web pages is usually displayed in HTML. 、 、 Tags such as __name__ and __name__ are used to define the structure so that the table can be correctly displayed to the user.
[0076] Image information may refer to a method of presenting information in the form of images. The content presented in the image information may include text, symbols, tables or other (e.g., people, plants, animals, objects), etc. Image information is usually stored in a graphic file format. For example, image information may be stored in JPEG, PNG, BMP, etc. formats. PDF files may be regarded as image information.
[0077] The information block may refer to different content areas in the web page to be identified, and / or content areas with different information attributes in the web page to be identified. For example, the information block may include a text information block presented in text form, table information presented in table form, and image information block presented in image form. It may also include an information block presenting information in the form of a card, view, link, attachment, block, etc. The web page to be identified may include one or more information blocks.
[0078] Step 202: Determine the category of each information block in the web page information to be identified.
[0079] The web page information to be identified may include one or more information blocks, and the categories of the information blocks may be the same or different.
[0080] For example, the information in the web page to be identified may include a table information block presented in a table form and two image information blocks presented in an image form, or the web page information to be identified may include three table information blocks presented in a table form.
[0081] Step 203: according to different categories, the information blocks of each category are parsed using the parsing method corresponding to each category to obtain the parsed information blocks of each category.
[0082] In some optional implementations, the information blocks of each category may be parsed using the parsing method corresponding to each category to obtain structured data corresponding to the information blocks of each category.
[0083] By parsing the information blocks of each category using the corresponding parsing methods of each category to obtain the structured data corresponding to the information blocks of each category, it is convenient for the database to store, query and analyze the information blocks of each category, and it is also helpful to improve the efficiency and accuracy of subsequent identification of the target features of each information block.
[0084] In some optional implementations, step 203 may specifically include: Figure 3 Steps 2031 to 2032 are shown.
[0085] It should be noted that there is no restriction on the execution order between step 2031 and step 3032. Step 2031 may be executed first and then step 2032, or step 2032 may be executed first and then step 2031.
[0086] Step 2031, parse each table information to obtain a formatting information set of the corresponding table information.
[0087] In this embodiment, the formatting information may include information in at least one cell.
[0088] A cell of a table can refer to a square consisting of one row and one column in the table.
[0089] By parsing the table information, a formatted information set of the corresponding table information is obtained to realize structured data processing, which can facilitate computer processing and analysis, accelerate the data processing process, and facilitate the subsequent identification of target features.
[0090] Here, the web page information to be identified may include at least one table information presented in a table form. Each table information is parsed, and the information in each cell in each table is parsed. For each cell, a formatting information set of the corresponding table information is obtained.
[0091] It is understandable that in some cases, the content displayed in the table information displayed to the user on the web page may be inconsistent with the code displayed in the HTML code. For example, the table information displayed to the user on the web page shows a continuous piece of information, which may exist in one cell from the user's perspective. However, in the HTML code, the continuous information may be composed of information in multiple cells. What the digital asset institution needs to obtain may be the entire continuous information. Therefore, after parsing the information in each cell, it is necessary to process the information displayed as continuous information but actually existing in multiple cells to obtain the continuous information.
[0092] In some embodiments, continuous information may be obtained based on formatting information. Formatting information may refer to information that has information association relationship with each other, and the formatting information may exist in a single cell or in multiple cells. The information of cells having information association relationship may mean that the information of the cells has semantic association relationship.
[0093] For example, cell 1 includes the information "Beijing City", cell 2 includes the information "Chaoyang District", and cell 3 includes the information: "Sanlitun Street". In fact, "Sanlitun Street, Chaoyang District, Beijing City" may refer to a specific address, which is a continuous piece of information, and the information in each cell has an information association relationship.
[0094] Since the formatting information may exist in multiple cells, in some optional implementations, step 2031 may specifically include the following: Figure 4 Steps 20311 to 20315 shown:
[0095] Step 20311, parse each table information to obtain the information in each cell of the table and a set of cell pairs consisting of two adjacent cells.
[0096] Here, the table information in the table is parsed, and various tools that can parse table information can be used to parse it to obtain the information in each cell of the table and a set of cell pairs consisting of two adjacent cells.
[0097] For example, the table information can be parsed through the beautiful soup library (a web page parsing technology). Beautiful soup is a toolkit for the python programming language that can extract data from HTML files. The table information can also be parsed through the lxml library, html5lib library, parsel library, and PyQuery library.
[0098] In this embodiment, two adjacent cells may refer to two cells that are adjacent to each other on the left and right or on the top and bottom.
[0099] In one example, you can use the HTML form 、 、 Get a collection of cell pairs using the same label.
[0100] Step 20312: for each cell pair, determine whether there is an information association relationship between the information in the two cells corresponding to each cell pair.
[0101] In some optional implementations, first, the information transfer probability between the information in the two cells corresponding to the cell pair is obtained, and then, whether there is an information association relationship between the information in the two cells corresponding to the cell pair can be determined according to the information transfer probability.
[0102] Here, the information transfer probability between the information of two cells may refer to the probability of transferring the information from one cell to the information of another cell, which may be used to describe the degree of information association between the information of the two cells.
[0103] Through the transition probability between two pieces of information, the degree of information correlation between the information of the two cells can be obtained. Thus, continuous information existing in multiple cells can be identified based on the degree of information correlation between the information of the two cells.
[0104] The information transfer probability between the information in the two cells corresponding to the cell pair is obtained. For example, the information transfer probability between the information in the two cells corresponding to the cell pair can be obtained by using an information transfer probability model for obtaining the information transfer probability between the information.
[0105] Here, the information in the two cells corresponding to the cell pair may be input into the information transfer probability model, and the information transfer probability between the information in the two cells may be output through the information transfer probability model.
[0106] For example, the information transfer probability model may include an HMM model (Hidden Markov Model), a CRF (Conditional Random Fields), a HSMM (Hidden Semi-Markov Models), and a MCMC (Markov Chain Monte Carlo).
[0107] In some optional implementations, the information transfer probability model can be obtained in advance through the following (A1)-(A4):
[0108] (A1) A large number of training sample sets are obtained from each sample web page, and then each training sample in the training sample set is segmented to obtain the training sample set after segmentation, a sample information pair set is obtained from the training sample set after segmentation, and the information transfer probability between two sample information in each sample information pair is initialized.
[0109] Here, the corresponding word segmentation sequence can be obtained by segmenting the training sample set, and the sample information pair set can be composed of two different word segmentation pairs in each word segmentation sequence. The initialization information transfer probability of each sample information pair can be directly obtained through the web page.
[0110] (A2) Segment the text information in the acquired target web page to obtain a corresponding segmentation sequence, and then form a target information pair set from two different segmentation pairs in each segmentation sequence obtained after segmentation, and then calculate the information transfer probability between the two information in each target information pair based on the order relationship between the two different segmentations in each segmentation sequence.
[0111] The information transfer probability between the two pieces of information can be determined by the ratio of the number of times the two participles appear in sequence in the target web page to the total number of times other participles appear in sequence after the first participle of the two participles and the second participle of the two participles.
[0112] (A3) Match each target information pair in the target information pair set with a large number of sample information pairs obtained from each sample web page. If the match is successful, replace the information transfer probability of the successfully matched sample information pair with the information transfer probability of the corresponding target information pair.
[0113] (A4) Based on a large number of sample information pairs and corresponding information transfer probabilities obtained from each sample web page, the initial information transfer probability model is trained to obtain a trained information transfer probability model.
[0114] For example, in the sample information pair "Beijing" and "Sanlitun Street", the initial value between the two is 0.3, and then, the text information "Beijing Sanlitun Street Taikoo Li South District" in the obtained target web page is segmented to obtain the segmentation sequence "Beijing|Sanlitun Street|Taikoo Li|South District". For this segmentation sequence, three target information pairs "Beijing-Santunli Street, Santunli Street-Taikoo Li, Taikoo Li-South District" can be formed. Based on the target information pair "Beijing-Santunli Street", the information transfer probability between Beijing and Santunli Street is calculated. If, in the target web page, the number of times Sanlitun Street appears after Beijing is 5, and the number of times other words appear after Beijing is 2, then the information transfer probability of the target information pair "Beijing-Santunli Street" can be 5 / 7.
[0115] After obtaining the information transfer probability of "Beijing-Santunli Subdistrict", it can be determined whether it is in the sample information pair set. If it is in the sample information set, the initial information transfer probability 0.3 of "Beijing-Santunli Subdistrict" in the sample information set is replaced with 5 / 7, and then based on a large number of sample information pairs and the corresponding information transfer probability 5 / 7 obtained from each sample web page, the initial information transfer probability model is trained to obtain the trained information transfer probability model.
[0116] In some optional implementations, determining whether the information in the two cells corresponding to the cell pair has an information association relationship according to the information transfer probability may specifically include: Figure 5 Steps 203121 to 203123 shown:
[0117] Step 203121, determine whether the information transfer probability is greater than a preset information transfer probability threshold.
[0118] The information transfer probability threshold may be preset, for example, the information transfer probability threshold may be 0.7, 0.8 or 0.85, etc., which is not limited here.
[0119] The information transfer probability threshold can be set according to actual needs. The higher the information transfer probability threshold is set, the closer the information association relationship between the cell pairs in the web page information to be identified is.
[0120] Here, if the information transfer probability is greater than the information transfer probability threshold, step 20222 is executed, and if the information transfer probability is not greater than the information transfer probability threshold, step 20223 is executed.
[0121] Step 203122, if greater than, it is determined that there is an information association relationship between the information in the two cells corresponding to the cell pair.
[0122] When the information transfer probability is greater than the information transfer probability threshold, it is determined that there is an information association relationship between the two cell information corresponding to the cell.
[0123] For example, the information transfer probability between the information of cell 1 and cell 2 is 0.85. When the information transfer probability threshold is 0.7, it means that the information transfer probability between cell 1 and cell 2 is greater than the information transfer probability threshold, and it is determined that there is an information association relationship between the information of cell 1 and cell 2.
[0124] Step 203123, if it is not greater than, it is determined that there is no information association relationship between the information in the two cells corresponding to the cell pair.
[0125] When the information transfer probability is not greater than the information transfer probability threshold, it is determined that there is no information association relationship between the two cell information corresponding to the cell.
[0126] For example, the information transfer probability between the information of cell 3 and cell 4 is 0.6. When the information transfer probability threshold is 0.7, it means that the information transfer probability between cell 3 and cell 4 is less than the information transfer probability threshold, and it is determined that there is no information association relationship between the information of cell 3 and cell 4.
[0127] Here, if it is determined that the information in the two cells corresponding to the cell pair has an information association relationship, step 20313 is executed; if it is determined that the information in the two cells corresponding to the cell pair does not have an information association relationship, step 20314 is executed.
[0128] Step 203122-Step 203123, by quantifying the information transfer probability, the degree of correlation between the information of two cells can be evaluated more finely, and by setting a reasonable information transfer probability threshold, the logical structure between the information of each cell can be accurately understood, and the continuous information in the cell information can be quickly and accurately found to ensure the reliability of the formatted information analysis.
[0129] Step 20313: If there is an information association relationship, the information in the two cells corresponding to the cell pair is jointly determined as the first formatting information corresponding to the cell pair.
[0130] In some optional implementations, if there is an information association relationship between the information in two cells corresponding to a cell pair, the information in the two cells may be merged into a new piece of information, and the merged information may be determined as the first formatted information corresponding to the cell pair.
[0131] For example, if the information transfer probability between cell 1 and cell 2 is greater than the information transfer probability threshold, it is determined that there is an information association relationship between the information of cell 1 and cell 2. Then, the information of cell 1 and cell 2 can be merged, and the merged information can be determined as the first formatting information corresponding to the cell pair consisting of cell 1 and cell 2.
[0132] It is understandable that sometimes, the information between the cells in multiple adjacent cell pairs may have an information association relationship. For example, cell 1 and cell 2 are an adjacent cell pair, and cell 2 and cell 3 are an adjacent cell pair. When cell 1 and cell 2 have an information association relationship, and cell 2 and cell 3 also have an information association relationship, the information in cell 1, cell 2, and cell 3 can be merged into a new piece of information, and the merged information is determined as the first formatting information corresponding to the two cell pairs. Step 20314: If there is no information association relationship, the information in the two cells corresponding to the cell pair is respectively determined as the second formatting information corresponding to the two cells corresponding to the cell pair.
[0133] If there is no information association relationship between the information in the two cells corresponding to a cell pair, then the information in the two cells corresponding to the cell pair may be respectively determined as the second formatting information corresponding to the two cells corresponding to the cell pair.
[0134] For example, if the information transfer probability between cell 3 and cell 4 is not greater than the information transfer probability threshold, it is determined that there is no information association relationship between the information of cell 3 and cell 4. Then, the information of cell 3 and cell 4 can be determined as the second formatted information of cell 3 and the second formatted information of cell 4, respectively.
[0135] Step 20315: Obtain a formatted information set through each first formatted information and each second formatted information.
[0136] Here, the formatting information set may include all the first formatting information and all the second formatting information. In this way, whether the information in two cells has an information association relationship can be determined through the transition probability between the information, so that the continuous information actually existing in multiple cells can be merged according to the information association relationship, forming structured data of the cell information, which is convenient for the recognition of target features, and avoids information loss or misunderstanding caused by improper parsing, and can ensure that the data captured from the web page is complete and consistent with the original visual presentation.
[0137] Step 2032: parse each image information to obtain an image set of the content area included in the corresponding image.
[0138] It is understandable that in an image, not all regions have content that is actually meaningful for extracting target features, that is, in an image, there may be some regions that do not have any content that is actually meaningful, and identifying target features in these regions will reduce efficiency. For this reason, in this embodiment, regions with actually meaningful content can be identified, and target feature identification is performed only for these regions, so that the efficiency and accuracy of information processing can be improved and redundant information can be reduced.
[0139] Here, the content that is of practical significance for extracting target features may include text content, table content, etc., which can reduce the computational complexity, speed up the recognition process of target feature information, and improve the target feature recognition efficiency.
[0140] In some optional implementations, each image information is parsed to obtain a set of content regions included in the corresponding image. Specifically, first, each image information can be denoised to obtain denoised image information. Then, content region identification is performed on each denoised image information to obtain a set of content regions including preset content in the corresponding denoised image information. Finally, based on the set of content regions of each denoised image information, a set of content region images included in the corresponding image is generated.
[0141] Here, the image information may be processed to remove noise points, for example, the image information may be processed to remove noise points by median filtering, bilateral filtering, a combination of median and bilateral filtering, adaptive filtering, etc., to obtain denoised image information.
[0142] By denoising the image information, noise interference can be reduced, image quality can be improved, a clearer basis can be provided for subsequent content area recognition, and recognition accuracy can be improved. In addition, through content area recognition, we can focus on key areas, reduce computing resource consumption, and improve processing speed and efficiency.
[0143] In some optional embodiments, for each content area in the content area set of each denoised image information, the four corner coordinates of the minimum enclosing rectangle corresponding to each content area are obtained, and then, the image is captured in the image according to the four corner coordinates of the minimum enclosing rectangle corresponding to each content area to generate a content area image set included in the corresponding image.
[0144] Here, a set of content area images included in the corresponding image can be generated by various image extraction models. The image extraction model can be, for example, faster-RCNN (Faster Region-based Convolutional Neural Network, efficient regional convolutional neural network detection model), RPN (Region Proposal Network, region proposal network), CNN (Convolutional Neural Network, convolutional neural network), etc., which are not limited here.
[0145] In some optional implementations, the image extraction model can be obtained in advance through the following (B1)-(B3):
[0146] (B1), obtain the training sample set.
[0147] The training samples include sample images and four vertex coordinates of the labeled content area image in each sample image.
[0148] (B2), inputting the sample image into the image extraction model to obtain the four vertex coordinates of at least one content image actually output by the image extraction model. Further, adjusting the model parameters of the image extraction model based on the difference between the four fixed point coordinates of the at least one content region image actually output and the four vertex coordinates of the annotated content region image corresponding to the sample image in the training sample set.
[0149] (B3) The image extraction model after the model parameters are adjusted is determined as the trained image extraction model.
[0150] Through step 2301 and step 2032, the table information and the image information can be processed respectively, so as to realize flexible and efficient processing of information in various formats and facilitate subsequent joint target feature recognition for information in various formats.
[0151] In addition, the web page information to be identified may also include information presented in the form of cards, views, links, attachments, blocks, etc.
[0152] Here, for information displayed in card form, view form, link form, attachment form, block form, etc., each category of information blocks can be parsed according to the corresponding parsing method to obtain structured data corresponding to the information in card form, view form, link form, attachment form, block form, etc.
[0153] For example, for information displayed in the form of cards, various existing card-format information parsing methods can be used to identify the structure and constituent elements of the card and separate the different elements in the card. For example, for the text content in the card, OCR (optical character recognition) technology can be used to extract the text content. For the images in the card, various image processing technologies can be used to recognize the images.
[0154] Information displayed in the form of views can be analyzed using image processing and computer vision technology to analyze the layout structure of the view and identify different types of elements such as text boxes, images, tables, charts, etc. Then, different types of elements can be parsed using text parsing, image parsing, table parsing and other technologies.
[0155] For information displayed in the form of a link, you can first extract the actual URL address of the information in the link, parse the URL address to obtain the content of the page it points to, and then use corresponding text parsing, image parsing, and table parsing techniques to parse the content displayed on the page (text, tables, images, etc.).
[0156] Information displayed in the form of attachments can be identified by checking the file extension or using file header analysis technology. Then, based on the file type, the file can be parsed using parsing tools corresponding to various file types.
[0157] Information displayed in block form can be analyzed by analyzing the structure of the data source to identify independent blocks, which can then be segmented and extracted. Each block can be parsed using the corresponding parsing technology. For example, for a text block, its text content can be extracted, and for a table block, it can be parsed according to the table parsing method.
[0158] The above content is only an example and is not intended to limit the present disclosure. Other types of information can also be parsed according to the parsing method corresponding to the type of information to obtain structured data corresponding to each category of information block.
[0159] Step 204, identifying target features of the parsed information blocks of each category, and obtaining target feature information of the web page information to be identified.
[0160] In some optional implementations, target feature recognition is performed on the text information in the web page information to be recognized, the formatting information set of each table, and the content area image set included in each image to obtain target feature information. When the web page to be recognized includes information presented in the form of cards, views, links, attachments, blocks, etc., the target features of the parsed information blocks of the card form, view form, link form, attachment form, block form, etc. can also be recognized to obtain the corresponding target feature information.
[0161] In some optional implementations, target information corresponding to the text information may be obtained by performing target information recognition on the text information, target information corresponding to each formatting information of the table may be obtained by performing target information recognition on each formatting information, and target information corresponding to each formatting information may be obtained by performing sub-image information recognition on the sub-image.
[0162] In some optional implementations, various multimodal target feature extraction models that can extract text information and image information can be used to perform target feature recognition on the formatted information set of text information, table information, and the content area image set included in the image to obtain target feature information.
[0163] For example, the multimodal target feature extraction model can be miniGPT4, BLIP (Bi-directional Language-Image Pre-training, visual-language pre-training model), CLIP (Contrastive Language-Image Pre-training, contrastive language-image pre-training), etc., which is not limited here.
[0164] In this way, a multimodal target feature extraction model can be used to uniformly process information in multiple formats and simultaneously realize target feature information recognition of information in multiple formats, without using different models to recognize target feature information separately for information in each format. This eliminates the need to design and maintain models separately for each format of information, greatly reducing development and maintenance costs.
[0165] In some optional implementations, the multimodal target feature extraction model can be obtained in advance through the following (C1)-(C4):
[0166] (C1), obtain the preset target information set.
[0167] Here, the preset target information may include the target information to be obtained, for example, amount, name, etc.
[0168] (C2) A large number of information sets related to the target information in the preset target information set can be obtained.
[0169] (C3) Input the information in the information set into the multimodal target information extraction model to obtain the actual output target information.
[0170] (C4) adjusting the model parameters of the multimodal target feature extraction model based on the difference between the target information actually outputted and the target information in the preset target information set, and determining the multimodal target feature extraction model after the model parameters are adjusted as the trained multimodal target feature extraction model.
[0171] As an example, the multimodal target feature extraction model can be various large language models, or a model that is fine-tuned from a large language model.
[0172] The characteristic information extraction method provided by the embodiment of the present disclosure first obtains the web page information to be identified, wherein the web page information to be identified includes one or more categories of information blocks, then determines the category of each information block in the web page information to be identified, and according to the category of each information block, adopts the corresponding parsing method of each category to parse the information block of each category, obtains the parsed information block of each category, and finally, identifies the target feature of the parsed information block to obtain the target characteristic information of the web page information to be identified. The present disclosure can flexibly and efficiently process information of various formats when the information format changes by respectively performing corresponding processing on one or more types of information blocks in the web page information to be identified, and then identifying the target feature of each information block to obtain the target characteristic information of the web page information to be identified.
[0173] Further references Figure 6 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a feature information extraction device. Figure 2 Corresponding to the method embodiment shown, the apparatus can be specifically applied to various terminal devices.
[0174] like Figure 6 As shown, the feature information extraction device of this embodiment, the device 600 includes: an acquisition unit 601, a determination unit 602, a parsing unit 603 and an identification unit 604. Among them, the acquisition unit 601 is used to acquire the web page information to be identified, and the web page information to be identified includes one or more categories of information blocks; the determination unit 602 is used to determine the category of each information block in the web page information to be identified; the parsing unit 603 is used to parse the information blocks of each category according to the category of each information block using the parsing method corresponding to the category to obtain the parsed information blocks of each category; the identification unit 604 is used to identify the target features of the parsed information blocks to obtain the target feature information of the web page information to be identified.
[0175] In this embodiment, the specific processing of the acquisition unit 601, the determination unit 602, the analysis unit 603 and the identification unit 604 and the technical effects thereof can be referred to in Figure 2 The relevant descriptions of step 201 to step 204 in the corresponding embodiment are not repeated here.
[0176] In some optional implementations, the parsing unit 603 may be further configured to:
[0177] The information blocks of each category are parsed using the parsing methods corresponding to each category to obtain the structured data corresponding to the information blocks of each category.
[0178] In some optional implementations, the categories of information blocks include text information presented in text form, table information presented in table form, and image information presented in image form. The above-mentioned parsing unit 603 may be further configured as follows:
[0179] Parse each table information to obtain a formatting information set of the corresponding table information, where the formatting information includes information in at least one cell;
[0180] Each image information is parsed to obtain a content area image set included in the corresponding image.
[0181] In some optional implementations, the parsing unit 603 may be further configured as follows:
[0182] Parse the table information in the table to obtain the information in each cell of the table and a set of cell pairs consisting of two adjacent cells;
[0183] For each cell pair,
[0184] If there is an information association relationship between the information in the two cells corresponding to each cell pair, the information in the two cells corresponding to the cell pair is jointly determined as the first formatting information corresponding to the cell pair;
[0185] If there is no information association relationship between the information in the two cells corresponding to each cell pair, the information in the two cells corresponding to the cell pair is respectively determined as the second formatting information corresponding to the two cells corresponding to the cell pair;
[0186] A formatted information set is obtained through each of the first formatted information and each of the second formatted information.
[0187] In some optional implementations, the parsing unit 603 may be further configured as follows:
[0188] Obtain the information transfer probability between the information in the two cells corresponding to the cell pair;
[0189] It is determined whether there is an information association relationship between the information in the two cells corresponding to the cell pair according to the information transfer probability.
[0190] In some optional implementations, the parsing unit 603 may be further configured as follows:
[0191] If the information transfer probability is greater than a preset information transfer probability threshold, it is determined that there is an information association relationship between the information in the two cells corresponding to the cell pair;
[0192] If the information transfer probability is not greater than a preset information transfer probability threshold, it is determined that there is no information association relationship between the information in the two cells corresponding to the cell pair.
[0193] In some optional implementations, the parsing unit 603 may be further configured as follows:
[0194] Perform denoising on each image information to obtain denoised image information;
[0195] Performing content region recognition on each denoised image information to obtain a content region set including preset content in the corresponding denoised image information;
[0196] According to the content region set of each denoised image information, a content region image set included in the corresponding image is generated.
[0197] In some optional implementations, the parsing unit 603 may be further configured as follows:
[0198] For each content area, obtain the four corner coordinates of the minimum bounding rectangle corresponding to each content area;
[0199] A content area image set included in the corresponding image is generated according to the four corner coordinates of the minimum circumscribed rectangle corresponding to each content area.
[0200] In some optional implementations, the identification unit 604 may be further configured as follows:
[0201] Performing target feature information recognition on the text information to obtain target feature information corresponding to the text information;
[0202] Perform target feature information recognition on each formatted information of the table to obtain target feature information corresponding to each formatted information;
[0203] Target feature information is identified on the sub-image information of the sub-image to obtain target feature information corresponding to the sub-image.
[0204] It should be noted that the implementation details and technical effects of each unit in the feature information extraction device provided in the embodiments of the present disclosure can be referred to the description of other embodiments in the present disclosure, and will not be repeated here.
[0205] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing the present disclosure. Figure 7 The computer system 700 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0206] like Figure 7 As shown, the computer system 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 to a random access memory (RAM) 703. Various programs and data required for the operation of the computer system 700 are also stored in the RAM 703. The processing device 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0207] Typically, the following devices may be connected to the I / O interface 705: input devices 706 including, for example, a touch screen, a touch pad, a keypad, a mouse, a camera, a microphone, etc.; output devices 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 708 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 709. The communication devices 709 may allow the computer system 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The computer system 700 of the electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0208] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0209] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0210] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0211] The computer readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device implements the following Figure 2 The illustrated embodiment and its optional implementations illustrate a method for obtaining and distributing information.
[0212] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0213] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0214] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, an acquisition unit may also be described as a "unit for acquiring web page information to be identified".
[0215] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
Claims
1. A method for extracting feature information, characterized in that: Methods include: Acquire the web page information to be identified, wherein the web page information to be identified includes one or more categories of information blocks; Determining the category of each of the information blocks in the web page information to be identified; According to the categories of the information blocks, the information blocks of each category are parsed using the parsing methods corresponding to the categories to obtain the parsed information blocks of each category; The target features of the parsed information blocks of each category are identified to obtain the target feature information of the web page information to be identified.
2. The method according to claim 1, characterized in that The adopting the corresponding parsing method of each category to parse the information blocks of each category to obtain the parsed information blocks of each category includes: The information blocks of each category are parsed using the parsing methods corresponding to each category to obtain the structured data corresponding to the information blocks of each category.
3. The method according to claim 2, characterized in that The categories of the information blocks include text information presented in text form, table information presented in table form, and image information presented in image form. According to the categories of the information blocks, the information blocks of each category are parsed using the parsing method corresponding to each category to obtain the parsed information blocks of each category, including: Parsing each of the table information to obtain a set of formatted information of the corresponding table information, where the formatted information includes information in at least one cell; Each piece of image information is parsed to obtain a content area image set included in the corresponding image.
4. The method according to claim 3, characterized in that The step of parsing each of the table information to obtain a formatted information set of the corresponding table information includes: Parsing each of the table information to obtain information in each cell of the table and a set of cell pairs consisting of two adjacent cells; For each of the cell pairs, if there is an information association relationship between the information in the two cells corresponding to each of the cell pairs, the information in the two cells corresponding to the cell pair are jointly determined as the first formatting information corresponding to the cell pair; If there is no information association relationship between the information in the two cells corresponding to each of the cell pairs, the information in the two cells corresponding to the cell pairs are respectively determined as the second formatting information corresponding to the two cells corresponding to the cell pairs; A formatted information set is obtained through each of the first formatted information and each of the second formatted information.
5. The method according to claim 4, characterized in that The determining whether the information in the two cells corresponding to each cell pair has an information association relationship includes: Obtaining the information transfer probability between the information in the two cells corresponding to the cell pair; It is determined whether there is an information association relationship between the information in the two cells corresponding to the cell pair according to the information transfer probability.
6. The method according to claim 5, characterized in that The determining, according to the information transfer probability, whether there is an information association relationship between the information in the two cells corresponding to the cell pair includes: If the information transfer probability is greater than a preset information transfer probability threshold, determining that there is an information association relationship between the information in the two cells corresponding to the cell pair; If the information transfer probability is not greater than a preset information transfer probability threshold, it is determined that there is no information association relationship between the information in the two cells corresponding to the cell pair.
7. The method according to claim 3, characterized in that The step of parsing each of the image information to obtain a content area image set included in the corresponding image includes: Performing denoising processing on each of the image information to obtain denoised image information; Performing content region identification on each of the denoised image information to obtain a content region set including preset content in the corresponding denoised image information; According to each content region set of the denoised image information, a content region image set included in the corresponding image is generated.
8. The method according to claim 7, characterized in that The step of generating a content area image set included in a corresponding image according to each content area set of the denoised image information comprises: For each of the content areas, obtaining the four corner coordinates of the minimum circumscribed rectangle corresponding to each of the content areas; A content area image set included in the corresponding image is generated according to the four corner coordinates of the minimum circumscribed rectangle corresponding to each content area.
9. The method according to claim 3, characterized in that: The target features of the information blocks of each category after identification and analysis are obtained to obtain the target feature information of the web page information to be identified, including: Performing target feature information recognition on the text information to obtain target feature information corresponding to the text information; Performing target feature information recognition on the formatted information set of each table to obtain target feature information corresponding to each formatted information; Target feature information is identified on a set of content region images included in each image to obtain target feature information corresponding to each content region image.
10. A feature information extraction device comprising: An acquisition unit, used for acquiring web page information to be identified, wherein the web page information to be identified includes information blocks of one or more categories; A determination unit, used to determine the category of each of the information blocks in the web page information to be identified; A parsing unit, configured to parse the information blocks of each category according to the category of each information block by using a parsing method corresponding to the category to obtain parsed information blocks of each category; The identification unit is used to identify the target features of the information blocks of each category after parsing, and obtain the target feature information of the web page information to be identified.
11. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, When one or more programs are executed by one or more processors, the one or more processors are caused to implement the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, wherein: The computer program implements the method according to any one of claims 1 to 9 when executed by one or more processors.
13. A computer program product, comprising a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
