Patent application title: Learning Objects And Facts From Documents
Inventors:
Shubin Zhao (Jersey City, NJ, US)
IPC8 Class: AG06F1730FI
USPC Class:
707770
Class name: Record, file, and data search and comparisons database query processing distributed search and retrieval
Publication date: 2014-12-18
Patent application number: 20140372478
Abstract:
A system, method, and computer program product for learning objects and
facts from documents. Embodiments of the method comprise selecting a
source object and a source document and identifying a title pattern and a
contextual pattern based on the source object and the source document. A
set of documents matching the title pattern and the contextual pattern
are selected. For each document in the selected set, a name and one or
more facts are identified by applying the title pattern and the
contextual pattern to the document. Objects are identified or created
based on the identified names and associated with the identified facts.Claims:
1. A method comprising: at a computing device having one or more
processors and memory storing one or more programs for execution by the
one or more processors: selecting a source object from a plurality of
objects stored in a fact repository, the source object having an object
name and a fact including an attribute-value pair; selecting a source
document associated with the fact; identifying a title pattern for the
title of the source document based on a first syntax of (i) the title of
the source document, and (ii) the object name of the source object within
the title of the source document; identifying a contextual pattern for
the content of the source document based on a second syntax of (i) the
attribute and (ii) the value related to the attribute-value pair of the
source object, wherein the contextual pattern specifies a structural
pattern with which the attribute-value pair of the source object is
presented; selecting a second document based on a determination that (i)
content of the second document matches the identified contextual pattern
and (ii) a title of the second document matches the title pattern;
identifying a new object name and a new attribute-value pair from the
second document by applying the identified title pattern and the
contextual pattern to the second document; and storing in the fact
repository the new attribute-value pair and a new object having the new
object name.Description:
CROSS-REFERENCE TO RELATED PATENT APPLICATIONS
[0001] This application is a continuation of U.S. Utility patent application Ser. No. 11/941,382, entitled "Learning Objects and Facts From Documents," by Shubin Zhao, filed on Nov. 16, 2007; which is related to U.S. Utility patent application Ser. No. 11/394,610, entitled "Determining Document Subject by Using Title and Anchor Text of Related Documents," by Shubin Zhao, filed on Mar. 31, 2006, the disclosures of which are hereby incorporated by reference in their entirety.
TECHNICAL FIELD
[0002] The disclosed embodiments relate generally to fact databases. More particularly, the disclosed embodiments relate to learning objects and facts from documents.
BACKGROUND
[0003] As computers and networks gain popularity, web-based computer documents ("documents") become a vast source of factual information. Users may look to these documents to get answers to factual questions, such as "what is the capital of Poland" or "what is the birth date of George Washington." The factual information included in these documents may be extracted and stored in a fact database.
[0004] Documents are often generated based on a template. For example, titles of the documents in the wikipedia.org website often follow a pattern of "[SUBJECT]--Wikipedia, the free encyclopedia," where the section in square bracket is substituted with the subject of the page. These documents also often represent facts in a structured format. For example, documents in the wikipedia.org website frequently list facts in a table format.
[0005] Conventionally, objects (or entities) and related facts described in documents are identified and extracted (or learned) by human editors. This approach is insufficient for mass fact extraction because the vast volume of documents and the rapid increase in the number of available documents make it impractical for human editors to perform the task on any meaningful scale.
[0006] Based on the above, there is a need for a way to automatically identify objects and facts in documents.
SUMMARY
[0007] The above and other needs are met by systems, methods, and computer program products that learn objects and facts from documents. Embodiments of the methods comprise selecting a source object and a source document and identifying a title pattern and a contextual pattern based on the source object and the source document. A set of documents matching the title pattern and the contextual pattern are selected. For each document in the selected set, a name and one or more facts are identified by applying the title pattern and the contextual pattern to the document. Objects are identified or created based on the identified names and associated with the identified facts.
BRIEF DESCRIPTION OF THE DRAWINGS
[0008] FIG. 1 shows a system architecture adapted to support one embodiment.
[0009] FIGS. 2(a)-2(d) are block diagrams illustrating embodiments of a data structure for facts within a repository of FIG. 1.
[0010] FIG. 2(e) is a block diagram illustrating an embodiment of an alternative data structure for facts and objects.
[0011] FIG. 3 is a flowchart of an exemplary method for learning objects and facts from a plurality of documents in accordance with one embodiment.
[0012] FIG. 4 is a flowchart illustrating a process to identify a set of documents matching a title pattern and a contextual pattern in accordance with one embodiment.
[0013] FIG. 5 illustrates an example of learning objects and facts from a plurality of documents in accordance with one embodiment.
DESCRIPTION OF EMBODIMENTS
[0014] Embodiments are now described with reference to the figures where like reference numbers indicate identical or functionally similar elements.
System Architecture and Data Structure
[0015] FIG. 1 shows a system architecture 100 adapted to support one embodiment. FIG. 1 shows components used to add facts into, and retrieve facts from a repository 115. The system architecture 100 includes a network 104, through which any number of document hosts 102 communicate with a data processing system 106, along with any number of object requesters 152, 154.
[0016] Document hosts 102 store documents and provide access to documents. A document is comprised of any machine-readable data including any combination of text, graphics, multimedia content, etc. A document may be encoded in a markup language, such as Hypertext Markup Language (HTML), i.e., a web page, in an interpreted language (e.g., JavaScript) or in any other computer readable or executable format. A document can include one or more hyperlinks to other documents. A typical document will include one or more facts within its content. The facts describe entities, such as real-world or fictional people, places, or things.
[0017] A document stored in a document host 102 may be located and/or identified by a Uniform Resource Locator (URL), or Web address, or any other appropriate form of identification and/or location. A document host 102 is implemented by a computer system, and typically includes a server adapted to communicate over the network 104 via networking protocols (e.g., TCP/IP), as well as application and presentation protocols (e.g., HTTP, HTML, SOAP, D-HTML, JAVA®). The documents stored by a host 102 are typically held in a file directory, a database, or other data repository. A host 102 can be implemented in any computing device (e.g., from a PDA or personal computer, a workstation, mini-computer, or mainframe, to a cluster or grid of computers), as well as in any processor architecture or operating system.
[0018] FIG. 1 shows components used to manage facts in a fact repository 115. The data processing system 106 includes one or more importers 108, one or more janitors 110, a build engine 112, a service engine 114, and a fact repository 115 (also called simply a "repository"). Each of the foregoing is implemented, in one embodiment, as software modules (or programs) executed by the processor 116. Importers 108 operate to process documents received from the document hosts, read the data content of documents, and extract facts (as operationally and programmatically defined within the data processing system 106) from such documents. The importers 108 also determine the subject or subjects (i.e., the entity or entities) with which the facts are associated, and extract such facts into individual items of data, for storage in the repository 115. In one embodiment, there are different types of importers 108 for different types of documents, for example, dependent on the format or document type.
[0019] Janitors 110 operate to process facts extracted by the importer 108. This processing can include but is not limited to, data cleansing, object merging, and fact induction. In one embodiment, there are a number of different janitors 110 that perform different types of data management operations on the facts. For example, one janitor 110 may traverse some set of facts in the repository 115 to find duplicate facts (that is, facts that convey the same factual information) and merge them. Another janitor 110 may also normalize facts into standard formats. Another janitor 110 may also remove unwanted facts from the repository 115, such as facts related to pornographic content. Other types of janitors 110 may be implemented, depending on the types of data management functions desired, such as translation, compression, spelling or grammar correction, and the like.
[0020] Various janitors 110 act on facts to normalize attribute names and values, and delete duplicate and near-duplicate facts so an object does not have redundant information. For example, we might find on one page that Britney Spears' birthday is "Dec. 2, 1981" while on another page that her date of birth is "Dec. 2, 1981." Birthday and Date of Birth might both be rewritten as "Birthdate" by one janitor and then another janitor might notice that Dec. 2, 1981 and Dec. 2, 1981 are different forms of the same date. It would choose the preferred form, remove the other fact and combine the source lists for the two facts. As a result, one source page for this fact will contain an exact match of the fact while another source page will contain text that is considered synonymous with the fact.
[0021] The build engine 112 builds and manages the repository 115. The service engine 114 is an interface for querying the repository 115. The service engine 114's main function is to process queries, score matching objects, and return them to the caller but it is also used by the janitor 110.
[0022] The repository 115 stores factual information about entities. The information is extracted from a plurality of documents that are located on document hosts 102. A document from which a particular fact may be extracted is a source document (or "source") of that particular fact. In other words, a source of a fact includes that fact (or a synonymous fact) within its contents.
[0023] The repository 115 contains one or more facts. In one embodiment, the facts are logically organized into "objects," and each object contains a collection of facts associated with a single entity (i.e., real-world or fictional person, place, or thing). Each fact is associated with exactly one object. One implementation for this association includes in each fact an object ID that uniquely identifies the associated object. In this manner, any number of facts may be associated with an individual object, by including the object ID for that object in the facts. In one embodiment, objects themselves are not physically stored in the repository 115, but rather are defined by the set or group of facts with the same associated object ID, as described below. Further details about facts in the repository 115 are described below, in relation to FIGS. 2(a)-2(d).
[0024] Some embodiments operate on the facts and/or objects in different orders than described above. For example, in one embodiment the importer 108 provides facts directly to the build engine 112 and/or repository 115. The janitors 110, in turn, operate on the facts and/or objects in the repository 115. It should also be appreciated that in practice at least some of the components of the data processing system 106 will be distributed over multiple computers, communicating over a network. For example, the repository 115 may be deployed over multiple servers. As another example, the janitors 110 may be located on any number of different computers. For convenience of explanation, however, the components of the data processing system 106 are discussed as though they were implemented on a single computer.
[0025] In another embodiment, some or all of document hosts 102 are located on the data processing system 106 instead of being coupled to the data processing system 106 by a network. For example, the importer 108 may import facts from a database that is a part of or associated with the data processing system 106.
[0026] FIG. 1 also includes components to access the repository 115 on behalf of one or more object requesters 152, 154. Object requesters are entities that request objects from the repository 115. Object requesters 152, 154 may be understood as clients of the system 106, and can be implemented in any computer device or architecture. As shown in FIG. 1, a first object requester 152 is located remotely from system 106, while a second object requester 154 is located in the data processing system 106. For example, in a computer system hosting a blog, the blog may include a reference to an object whose facts are in the repository 115. An object requester 152, such as a browser displaying the blog, will access data processing system 106 so that the information of the facts associated with the object can be displayed as part of the blog web page. As a second example, a janitor 110 or other entity considered to be part of data processing system 106 can function as an object requester 154, requesting the facts of objects from the repository 115.
[0027] FIG. 1 shows that the data processing system 106 includes a memory 107 and one or more processors 116. The memory 107 includes the importers 108, janitors 110, build engine 112, service engine 114, and requester 154, each of which is preferably implemented as instructions stored in memory 107 and executable by processor 116. Memory 107 also includes the repository 115. The repository 115 can be stored in a memory of one or more computer systems or in a type of memory such as a disk. FIG. 1 also includes a computer readable storage medium 118 containing, for example, at least one of importers 108, janitors 110, the build engine 112, the service engine 114, the requester 154, and at least some portions of the repository 115. FIG. 1 also includes one or more input/output devices 120 that allow data to be input and output to and from the data processing system 106. It will be understood that embodiments of the data processing system 106 also include standard software components such as operating systems and the like and further include standard hardware components not shown in the figure for clarity of example.
[0028] FIG. 2(a) shows an example format of a data structure for facts within the repository 115, according to some embodiments. As described above, the repository 115 includes facts 204 describing entities such as real-world and fictional people, places, and things. Each fact 204 includes a unique identifier for that fact, such as a fact ID 210. Each fact 204 includes at least an attribute 212 and a value 214. For example, a fact associated with the entity George Washington may include an attribute of "date of birth" and a value of "Feb. 22, 1732." In one embodiment, all facts are stored as alphanumeric characters since they are extracted from web pages. In another embodiment, facts also can store binary data values. Other embodiments, however, may store fact values as mixed types, or in encoded formats.
[0029] As described above, each fact is associated with an object ID 209 that identifies the object with which the fact is associated. Thus, each fact that describes the same entity (such as George Washington), will have the same object ID 209. In one embodiment, the objects are logical concepts that exist as a collection of facts having the same object ID. In another embodiment, objects are stored as units of data in memory, and include references (for example, pointers or IDs) to the facts associated with the object. The logical data structure of a fact can take various forms; in general, a fact is represented by a tuple that includes a fact ID, an attribute, a value, and an object ID. The storage implementation of a fact can be in any underlying physical data structure.
[0030] FIG. 2(b) shows an example of facts having respective fact IDs of 10, 20, and 30 in the repository 115. Facts 10 and 20 are associated with an object identified by object ID "1." Fact 10 has an attribute of "Name" and a value of "China." Fact 20 has an attribute of "Category" and a value of "Country." Thus, the object identified by object ID "1" has a name fact 205 with a value of "China" and a category fact 206 with a value of "Country." Fact 30 208 has an attribute of "Property" and a value of "Bill Clinton was the 42nd President of the United States from 1993 to 2001." Thus, the object identified by object ID "2" has a property fact with a fact ID of 30 and a value of "Bill Clinton was the 42nd President of the United States from 1993 to 2001." In the illustrated embodiment, each fact has one attribute and one value. The number of facts associated with an object is not limited; thus while only two facts are shown for the "China" object, in practice there may be dozens, even hundreds of facts associated with a given object. Also, the value fields of a fact need not be limited in size or content. For example, a fact about the economy of "China" with an attribute of "Economy" would have a value including several paragraphs of text, numbers, and perhaps even tables of figures. This content can be formatted, for example, in a markup language. For example, a fact having an attribute "original html" might have a value of the original html text taken from the source web page.
[0031] Also, while the illustration of FIG. 2(b) shows the explicit coding of object ID, fact ID, attribute, and value, in practice the content of the fact can be implicitly coded as well (e.g., the first field being the object ID, the second field being the fact ID, the third field being the attribute, and the fourth field being the value). Other fields include but are not limited to: the language used to state the fact (English, etc.), how important the fact is, the source of the fact, a confidence value for the fact, and so on.
[0032] FIG. 2(c) shows an example object reference table 210 that is used in some embodiments. Not all embodiments include an object reference table. The object reference table 210 functions to efficiently maintain the associations between object IDs and fact IDs. In the absence of an object reference table 210, it is also possible to find all facts for a given object ID by querying the repository 115 to find all facts with a particular object ID. While FIGS. 2(b) and 2(c) illustrate the object reference table 210 with explicit coding of object and fact IDs, the table also may contain just the ID values themselves in column or pair-wise arrangements.
[0033] FIG. 2(d) shows an example of a data structure for facts within the repository 115, according to some embodiments, showing an extended format of facts. In this example, the fields include an object reference link 216 to another object. The object reference link 216 can be an object ID of another object in the repository 115, or a reference to the location (e.g., table row) for the object in the object reference table 210. The object reference link 216 allows facts to have as values other objects. For example, for an object associated with the entity "United States," there may be a fact with the attribute of "president" and the value of "George W. Bush," with "George W. Bush" being an object having its own facts in the repository 115. In some embodiments, the value field 214 stores the name of the linked object and the link 216 stores the object identifier of the linked object. Thus, this "president" fact would include the value 214 of "George W. Bush", and an object reference link 216 that contains the object ID for the "George W. Bush" object. In some other embodiments, facts 204 do not include a link field 216 because the value 214 of a fact 204 may store a link to another object.
[0034] Each fact 204 also may include one or more metrics 218. A metric provides an indication of the quality of the fact. In some embodiments, the metrics include a confidence level and an importance level. The confidence level indicates the likelihood that the fact is correct. The importance level indicates the relevance of the fact to the object, compared to other facts for the same object. The importance level may optionally be viewed as a measure of how vital a fact is to an understanding of the entity associated with the object.
[0035] Each fact 204 includes a list of one or more sources 220 that include the fact and from which the fact was extracted. Each source may be identified by a URL, or Web address, or any other appropriate form of identification and/or location, such as a unique document identifier.
[0036] The facts illustrated in FIG. 2(d) include an agent field 222 that identifies the importer 108 that extracted the fact. For example, the importer 108 may be a specialized importer that extracts facts from a specific source (e.g., the pages of a particular web site, or family of web sites) or type of source (e.g., web pages that present factual information in tabular form), or an importer 108 that extracts facts from free text in documents throughout the Web, and so forth.
[0037] Some embodiments include one or more specialized facts, such as a name fact 207 and a property fact 208. A name fact 207 is a fact that conveys a name for the entity associated with the object in which the fact is included. A name fact 207 includes an attribute 224 of "name" and a value, which is the name of the associated entity. For example, for an object associated with country Spain, a name fact would have the value "Spain." A name fact 207, being a special instance of a general fact 204, includes the same fields as any other fact 204; it has an attribute, a value, a fact ID, metrics, sources, etc. The attribute 224 of a name fact 207 indicates that the fact is a name fact, and the value is the actual name. The name may be a string of characters. An object may have one or more associated name facts, as many entities can have more than one name. For example, an object associated with Spain may have associated name facts conveying the country's common name "Spain" and the official name "Kingdom of Spain." As another example, an object associated with the U.S. Patent and Trademark Office may have associated name facts conveying the agency's acronyms "PTO" and "USPTO" as well as the official name "United States Patent and Trademark Office." If an object does have more than one associated name fact, one of the name facts may be designated as a primary name and other name facts may be designated as secondary names, either implicitly or explicitly. The name facts associated with an object are also called synonymous names of the object.
[0038] A property fact 208 is a fact that conveys a statement about the entity associated with the object. Property facts are generally used for summary information about an object. A property fact 208, being a special instance of a general fact 204, also includes the same fields (such as attribute, value, fact ID, etc.) as other facts 204. The attribute field 226 of a property fact 208 indicates that the fact is a property fact (e.g., attribute is "property") and the value is a string of text that conveys the statement of interest. For example, for the object associated with Bill Clinton, the value of a property fact may be the text string "Bill Clinton was the 42nd President of the United States from 1993 to 2001." Some objects may have one or more associated property facts while other objects may have no associated property facts. It should be appreciated that the data structures shown in FIGS. 2(a)-2(d) and described above are merely exemplary. The data structure of the repository 115 may take on other forms. Other fields may be included in facts and some of the fields described above may be omitted. Additionally, each object may have additional special facts aside from name facts and property facts, such as facts conveying a type or category (for example, person, place, movie, actor, organization, etc.) for categorizing the entity associated with the object. In some embodiments, an object's name(s) and/or properties may be represented by special records that have a different format than the general fact records 204.
[0039] As described previously, a collection of facts is associated with an object ID of an object. An object may become a null or empty object when facts are disassociated from the object. A null object can arise in a number of different ways. One type of null object is an object that has had all of its facts (including name facts) removed, leaving no facts associated with its object ID. Another type of null object is an object that has all of its associated facts other than name facts removed, leaving only its name fact(s). Alternatively, the object may be a null object only if all of its associated name facts are removed. A null object represents an entity or concept for which the data processing system 106 has no factual information and, as far as the data processing system 106 is concerned, does not exist. In some embodiments, facts of a null object may be left in the repository 115, but have their object ID values cleared (or have their importance set to a negative value). However, the facts of the null object are treated as if they were removed from the repository 115. In some other embodiments, facts of null objects are physically removed from the repository 115.
[0040] FIG. 2(e) is a block diagram illustrating an alternate data structure 290 for facts and objects in accordance with embodiments of the invention. In this data structure, an object 290 contains an object ID 292 and references or points to facts 294. Each fact includes a fact ID 295, an attribute 297, and a value 299. In this embodiment, an object 290 actually exists in memory 107.
[0041] As described above, an object may explicitly exist in the repository 115, or it may exist merely as a collection of facts with a common object ID. Reference is made to particular objects for the purposes of illustration; one of skill in the art will recognize that the systems and methods described herein are applicable to a variety of implementations and that such references are not limiting. When reference is made to a fact being associated with an object, it should be understood that in at least one embodiment a fact is associated with an object by sharing a common object ID with other facts. For example, a fact could be associated with an object of a given type by sharing a common object ID at least with a type fact indicating the given type (or as another example, with a category fact indicating a particular category of object). Furthermore, in various embodiments, facts and objects can be stored in a variety of structures, such as fact and/or object repositories. When reference is made herein to the repository 115, it should be understood that various embodiments may store facts and/or objects in a variety of data structures.
Overview of Methodology
[0042] Referring now to FIG. 3, there is shown a flow diagram illustrating a method 300 for learning (or extracting) objects and facts from a plurality of documents in accordance with one embodiment. Other embodiments perform steps of the method 300 in different orders and/or perform different or additional steps than the ones shown in FIG. 3. The steps of the process illustrated in FIG. 3 may be implemented in software, hardware, or a combination of hardware and software.
[0043] In one embodiment, the steps of the method 300 may be performed by one or more importers 108 as shown in FIG. 1, although one skilled in the art will recognize that the method could be performed by systems having different architectures as well. The importers 108 can perform multiple instances of the steps of the method 300 concurrently and/or perform steps in parallel.
[0044] The flowchart shown in FIG. 3 will now be described in detail. The process commences with a plurality of objects and a plurality of documents. The plurality of objects can be objects in the fact repository 115. The plurality of documents can be documents in the document hosts 102.
[0045] As described above in relation to FIGS. 2(a)-2(e), an object is associated with one or more facts. Each fact has an attribute and a value (hereinafter called an "attribute-value pair"). For example, an object representing Canada can have a fact with an attribute "name" and a value of the attribute "Canada". A fact with the attribute "name" is called a name fact, and its value is called an object name. The object representing Canada can also have a fact with an attribute-value pair of "Capital--Ottawa", wherein "Capital" is the attribute and "Ottawa" is the value.
[0046] As described above, a document may be encoded in a markup language, such as the Hypertext Markup Language (HTML), i.e., a web page, in an interpreted language (e.g., JavaScript) or in any other computer readable or executable format. A document can have one or more titles. One example is a web page encoded in HTML with content about the first President of the United States, George Washington.
[0047] The importer 108 selects 310 a source object from the plurality of objects. In one embodiment, the importer 108 gives priority to objects associated with more facts when selecting 310 the source object. In another embodiment, each of the plurality of objects has equal chance of being selected 310.
[0048] The importer 108 selects 320 a source document associated with a fact of the source object from the plurality of documents. As described above in relation to FIG. 2(d), each fact includes a list of sources 220 from which the fact was extracted. In one embodiment, the importer 108 selects 320 the source document from sources of a fact associated with the source object. In one embodiment, the importer 108 gives priority to documents from reputable websites (e.g., the Encyclopedia Britannica Online) when selecting 320 the source document.
[0049] Alternatively, the importer 108 searches for documents containing an object name of the source object and one or more of its facts (or attribute-value pairs) in the plurality of documents. The importer 108 then selects 320 the source document from the search result. For example, for an object with object name "China" and attribute-value pair "Capital--Beijing," the importer 108 can search for documents containing "China," "Capital," and "Beijing." The importer 108 may specify search criteria such as whether the object name matches document titles and whether the rest of the search terms match document contents. The search may be performed using a search engine, such as a Web search engine.
[0050] The importer 108 identifies 330 a title pattern and a contextual pattern based on the source document and the source object. The title pattern is intended to reflect a relationship between a title of the source document (hereinafter called "the document title") and the object name of the source object ("the source object name"). In one embodiment, the importer 108 determines whether the document title contains the source object name as a substring. A substring is a contiguous sequence of characters taken from a string. If the document title does not contain the source object name as a substring, the importer 108 repeats the above process and selects 320 another document as the source document.
[0051] The importer 108 identifies 330 the title pattern by comparing the document title with the source object name. In one embodiment, a title pattern comprises a prefix section, a body section, and a suffix section. A title pattern can be expressed as "%[PREFIX SECTION]% && %[SUFFIX SECTION]%", where "&&" represents the source object name. For example, the title pattern of a document title "Summary for Microsoft CP--Yahoo! Finance" and an object name "Microsoft CP" is "%Summary for% && %--Yahoo! Finance%". In this example, the prefix section is "Summary for" and the suffix section is "--Yahoo! Finance". The body section of the document title is the same as the object name, "Microsoft CP."
[0052] The contextual pattern is a structural pattern in which the source document displays (or presents) facts (or attribute-value pairs). For example, a document can display facts of an object in a table (the contextual pattern) such that the attribute-value pair for a fact appears in the same row. In one embodiment, the importer 108 identifies 330 the contextual pattern by identifying language markups (e.g., HTML markups (or tags)) that define the structural pattern. For example, a web page may contain a list of attributes and values with HTML markup as the following:
TABLE-US-00001 . . . <title> China - Country Facts </title> . . . <table border=''1''> <tr> <td> Population </td> < td> 1.3 billion </td> </tr> <tr> <td> Capital </td> <td> Beijing </td> </tr> <tr> <td> Largest City </td> <td> Shanghai </td> </tr> </table> . . .
The above web page contains facts about China such as that its capital is Beijing. The HTML markups indicate that the facts should be presented in a table format (e.g., by a web browser).
[0053] The importer 108 can identify 330 the contextual pattern in the source document by matching attribute-value pairs of the source object with content of the source document. The contextual pattern contains the HTML markup (or tag) sequence associated with the matching attribute-value. For example, for an attribute-value pair "Capital--Beijing," the importer 108 may identify 330 the following contextual pattern in the above web page: "<tr><td> $$ </td><td> .English Pound..English Pound.</td></tr>". In this example, "$$" indicates a text block for an attribute and ".English Pound..English Pound." indicates a text block of a corresponding value. The importer 108 may identify 330 multiple contextual patterns in a source document, with each pattern corresponding with a fact of the source object.
[0054] The importer 108 selects 340 a set of documents from the plurality of documents based on the title pattern and the contextual pattern. One embodiment of the process for the importer 108 to select 340 the set of documents is further illustrated in the flowchart shown in FIG. 4. For each of the plurality of documents, the importer 108 starts the process by applying 410 the title pattern to a title of the document. If the importer 108 determines 420 that the title does not match the title pattern, it determines that the document should not be added to the set and repeats the process for the next document. Otherwise, the importer 108 applies 430 the contextual pattern to the content of the document. If the importer 108 determines 440 that there is no match for the contextual pattern, it determines that the document should not be added to the set and repeats the process for the next document. If a title of the document matches the title pattern and the content of the document matches the contextual pattern, the importer 108 adds 450 the document to the set.
[0055] In one embodiment, the importer 108 only examines documents within the same domain as the source document when selecting 340 the set of documents. A domain is a group of computers and devices that share a common part of an Internet Protocol (IP) address that identifies (or locates) an organization (or entity) on the Internet. All documents from computers and devices in the group are said to be from the same domain. Documents from the same domain may be stored in one or multiple document hosts 102. The set of documents can include the source document.
[0056] Limiting the set of documents to be within the same domain as the source document can be advantageous, especially when the size of the plurality of documents is large. The computational cost of comparing documents with the title pattern and the contextual pattern can become unmanageable as the number of documents grows. Also, because documents within the same domain as the source document are more likely to share the same style as the source document, they are more likely to match the title pattern and the contextual pattern than documents from other domains.
[0057] As described above, the importer 108 can identify 330 multiple contextual patterns. In one embodiment, the importer 108 adds 450 a document into the set of documents as long as the document matches the title pattern and any one of the multiple contextual patterns. In another embodiment, the importer 108 adds 450 a document into the set only when the document matches the title pattern and all of the identified contextual patterns.
[0058] Referring back to FIG. 3, for each document in the selected set, the importer 108 identifies 350 a name and one or more attribute-value pairs from the document. The importer 108 identifies 350 the name by applying the title pattern to the title of the document. The importer 108 identifies 350 one or more attribute-value pairs by applying the contextual pattern to the content of the document.
[0059] The identified name tends to be an object name for an object (or entity) described in the document. As described above, the source document contains facts of the source object, and therefore describes the source object. Further, the source object name can be extracted from a title of the source document using the title pattern. Because the title pattern also matches titles of the documents in the selected set, it follows that these documents tend to follow a consistent naming convention (or protocol or standard). For example, titles of web pages containing company profile in Yahoo! finance website follow a common pattern of "%COMPANY NAME% Company Profile--Yahoo! Finance". Therefore, the name identified by applying the title pattern to a title of the document tends to be an object name for an object described in the document.
[0060] Similarly, the identified attribute-value pairs tend to be facts for the object described in the document. As described above, the source document contains facts of the source object matching the contextual pattern. Same as the source document, documents in the selected set match the title pattern and the contextual pattern. Therefore, these documents tend to share a style or format (e.g., displaying facts in a table or list). Because facts of the source object can be extracted from the source document using the contextual pattern, it follows that the attribute-value pairs identified by applying the contextual pattern to content of the document tend to be facts for the object described in the document.
[0061] The importer 108 can repeatedly apply the contextual pattern to content of the document to identify 350 (or extract or learn) attribute-value pairs. For example, if the contextual pattern identifies a table entry, the importer 108 may extract attribute-value pairs from that table entry and nearby table entries that match the contextual pattern. In one embodiment, the importer 108 extracts attribute-value pairs that are proximate to each other. By applying such a limitation, the importer 108 can be sure that the identified attribute-value pairs are likely from the same structure (e.g., the same table or list). Alternatively, the importer 108 can parse the document to identify 350 attribute-value pairs from all structures that match the contextual pattern.
[0062] In one embodiment, the importer 108 examines the quality of the identified attribute-value pairs by matching their attributes with a group of valid attributes (called "a white attribute list"). The identified contextual pattern may be general (e.g., a table row, a list item), and therefore the attribute-value pairs identified by applying the general contextual pattern may be over-inclusive. If the match fails to meet a certain threshold value (percentage or absolute value), the importer 108 determines that the identified attribute-value pairs are low in quality, and may disregard them entirely or only keep those that match. The white attribute list may include attributes identified in the source document and/or attributes collected from other sources (e.g., compiled by human editors). Similarly, the importer 108 may match the identified attribute-value pairs with a group of invalid attributes (called "a black attribute list"), and disregard them if the match exceeds a certain threshold value.
[0063] For each document in the selected set, the importer 108 associates 360 the attribute-value pairs identified in the document with an object with the identified name. In one embodiment, the importer 108 creates a new object, assigns the new object with the identified name, and associates 360 it with the identified attribute-value pairs. The importer 108 then passes the newly created object to a janitor 110 to incorporate the object into the fact repository 115. In one embodiment, the janitor 110 searches in the fact repository 115 for an object associated with the identified name. If no such object exists, the janitor 110 adds the newly created object into the fact repository 115. Otherwise, the janitor 110 merges the newly created object with the existing object in the fact repository 115. If the janitor 110 determines that the existing object does not contain some of the attribute-value pairs identified in the document, it adds these attribute-value pairs into the fact repository 115 and associates 360 them with the existing object. If the existing object and the newly created object contain duplicated attribute-value pairs (e.g., same attribute and same value), the janitor 110 can optionally add the document as a source of this fact of the existing object. If the existing object and the newly created object contain inconsistent attribute-value pairs (e.g., same attribute but different value), the janitor 110 can determine a confidence value for each of the attribute-value pairs, and set the one with higher value as the value of the fact for the existing object. In other embodiments, the importer 108 only creates a new object if no object associated with the identified name is located in the fact repository 115.
[0064] In one embodiment, the fact repository 115 can have objects associated with the same object name (or name fact value). For example, two objects can both have the name "New York," one representing the New York City and the other representing a movie with the title "New York." In order to locate the right object as described in the document, and not an object that happens to share the same object name, the janitor 110 searches in the fact repository 115 for an object associated with the identified name and at least one identified attribute-value pair, and merges the newly created object with the object found in the manner detailed above.
[0065] It is noted that in alternative embodiments, the importer 108 (or the janitor 110) may apply some normalization rules to the identified names to standardize its format before identifying corresponding objects. The importer 108 may also apply these normalization rules to the identified attribute-value pairs before associating 360 them with objects. Examples of the normalization rules include removal of punctuation, such as removing commas in a string, conversion of uppercase characters in a string to corresponding lowercase characters, such as from "America" to "america," and stop word removal, such as removing stop words such as "the" and "of" from a string. For example, after applying the above normalization rules, an object name of "Charles Chaplin" becomes "charles chaplin".
[0066] In one embodiment, the importer 108 (or the janitor 110) compares the identified names with content of a black list. The black list contains texts that are not entity names (e.g., adjectives such as "beautiful", and stop words such as "the"). Therefore, if there are matches between the identified name and the black list, the importer 108 determines that this name is not a valid entity name, and therefore does not create an object for it.
[0067] In one embodiment, the importer 108 (or the janitor 110) compares the learned object names with content of a white list. The white list contains some entity names (e.g., "United Nation," "John Lennon"). The white list can be compiled by human editors or extracted from reputable sources (e.g., the Encyclopedia Britannica Online). Therefore, if there are matches between the identified name and the white list, the importer 108 determines that the identified name is a proper object name.
[0068] The importer 108 can repeat the process described above for a different source object and/or a different source document. As a result, the importer 108 can learn objects and associated facts from the plurality of documents.
Example Process
[0069] The method 300 is further illustrated by an example shown in FIG. 5. As illustrated in FIG. 5, an object O1 has an attribute-value pair of "name--George Washington," and an attribute-value pair of "Born--Feb. 22, 1732." The source of both facts (or attribute-pairs) is "http://en.wikipedia.org/wiki/George_washington."
[0070] FIG. 5 also shows a plurality of documents D1-D5. Documents D1-D5 are all from Wikipedia.org domain 501. Document D1 (hereinafter called "D1") is entitled "George Washington--Wikipedia, the free encyclopedia." Content of D1 includes the following structured text:
TABLE-US-00002 Born Feb. 22, 1732 Died Dec. 14, 1799 Spouse Martha Dandridge Custis Washington
Document D2 ("D2") is entitled "Canada--Wikipedia, the free encyclopedia." Content of D2 includes the following structured text:
TABLE-US-00003 Capital Ottawa Area 9,984,670 km2 GDP $1.105 trillion
Document D3 ("D3") is entitled "Help:Contents--Wikipedia, the free encyclopedia" and does not contain text structured as displayed above. Document D4 ("D4") is entitled "Isaac Asimov--Wikipedia, the free encyclopedia." Content of D4 includes the following structured text:
TABLE-US-00004 Born Jan. 2, 1920 Died Apr. 6, 1992
Document D5 ("D5") is entitled "Fundraising--Wikimedia Foundation" and does not contain text structured as displayed above.
[0071] Content of documents D1-D5 can be organized in HTML structures such as tables and lists in order to be displayed as structured text as illustrated in FIG. 5. For example, the HTML source code of D1 may contain the following:
TABLE-US-00005 . . . <title> George Washington - Wikipedia, the free encyclopedia </title> . . . <li><b> Born </b> February 22, 1732 </li> <li><b> Died </b> December 14, 1799 </li> <li><b> Spouse </b> Martha Dandridge Custis Washington </li> . . .
As shown above, content of D1 is organized as a list, and thus appears as structured text to viewers.
[0072] The importer 108 selects 310 object O1 as the source object. Because the source of both facts associated with O1 is "http://en.wikipedia.org/wiki/George_washington," the URL of D1, the importer 108 selects 320 D1 as the source document.
[0073] The importer 108 identifies 330 a title pattern by comparing the title of the source document D1 ("George Washington--Wikipedia, the free encyclopedia") with the object name of the source object O1 ("George Washington"). The importer 108 determines that the prefix section of the title pattern is empty and the suffix section is "--Wikipedia, the free encyclopedia". Therefore, the identified title pattern is "%% && %--Wikipedia, the free encyclopedia%".
[0074] The importer 108 identifies 330 a contextual pattern by matching an attribute-value pair of the source object O1 (Born--Feb. 22, 1732) with the content of the source document D1 (" . . . <li><b> Born </b> Feb. 22, 1732 </li> . . . "). The importer 108 identifies 330 the following contextual pattern: "<li><b>$$</b>.English Pound..English Pound.</li>".
[0075] The importer 108 selects 340 a set of documents based on the identified title pattern ("%% && %--Wikipedia, the free encyclopedia%") and the identified contextual pattern ("<li><b>$$</b>.English Pound..English Pound.</li>"). The importer 108 applies 410 the title pattern to titles of D1-D5 and determines 420 that titles of D1-D4 match with the title pattern. The importer 108 applies 430 the contextual pattern to contents of D1-D4, and determines 440 that the contents of D1, D2, and D4 match with the contextual pattern. As a result, the importer 108 adds 450 D1, D2, and D4 to the selected set of documents. It is noted that the selected set includes the source document D1.
[0076] The importer 108 applies the identified title pattern ("%% && %--Wikipedia, the free encyclopedia%") and contextual pattern ("<li><b>$$</b>.English Pound..English Pound.</li>") to each document in the selected set (D1, D2, and D4) to identify 350 names and attribute-value pairs. For D1, the importer 108 identifies 350 the name "George Washington" and attribute value pairs "Born--Feb. 22, 1732," "Died--Dec. 14, 1799," and "Spouse--Martha Dandridge Custis Washington." For D2, the importer 108 identifies the name "Canada" and attribute-value pairs "Capital--Ottawa," "Area--9,984,670 km2," and "GDP--$1.105 trillion." Similarly, for D4, the importer 108 identifies the name "Isaac Asimov" and attribute-value pairs "Born--Jan. 2, 1920" and "Died--Apr. 6, 1992."
[0077] The importer 108 (or the janitor 110) identifies (or creates) objects with the identified names and associates 360 the identified attribute-value pairs with the objects. For D1, because O1 is already associated with the attribute-value pair "Born--Feb. 22, 1732," the importer 108 (or the janitor 110) associates 360 the attribute-value pairs "Died--Dec. 14, 1799" and "Spouse--Martha Dandridge Custis Washington" with O1 and adds D1 as their source. For D2, the importer 108 (or the janitor 110) creates an object with object name "Canada," associates 360 it with attribute-value pairs "Capital--Ottawa," "Area--9,984,670 km2," and "GDP--$1.105 trillion," and adds D2 as their source. Similarly, for D4, the importer 108 (or the janitor 110) creates an object with object name "Isaac Asimov," associates 360 it with attribute-value pairs "Born--Jan. 2, 1920" and "Died--Apr. 6, 1992," and adds D4 as their source.
Alternative Embodiments
[0078] In one embodiment, instead of selecting 320 a source document based on facts of the identified source object, the importer 108 can first select a source document and then select a source object based on the subject of the source document. For example, the importer 108 can first identify a title pattern of the selected source document, determine an object name based on the document title and the title pattern, and select a source object associated with the object name. The importer 108 can then identify 330 a contextual pattern as described above. If the importer 108 fails to select such a source object or fails to identify 330 a contextual pattern, it can repeat the process and select a different source document.
[0079] The importer 108 can identify a title pattern of the source document by analyzing the document title of the source document and anchor texts of documents linking to the source document. Detailed description and embodiments of identifying a title pattern for the source document can be found in U.S. patent application Ser. No. 11/394,610, entitled "Determining Document Subject by Using Title and Anchor Text of Related Documents," filed on Mar. 31, 2006, the disclosure of which is hereby incorporated by reference in its entirety.
[0080] It is noted that the importer 108 can identify 330 more than one contextual pattern for the source document and the source object. For example, some of the attribute-value pairs may be in a list in the source document, and others may be in a table in the source document. In some embodiments, the importer 108 can select 340 a set of documents for each of the identified contextual patterns.
[0081] It should be appreciated that the process described above may be performed at another time for other purposes, such as learning images and other media data from semi-structured text and verifying the quality of the plurality of documents. The process may be performed as needed or at scheduled intervals. Furthermore, the process may be performed for other objects in the fact repository 115.
[0082] Reference in the specification to "one embodiment" or to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiments is included in at least one embodiment of the invention. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment.
[0083] Some portions of the above are presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here, and generally, conceived to be a self-consistent sequence of steps (instructions) leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical, magnetic or optical signals capable of being stored, transferred, combined, compared and otherwise manipulated. It is convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like. Furthermore, it is also convenient at times, to refer to certain arrangements of steps requiring physical manipulations of physical quantities as modules or code devices, without loss of generality.
[0084] It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussion, it is appreciated that throughout the description, discussions utilizing terms such as "processing" or "computing" or "calculating" or "determining" or "displaying" or "determining" or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system memories or registers or other such information storage, transmission or display devices.
[0085] Certain aspects of the present invention include process steps and instructions described herein in the form of an algorithm. It should be noted that the process steps and instructions of the present invention can be embodied in software, firmware or hardware, and when embodied in software, can be downloaded to reside on and be operated from different platforms used by a variety of operating systems.
[0086] The present invention also relates to an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes, or it may comprise a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a computer readable storage medium, such as, but is not limited to, any type of disk including floppy disks, optical disks, CD-ROMs, magnetic-optical disks, read-only memories (ROMs), random access memories (RAMs), EPROMs, EEPROMs, magnetic or optical cards, application specific integrated circuits (ASICs), or any type of media suitable for storing electronic instructions, and each coupled to a computer system bus. Furthermore, the computers referred to in the specification may include a single processor or may be architectures employing multiple processor designs for increased computing capability.
[0087] The algorithms and displays presented herein are not inherently related to any particular computer or other apparatus. Various general-purpose systems may also be used with programs in accordance with the teachings herein, or it may prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will appear from the description below. In addition, the present invention is not described with reference to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any references below to specific languages are provided for disclosure of enablement and best mode of the present invention.
[0088] While the invention has been particularly shown and described with reference to a preferred embodiment and several alternate embodiments, it will be understood by persons skilled in the relevant art that various changes in form and details can be made therein without departing from the spirit and scope of the invention.
[0089] Finally, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, the disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is set forth in the following claims.
User Contributions:
Comment about this patent or add new information about this topic: