Structured data in web pages usually contain important information. Such data are often retrieved from underlying databases and displayed in web pages using fixed templates. Extracting such data enables one to integrate data from multiple web sites and pages to provide value-added services, such as comparative shopping, meta querying and search. However, using a fixed template to blindly extract data from a web page can result in extracted data that is incorrectly labeled and possibly incomplete.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Embodiments of the present invention relate to systems and methods for extracting data content items from web pages. A template is created by labeling data content items of interest associated with a web page and generating a template Document Object Model (DOM) tree based on the labeled web page. DOM trees are also generated for additional web pages that contain data content items for which extraction may be desired. These DOM trees are compared to the template DOM tree to determine alignment there between. The aligned data content items may then be extracted from the additional web pages and indexed, as desired. Labeling the data content items of interest prior to generating a template DOM tree allows for the desired data content items to be specified and more accurately extracted from related and/or similarly structured web pages.
The present invention is described in detail below with reference to the attached drawing figures, wherein:
The subject matter of the present invention is described with specificity herein to meet statutory requirements. However, the description itself is not intended to limit the scope of this patent. Rather, the inventors have contemplated that the claimed subject matter might also be embodied in other ways, to include different steps or combinations of steps similar to the ones described in this document, in conjunction with other present or future technologies. Moreover, although the terms “step” and/or “block” may be used herein to connote different elements of methods employed, the terms should not be interpreted as implying any particular order among or between various steps herein disclosed unless and except when the order of individual steps is explicitly described.
Embodiments of the present invention relate to systems and methods for extracting data content items from web pages. A template is created by labeling data content items of interest associated with a web page and generating a template Document Object Model (DOM) tree based on the labeled web page. DOM trees are also generated for additional web pages that contain data content items for which extraction may be desired. These DOM trees are compared to the template DOM tree to determine alignment there between. The aligned data content items may then be extracted from the additional web pages and indexed, as desired. Labeling the data content items of interest prior to generating a template DOM tree allows for the desired data content items to be specified and more accurately extracted from related and/or similarly structured web pages.
Having briefly described an overview of embodiments of the present invention, an exemplary operating environment suitable for use in implementing embodiments of the present invention is described below.
Referring to the drawings in general, and initially to
The invention may be described in the general context of computer code or machine-useable instructions, including computer-executable instructions such as program components, being executed by a computer or other machine, such as a personal data assistant or other handheld device. Generally, program components including routines, programs, objects, components, data structures, and the like, refer to code that performs particular tasks, or implements particular abstract data types. Embodiments of the present invention may be practiced in a variety of system configurations, including hand-held devices, consumer electronics, general-purpose computers, specialty-computing devices, and the like. Embodiments of the present invention may also be practiced in distributed computing environments where tasks are performed by remote-processing devices that are linked through a communications network.
With continued reference to
Computing device 100 typically includes a variety of computer-readable media. By way of example, and not limitation, computer-readable media may comprise Random Access Memory (RAM); Read Only Memory (ROM); Electronically Erasable Programmable Read Only Memory (EEPROM); flash memory or other memory technologies; CDROM, digital versatile disks (DVD) or other optical or holographic media; magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to encode desired information and be accessed by computing device 100.
Memory 112 includes computer-storage media in the form of volatile and/or nonvolatile memory. The memory may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical-disk drives, and the like. Computing device 100 includes one or more processors that read data from various entities such as memory 112 or I/O components 120. Presentation component(s) 116 present data indications to a user or other device. Exemplary presentation components include a display device, speaker, printing component, vibrating component, etc. I/O ports 118 allow computing device 100 to be logically coupled to other devices including I/O components 120, some of which may be built in. Illustrative components include a microphone, joystick, game advertisement, satellite dish, scanner, printer, wireless device, and the like.
Turning now to
Computing system 200 includes a user device 210, a data content extraction engine 212 and a data store 214, all in communication with one another via a network 216. The network 216 may include, without limitation, one or more local area networks (LANs) and/or wide area networks (WANs). Such networking environments are commonplace in offices, enterprise-wide computer networks, intranets, and the Internet. Accordingly, the network 216 is not further described herein.
The data store 214 may be configured to store information associated with various data content items, as more fully described below. In various embodiments, such information may include one or more text blocks, one or more images, one or more videos, one or more template Document Object Model (DOM) trees, data content item indices, and the like. It will be understood and appreciated by those of ordinary skill in the art that the information stored in the data store 214 may be configurable and may include any information relevant to data content items that may be extracted for indexing. Further, though illustrated as a single, independent component, data store 214 may, in fact, be a plurality of data stores, for instance, a database cluster, portions of which may reside on a computing device associated with the data content extraction engine 212, the user device 210, another external computing device (not shown), and/or any combination thereof.
Each of the data content extraction engine 212 and the user device 210 shown in
As shown in
The receiving component 218 is configured for receiving data content items associated with web pages. Thus, the receiving component 218 is configured for receiving a plurality of web pages, each web page having at least one data content item associated therewith. The received data content items may include a variety of different media types including, but not limited to, text, images, audio content, video content, and any combination thereof. Once received by the receiving component 218, the data content items may be stored, for instance, in association with data store 214, and/or indexed as desired. Indexing is described more fully herein below.
The labeling component 220 is configured for receiving an indication to label at least one data content item associated with a web page (e.g., based upon user input received via a keyboard, stylus, or the like) and for labeling one or more indicated data content items. More specifically, any data content item that one wishes to extract from related or similarly structured web pages may be labeled. Generally, data content items for which indexing is desired to facilitate subsequent use (e.g., searching) are selected or indicated for labeling. For example, data content items associated with a web page that may be indicated for labeling may include the name of a restaurant, the address of the restaurant, and the phone number of the restaurant. Additionally, one or more reviews of the restaurant may be included as labeled data content items associated with the web page. Multimedia data content items desired for labeling may include, by way of example only and not limitation, the title, release date, and description of an image or video, as well as one or more comments associated therewith.
The labeling component 220 is further configured for labeling nodes of DOM trees that are associated with labeled data content items. In embodiments, such nodes may be labeled as repeat nodes to indicate that multiple data content items having similar content and/or structure may be matched therewith, as more fully described below.
The DOM tree generating component 222 is configured for generating DOM trees associated with web pages received by the receiving component 218. DOM is an application programming interface (API) for HTML and XML documents that defines the logical structure of a document, and the way it is accessed. In a web browser, each HTML element (e.g., HTML tags with optional attributes, textual content, and the like) corresponds to a data content item which, in turn, corresponds to a node (or repeat node) in the corresponding DOM tree. Thus, a DOM tree may be generated based on the HTML elements. In accordance with an embodiment of the present invention, once a DOM tree is generated based on the labeled web page, this DOM tree may be used as a template when comparing, aligning, and extracting information from other related and/or similarly structured web pages, as more fully described below. Generating a DOM tree from a web page containing labeled data content items results in a DOM tree having one or more labeled nodes, as more fully described below.
The comparing component 224 is configured for comparing template DOM trees with the DOM trees of additional web pages to determine whether the corresponding web pages are related and/or similarly structured. One skilled in the art will understand and appreciate that various methods may be used to compare a template DOM tree with the DOM trees associated with additional web pages. In one embodiment, such comparison is conducted by determining tree distance measures. Examples of methods to determine such tree distance measures include tree edit distance, alignment distance, isolated-subtree distance, top-down distance, and bottom-up distance. In an embodiment of the invention, an enhanced simple tree matching (ESTM) algorithm is used. In this method, the roots of the DOM trees are first compared to determine whether they contain distinct labels or have visual conflicts. If so, the two trees are determined to not be related or otherwise similarly structured, and the algorithm terminates. Visual conflict may occur when the bounding rectangles of the two roots are so different (e.g., one is twice as large as another or more in either x or y direction) that there is virtually no possibility that they contain similar data content items. This initial step allows for the simplification of later computations.
Next, if the roots contain identical labels and do not have visual conflicts, then the algorithm recursively finds the maximum matching between the same level subtrees of the web pages and saves this data in a matrix. Based on this matrix, a dynamic programming scheme is applied to find the maximum number of pairs between the two trees that match one another. When one of the DOM trees is a template that has been labeled, the determination of matching nodes between the template DOM tree and the DOM tree associated with an additional web page allows for the extraction (and indexing) of the data content item associated with that node, as more fully described below. Various methods of comparison are known and appreciated by those of ordinary skill in the art and, accordingly, are not further described herein.
Further, the comparing component 224 allows for dissymmetric matching. That is, the template DOM tree can have nodes that are labeled as repeat nodes so that they may be matched to multiple nodes in the DOM tree of a related or similarly structured web page. Such is desired, for instance, when a web page contains a plurality of data content items having similar structure and content (e.g., restaurant reviews, video commentaries, and the like). If the labeling component 220 has labeled a node as a repeat node in the template DOM tree, the comparing component 224 will be able to match each of the data content items associated with the web page that align with the repeat node, as more fully described below.
The aligning component 226 is configured for aligning matching nodes of the DOM trees, in particular, for aligning matching nodes of a template DOM tree and the DOM tree associated with another web page. One skilled in the art will understand and appreciate that various methods of data alignment may be used. In an embodiment of the invention, a partial tree alignment method is used, which aligns DOM trees by progressively growing a seed tree. The seed tree is initially the tree with the maximum number of data fields and, in most instances, the seed tree will be the DOM tree associated with the template web page. Then, for each web page determined to be related or similarly structured, an aligning algorithm attempts to locate a matching node in the related web page DOM tree for each node in the template DOM tree. When a match is found for a specific node, a link is created between the node of the related web page DOM tree and the corresponding node in the template DOM tree. If no match can be found for a specific node, then the algorithm attempts to expand the seed tree by inserting the unmatched node into the seed tree. The expanded seed tree is then used in subsequent matching. In this way, the maximum number of data content items may be extracted and indexed, as more fully described below.
The data extraction component 228 is configured for extracting data content items that align with one or nodes of a template DOM tree (generally a labeled node) from a related or similarly structured web page. After the data content items associated with a related or similarly structured web page have been matched utilizing the comparing component 224 and the matching data content items have been aligned utilizing the aligning component 226, the aligned data content items can be extracted from the web pages. By way of example, if the search is a search of local directory data, the local data that has been labeled, such as a business's name, address, and phone number may be extracted from related or similarly structured web pages and indexed for subsequent use, e.g., meta querying and search.
The search request receiving component 230 is configured for receiving a search request for which satisfying content is desired. By way of example, the search request may be received at a user interface as the result of user input. It will be understood and appreciated by those of ordinary skill in the art that multiple methods exist by which a user may input a search request. For instance, search requests may be input, by way of example only, utilizing a keyboard, joystick, trackball, touch-advertisement, or the like. Alternative user interfaces known in the software industry are contemplated by the invention. The search request is typically a user-initiated action or response that is received at a user interface, as discussed above. Examples of a request are a click, click-through, or selection by a user, e.g., human user or robotic user; however, it is understood and appreciated by one of ordinary skill in the art that a request may take any number of forms of indication at a web page. Further, it is contemplated by the present invention that a robotic user may be any non-human operator (i.e., an internet bot, web bot program, virus, robot, web crawler, web spidering program, or any software applications that run automated tasks over the Internet), which is an artificial agent that, by its actions, conveys a sense that it has intent or agency of its own. Even further, a human user is contemplated as being a human, but also, an entity (virtual or physical) acting under the present intent of a human operator. Upon receiving a search request, indexed, extracted data content items may be queried to determine if satisfying content is present.
The presenting component 232 is configured for presenting at least one of search results and information relating to data extraction to a user. Typically such presentation will be by way of display in associations with a user interface. However, other forms of presentation, including audio presentation and audio/video presentation, are contemplated to be within the scope of embodiments hereof.
Turning now to
Subsequently, a DOM tree is generated that is representative of the content associated with the web page, as indicated in block 314 (for instance, utilizing DOM tree generating component 222 of
Next, as indicated at block 315, the nodes of the DOM tree associated with the nodes for which an indication was received are labeled, e.g., utilizing labeling component 220 of
When creating DOM templates for data extraction, list pages, detail pages, or a combination thereof can be used. A list page is a page containing multiple data records. An example of a list page is a web page that lists multiple products with a link to access each product. A detail page is a page containing additional details about the corresponding data record on a list page. So, for example, when the data record of one of the products from the list page above is clicked, a detail page with more information about that specific product results.
As indicated at block 316, before, after, or concurrently, a second web page is received (e.g., utilizing the receiving component 218 of
Once a DOM tree template and a DOM tree of a second web page have been created, a tree matching algorithm is used (e.g., by the comparing component 224 of
As can be seen, embodiments of the present invention relate to one or more computer storage media having computer-executable instructions embodied thereon for performing a method for extracting data content items from web pages. The method includes receiving a first web page having one or more data content items associated therewith; receiving an indication to label at least one of the data content items associated with the first web page; generating a Document Object Model (DOM) tree associated with the first web page, the DOM tree having a node associated with each data content item; labeling the node of the DOM tree associated with the at least one indicated data content item to generate a template DOM tree; comparing the template DOM tree with a DOM tree associated with a second web page to determine alignment there between; and if it is determined that a node of the DOM tree associated with the second web page aligns with the labeled node associated with the template DOM tree, extracting a data content item from the second web page that is associated with the aligned node of the DOM tree.
In an additional embodiment, the present invention relates to a computer system embodied on at least one computer storage media having computer-executable instructions embodied thereon for performing a method for extracting data content items from web pages. The system includes a receiving component configured for receiving a plurality of web pages, each web page having at least one data content item associated therewith; a Document Object Model (DOM) tree generating component configured for generating a DOM tree associated with one or more of the received web pages; a labeling component configured for labeling at least one node associated with a generated DOM tree in accordance with a received labeling indication; a comparing component configured for comparing a first DOM tree having at least one labeled node associated therewith with a second DOM tree; and an extracting component configured for extracting at least one data content item associated with the second DOM tree in accordance with the at least one labeled note associated with the first DOM tree.
Still further, in an additional embodiment, the present invention relates to a method in a computing environment for extracting data content items from a web page, at least two of the data content items having a repeated pattern. The method includes receiving a first web page having a plurality of data content items associated therewith; receiving an indication to label at least two of the plurality of data content items, wherein the at least two of the plurality of data content items have a repeated pattern; generating a Document Object Model (DOM) tree associated with the first web page, the DOM tree having a node associated with each of the plurality of data content items; labeling the nodes of the DOM tree to create a template DOM tree, wherein a node associated with one of the at least two data content items having a repeated pattern is labeled as a repeat node; comparing the template DOM tree with a DOM tree associated with a second web page to determine alignment there between; and if it is determined that a node of the DOM tree associated with the second web page aligns with the labeled node associated with the template DOM tree, extracting one or more data content items from the second web page that are associated with the aligned repeat node of the DOM tree.
The present invention has been described in relation to particular embodiments, which are intended in all respects to be illustrative rather than restrictive. Alternative embodiments will become apparent to those of ordinary skill in the art to which the present invention pertains without departing from its scope.
From the foregoing, it will be seen that this invention is one well adapted to attain all the ends and objects set forth above, together with other advantages which are obvious and inherent to the system and method. It will be understood that certain features and subcombinations are of utility and may be employed without reference to other features and subcombinations. This is contemplated by and is within the scope of the claims.
Number | Name | Date | Kind |
---|---|---|---|
6538673 | Maslov | Mar 2003 | B1 |
6772165 | O'Carroll | Aug 2004 | B2 |
6778703 | Zlotnick | Aug 2004 | B1 |
6810414 | Brittain | Oct 2004 | B1 |
7072984 | Polonsky | Jul 2006 | B1 |
7174327 | Chau | Feb 2007 | B2 |
7176921 | Rising | Feb 2007 | B2 |
20040049737 | Simon Hunt et al. | Mar 2004 | A1 |
20040102958 | Anderson | May 2004 | A1 |
20060242563 | Liu | Oct 2006 | A1 |
20060265712 | Zhou | Nov 2006 | A1 |
20080010056 | Zhou et al. | Jan 2008 | A1 |
20080195626 | Ukigawa et al. | Aug 2008 | A1 |
20090043777 | Wyler et al. | Feb 2009 | A1 |
20090070295 | Otomori et al. | Mar 2009 | A1 |
20090198714 | Wake | Aug 2009 | A1 |
Number | Date | Country | |
---|---|---|---|
20090063500 A1 | Mar 2009 | US |