People purchase products from many different merchants using a variety of different payment options. The transactions for these purchases typically are confirmed by physical in-store receipts or by electronic messages addressed to the purchasers' messaging accounts (e.g., a purchaser's electronic mail account). The large number and diversity of confirmation types makes it difficult for people to track their purchases and obtain a comprehensive understanding of their purchase histories.
In addition, the large diversity of merchants from which people purchase products makes it difficult for merchants to obtain sufficient purchase history data to develop accurate customer profiles. Even assuming that a person uses a common identifier (e.g., a loyalty card or credit card) for all his or her purchases, these purchases typically are tracked only by the merchant that issued the identifier to the customer. This lack of information about the customer limits a merchant's ability to effectively target its promotions in ways that will encourage them to purchase the merchant's product offerings.
The large diversity of merchants also leads to a large diversity in confirmation formats, making it difficult and expensive to extract product purchase information from purchase confirmations.
In the following description, like reference numbers are used to identify like elements. Furthermore, the drawings are intended to illustrate major features of exemplary embodiments in a diagrammatic manner. The drawings are not intended to depict every feature of actual embodiments nor relative dimensions of the depicted elements, and are not drawn to scale.
A “product” is any tangible or intangible good or service that is available for purchase or use.
“Product purchase information” is information related to the purchase of a product. Product purchase information includes, for example, purchase confirmations (e.g., receipts), product order information (e.g., merchant name, order number, order date, product description, product name, product quantity, product price, sales tax, shipping cost, and order total), and product shipping information (e.g., billing address, shipping company, shipping address, estimated shipping date, estimated delivery date, and tracking number).
An “electronic message” is a persistent text based information record sent from a sender to a recipient between physical network nodes and stored in non-transitory computer-readable memory. An electronic message may be structured message (e.g., a hypertext markup language (HTML) message that includes structured tag elements) or unstructured (e.g., a plain text message).
A “computer” is any machine, device, or apparatus that processes data according to computer-readable instructions that are stored on a computer-readable medium either temporarily or permanently. A “computer operating system” is a software component of a computer system that manages and coordinates the performance of tasks and the sharing of computing and hardware resources. A “software application” (also referred to as software, an application, computer software, a computer application, a program, and a computer program) is a set of instructions that a computer can interpret and execute to perform one or more specific tasks. A “data file” is a block of information that durably stores data for use by a software application.
The term “computer-readable medium” (also referred to as “memory”) refers to any tangible, non-transitory device capable storing information (e.g., instructions and data) that is readable by a machine (e.g., a computer). Storage devices suitable for tangibly embodying such information include, but are not limited to, all forms of physical, non-transitory computer-readable memory, including, for example, semiconductor memory devices, such as random access memory (RAM), EPROM, EEPROM, and Flash memory devices, magnetic disks such as internal hard disks and removable hard disks, magneto-optical disks, DVD-ROM/RAM, and CD-ROM/RAM.
A “network node” (also referred to simply as a “node”) is a physical junction or connection point in a communications network. Examples of network nodes include, but are not limited to, a terminal, a computer, and a network switch. A “server node” is a network node that responds to requests for information or service. A “client node” is a network node that requests information or service from a server node.
As used herein, the term “includes” means includes but not limited to, the term “including” means including but not limited to. The term “based on” means based at least in part on.
The examples that are described herein provide improved systems and methods for extracting product purchase information from electronic messages transmitted between physical network nodes to convey product purchase information to designated recipients by solving practical problems that have arisen as a result of the proliferation of different electronic message formats used by individual merchants and across different merchants and different languages. These examples provide a product purchase information extraction service that is able to extract product purchase information from electronic messages with high precision across a wide variety of electronic message formats. In this regard, these examples are able to automatically learn the structures and semantics of different message formats, which accelerates the ability to support new message sources, new markets, and different languages.
By these improved systems and methods, product purchase information can be extracted from a wide variety of electronic message types and aggregated to provide individuals with enhanced tools for visualizing and organizing their purchase histories and to provide merchants and other organizations improved cross-merchant purchase graph information across different consumer demographics to enable targeted and less intrusive advertising and other marketing strategies. These improved systems and methods can be deployed to monitor consumer purchases over time to obtain updated purchase history information that can be aggregated for an individual consumer or across many consumers to provide actionable information that directs consumer behavior and organizational marketing strategies. For example, these improved systems and methods can organize disparate product purchase information extracted from individual electronic messages into actionable data that can be used by a consumer to organize her prior purchases and enhance her understanding of her purchasing behavior and can be used by merchants and other organizations to improve the accuracy and return-on-investment of their marketing campaigns.
In specific examples, these systems and methods include improved special purpose computer apparatus programmed to build a structure learning parser that automatically learns the structure of an electronic message and accurately parses product purchase information from the electronic message. These systems and methods also include improved special purpose computer apparatus programmed to function as a structure learning parser that automatically learns the structure of an electronic message and accurately parses product purchase information from the electronic message.
The network 11 may include any of a local area network (LAN), a metropolitan area network (MAN), and a wide area network (WAN) (e.g., the internet). The network 11 typically includes a number of different computing platforms and transport facilities that support the transmission of a wide variety of different media types (e.g., text, voice, audio, and video) between network nodes 14 and the product provider 18. Each of the product purchase information provider 12, the product merchants 14, the product delivery providers 16, the message providers 18, and the product purchase information consumers 20 typically connects to the network 11 via a network node (e.g., a client computer or a server computer) that includes a tangible computer-readable memory, a processor, and input/output (I/O) hardware (which may include a display).
One or more of the product merchants 14 typically allow consumers and businesses to directly purchase products over the network 22 using a network enabled software application, such as a web browser. One or more of the of the product merchants 14 also may allow consumers and businesses to purchase products in a physical retail establishment. In either case, after a product purchase transaction has been completed, a product merchant may send a product purchase confirmation electronic message to a messaging address associated with the purchaser. The product purchase confirmation message may include, for example, product order information such as merchant name, order number, order date, product description, product name, product quantity, product price, sales tax, shipping cost, and order total. The product merchant also may arrange to have the product delivered by one of the product delivery providers 16. Depending on the type of product that was purchased, the product delivery provider 16 may deliver the product to the purchaser physically or electronically. In either case, the product delivery provider 16 or the product merchant 14 may send a delivery notification electronic message to the messaging address associated with the purchaser. The delivery notification electronic message may include, for example, product shipping information such as product order information, billing address, shipping company, shipping address, estimated shipping date, estimated delivery date, and tracking number.
In general, the purchaser's messaging address may be any type of network address to which electronic messages may be sent. Examples of such messaging addresses include electronic mail (e-mail) addresses, text messaging addresses (e.g., a sender identifier, such as a telephone number or a user identifier for a texting service), a user identifier for a social networking service, and a facsimile telephone number. The product purchase related electronic messages typically are routed to the purchaser through respective ones of the message providers 18 associated with the purchaser's messaging address. The message providers 18 typically store the purchasers' electronic messages in respective message folder data structures in a database.
The product purchase information provider 12 extracts product purchase information from the electronic messages of product purchasers. In some examples, the product purchase information provider 12 obtains authorization from the product purchasers to access their respective message folders that are managed by the message providers 18. In other examples, product purchasers allow the product purchase information provider 12 to access their electronic messages that are stored on their local communication devices (e.g., personal computer or mobile phone).
Referring to
In the message discovery stage 26, the product purchase information provider 12 identifies the ones of the electronic messages 22 that relate to product purchases. In some examples, rule-based filters and machine learning classifiers are used to identify product purchase related electronic messages.
In the field extraction stage 28, the product purchase information provider 12 extracts product purchase information from the identified ones of the electronic messages 22. Examples of such product purchase information include merchant name, order number, order date, product description, product name, product quantity, product price, sales tax, shipping cost, order total, billing address, shipping company, shipping address, estimated shipping date, estimated delivery date, and tracking number.
In the data processing stage 30, the product purchase information provider 12 processes the extracted product purchase information for according to the different types of product purchase information consumers. For example, for individual users, the extracted product purchase information is processed, for example, to display information about the users' purchases, including information for tracking in-transit orders, information for accessing purchase details, and aggregate purchase summary information. For advertisers, the extracted product purchase information is processed, for example, to assist in targeting advertising to consumers based on their purchase histories. For market analysts, the extracted product purchase information is processed to provide, for example, anonymous item-level purchase detail across retailers, categories, and devices.
In the examples explained in detail below, the product purchase information provider 12 includes a structure learning parser that extracts product purchase information from an electronic message using a grammar based parsing approach to identify structural elements and data fields in the electronic message and a machine learning approach to classify the data fields. The structural elements correspond to static, optional, and iterating elements that commonly appear in a particular type of product purchase related electronic message, whereas the data fields contain the variable information at least some of which corresponds to the product purchase information that is extracted.
In accordance with the method of
In some examples, a structure learner parser builder includes a product purchase information grammar extractor that performs the grouping and extracting operations of blocks 70-72 of
In this example, the computer apparatus retrieves from a data store (e.g., a database) electronic messages 80 that have been transmitted between physical network nodes to convey product purchase information to designated recipients.
The computer apparatus pre-processes the electronic messages 80 (
For each of the pre-processed messages 84 (
The computer apparatus clusters the electronic messages by merchant (
In some examples, for each merchant-specific set of electronic messages, the computer apparatus applies to the electronic messages a clustering process (e.g., a Density-Based Spatial Clustering of Applications with Noise (DBSCAN) process, a k-means clustering process, or a hierarchical clustering process) that clusters electronic messages based on measures of content similarity between pairs of the electronic messages. In an example of this process, electronic messages are processed serially. A new cluster is created for the first electronic message. Each successive electronic message to be clustered is compared to each of the electronic messages in each existing cluster and is added to the cluster containing an electronic message having a similarity with the electronic message being clustered that exceeds a similarity threshold; if the electronic message being clustered has a similarity that exceeds the similarity threshold with the electronic messages of multiple clusters, the multiple clusters are merged into a single cluster. If the similarities between the electronic message being clustered and the previously clustered electronic messages do not exceed the similarity threshold, a new cluster is created for the electronic message being clustered.
In some examples, measures of content similarity compare similarity and diversity of the contents of pairs of electronic messages. In some of these examples, the similarity measure corresponds to the Jaccard similarity coefficient, which measures similarity between two electronic messages based on the size of the intersection divided by the size of the union of features of the electronic messages. In some of these examples, the computer apparatus extracts lines of content (i.e., whole lines, as opposed to individual words in the lines) from each electronic message as the features that are compared, and measures similarities between electronic messages using line-based comparisons of the extracted content. This line-based feature matching approach improves the accuracy of the clustering process by narrowing the range of matches between electronic messages.
After the electronic messages have been grouped into the merchant-specific sets 94, 96 of electronic message clusters, the computer apparatus determines a respective grammar for each electronic message cluster (
In some examples, for each cluster, the computer apparatus builds a respective generalized suffix tree representation of contents of the electronic messages in the cluster, and ascertains the arrangement of structural elements of the electronic messages in the cluster based on the respective generalized suffix tree representation. The suffix tree representation contains all the suffixes (which are one or more word sequences that are referred to as “phrases”) as their keys and positions in the text as their values. The suffix tree representation maintains the order of suffixes in a hierarchical tree structure of nodes that are linearly interconnected from root to leaf node and, for each, suffix, identifies the electronic messages in which the suffix appears and the number of times it appears in each electronic message. In some examples, the suffix tree representation of the electronic messages in a given cluster is built by applying Ukkonen's algorithm for constructing suffix trees (E. Ukkonen, “On-Line Construction of Suffix Trees,” Algorithmica, September 1995, Volume 14, Issue 3, pp. 249-260 (1995)) to a single string formed by concatenating the tokenized contents of all the electronic messages in the given cluster.
The computer apparatus traverses the generalized suffix tree to identify structural elements of the electronic messages in a given cluster. In some examples, the computer identifies substrings that correspond to static elements, optional elements, and iterating elements in the electronic messages of the given cluster. In general, substrings that appear in all the electronic messages in the given cluster are considered static elements, substrings that appear in a majority (e.g., 90%) of the electronic messages in the given cluster are considered optional elements, and substrings that appear in all the electronic messages in the given cluster and sometimes repeat within individual ones of the electronic messages are considered iterating elements. Substrings that appear in less than a majority (e.g., below 10%) of the electronic messages of a given cluster are considered electronic message specific elements that are extracted as data fields.
The computer apparatus typically applies a series of processes to the tree to detect structural elements of the electronic messages in a given cluster. These processes operate on branches and the special characters that terminate the branches to represent respective ones of the electronic messages in the given cluster.
In one exemplary process for identifying static elements, the computer apparatus traverses each branch from the root element until it splits into subbranches. If the subbranches all end with electronic message terminal characters with one terminal character for each subbranch, then the branch is common across all the electronic messages of the cluster and the computer apparatus labels the token sequence corresponding to the branch as a static element.
The process of identifying iterating elements is similar to the process of identifying static elements. In one example, the computer apparatus locates each branch in the generalized suffix tree that splits into the sub-branches and inspects the terminal character of the branch. Unlike the static detection process where the computer apparatus locates branches that split into the set of terminals matching the set of electronic messages in the cluster, the process of identifying iterating elements involves locating each branch that splits into terminal characters that match all the electronic messages in the given cluster and match at least one of the electronic messages in the given cluster more than once. In some examples, the computer apparatus applies rules to branches, such as minimum token sequence length and a minimum threshold variance of the repeating token sequence across the electronic messages in the given cluster. The minimum token sequence length rule filters out common words (e.g., “the” and “and”) and product names that appear frequently in electronic messages. The minimum threshold variance criterion distinguishes iterating sections from static elements that appear infrequently in the electronic messages of the given cluster. For example, an electronic message that contains a product confirmation for a book have the title “Thanks for your purchase” in an iterating section might be incorrectly identified if the same phrase is used elsewhere in the text of the electronic message, but because the token sequence “Thanks for your purchase” appears very infrequently in this section of the electronic messages of the cluster, its variance value in this section would be very low and therefore would not be misidentified as an iterating section of the electronic messages in which it appeared.
The structural elements that are identified by traversing the generalized suffix tree for a given cluster are incorporated into a data structure (referred to herein as a “grammar”) that preserves the sequence of the static, optional, and iterating elements in the generalized suffix tree. In some examples, each grammar recursively defines allowable arrangements of the tokens corresponding to the structural elements. The computer apparatus typically stores the cluster grammars in one or more data structures in non-transitory computer-readable memory.
Referring back to
In some examples, the computer apparatus selects a training set 102 of electronic messages. In the illustrated example, the training set 102 is selected from the collection of pre-processed messages 84; in other examples the training set 102 is selected from another collection of electronic messages that include product purchase information. In some examples, the electronic messages in the training set 102 are selected without regard to the merchant associated with the electronic messages. As a result, a single training set can be used to train the one or more data field labeling classifiers across a wide variety of different merchants, which increases the scalability of the training process as compared with a training process in which a respective set of classifiers is trained for each merchant.
The computer apparatus or human operator (e.g., a machine learning engineer) identifies features in the training set 102 of electronic messages that will be used to train the one or more classifiers 106-110 (
In the illustrated example, three classifiers are built: a price classifier 106, an identifier classifier 108, and an item description classifier.
The price classifier 106 is a machine learning classifier that is trained to label ones of the extracted field tokens with respective price labels in a predetermined price classification taxonomy. In some examples, the price classifier 106 is trained to label price token variants with the following order-level price labels: shipping; tax; total; sub-total; and discount.
In some examples, the computer apparatus identifies candidate price field tokens in the training set 102 of electronic messages (e.g., for U.S. dollar based prices, the computer apparatus looks for a “$” symbol followed by a decimal number consisting of an integer part and a two-digit fractional part separated by the decimal separator “.”). For each candidate price, the computer apparatus determines features from the words used in the static token sequence that precedes the candidate price field token. In some examples, the computer apparatus breaks the static token sequence preceding a particular candidate price into two-word phrases (including special character words demarcating the beginning and end of the sequence, such as <start> and <end>) that are used as the features for training the price classifier to label that particular price with the assigned label from the price taxonomy. For example, if the static token sequence preceding an identified price field tokens that is assigned the “total” price label consists of “You paid the total:”, the computer apparatus would convert the static token sequence into the following features: “<start> you”; “you paid”; “paid the”; “the total:”; “total: <end>”. During the training process, the price classifier automatically learns the weights to assign to the features based on the training data. In some examples, the price classifier 106 is trained according to a naïve Bayes training process.
The identifier classifier 108 is a machine learning classifier that is trained to label respective ones of the extracted field tokens with an identifier label in a predetermined identifier classification taxonomy. In some examples, the identifier classifier 108 is trained to label identifier variants into the following identifier labels: order number; tracking number; and SKU (Stock Keeping Unit).
In some examples, the computer apparatus identifies candidate identifier field tokens (e.g., non-decimal numeric and alphanumeric strings) in the training set 102 of electronic messages. For each candidate identifier, the computer apparatus trains the identifier classifier 108 to classify the candidate identifier based on features that include (i) a token extracted from the selected electronic message that corresponds to a static structural element of the respective grammar that immediately precedes the identifier field token in the selected electronic message, and (ii) characteristics of the identifier field token. In some examples, the computer apparatus breaks the static token sequence preceding a particular candidate identifier into two-word phrases (including special character words demarcating the beginning and end of the sequence, such as <start> and <end>) that are used as the features for training the identifier classifier to label that particular price with the assigned label from the identifier taxonomy. In addition, the computer apparatus uses characteristics of the candidate identifier field token, including the symbol length of the candidate identifier, the percentage of numeric symbols (also referred to as digits) in the candidate identifier, the location of the candidate identifier in the electronic message (e.g., in the subject field in the header of the electronic message, at the top of the body of the electronic message, or at the bottom of the body of the electronic message). During the training process, the identifier classifier 108 automatically learns the weights to assign to the features based on the training data. In some examples, the identifier classifier is 108 trained according to a logistic regression training process.
The item description classifier 110 is a machine learning classifier that is trained to label respective ones of the extracted field tokens as an item description. In some examples, the computer apparatus identifies candidate item description field tokens (e.g., word phrase symbol strings) in the training set 102 of electronic messages. For each candidate item description, the computer apparatus trains the classifier to classify the candidate identifier based on features that include, for example: the percentage of phrases that the candidate item description has in common with a known item description (e.g., an item description in a database of products descriptions, such as a list of products previously purchased by the recipient of the electronic message or a product catalogue associated with the merchant associated with the electronic message); the percentage of phrases that the candidate item description has in common with a compilation of phrases that are known to not be part of product descriptions (e.g., identifier related phrases, such as “Order No.”, and order-level price related phrases, such as “Total Price”, are examples of phrases that typically are included in the compilation as not corresponding to item descriptions); and the percentage of capitalized symbols in the candidate item description field tokens. During the training process, the item description classifier 110 automatically learns the weights to assign to the features based on the training data. In some examples, the item description classifier 110 is trained according to a logistic regression training process.
In some examples, in addition to building the price classifier 106, the identifier classifier 108, and the item description classifier 110, the computer apparatus also applies heuristics to classify candidate item-level quantity field tokens and candidate item-level price field tokens. An example of an item-level quantity classification heuristic is the magnitude of the numeric field token in an iterating section of an electronic message. An example of an item-level price classification heuristic is a phrase of one or more words (e.g., “item price”) that appears in a static token sequence that precedes a candidate price field token in an iterating section of an electronic message.
In accordance with the method of
In some examples, the structure learner parser includes a product purchase information token parser that performs the matching, segmenting, and parsing operations of blocks 150-154 of
In this example, the computer apparatus retrieves from a data store (e.g., a database) electronic messages 160 that have been transmitted between physical network nodes to convey product purchase information to designated recipients.
The computer apparatus pre-processes the electronic messages 160 (
For each of the pre-processed messages 164 (
Based on the determined merchant that is identified as being associated with a respective one of the electronic messages, the computer apparatus attempts to match the electronic message to one of multiple clusters of electronic messages 170 that is associated with the determined merchant. In some examples, the set 170 of clusters corresponds to one of the merchant-specific sets 94, 96 of electronic message clusters into which the electronic messages 84 were grouped in the structure learning parser building process described above in connection with
After determining the set 170 of clusters of electronic messages that is associated with the merchant associated with the electronic message, the computer apparatus matches the electronic message to a respective one of the clusters in the set 170 of clusters (
In some examples, each similarity score compares similarity and diversity of the contents of the electronic message and contents of a respective one of the electronic messages of the associated cluster. In some examples, measures of content similarity compare similarity and diversity of the contents of pairs of electronic messages. In some of these examples, the similarity measure corresponds to the Jaccard similarity coefficient, which measures similarity between two electronic messages based on the size of the intersection divided by the size of the union of features of the electronic messages. In some of these examples, the computer apparatus extracts lines of content (i.e., whole lines, as opposed to individual words in the lines) from each electronic message as the features that are compared, and measures similarities between electronic messages using line-based comparisons of the extracted content. This line-based feature matching approach improves the accuracy of the clustering process by narrowing the range of matches between electronic messages.
As explained above, each cluster in the matched merchant-specific set 170 of clusters is associated with a respective grammar that defines an arrangement of structural elements of electronic messages in the cluster. Based on this association, the computer apparatus determines the grammar 176 that is associated with the cluster 174 that is matched to the electronic message.
After determining the grammar 176 that is associated with the cluster 174 that is matched to the electronic message, the computer apparatus parses the electronic message according to the determined grammar 176 (
Referring back to
After the tokens have been parsed and the additional features have been extracted from the pre-processed version of the electronic message (
After classification, the computer apparatus outputs an extracted set of price data, identifier data, item description data, and item-level quantity and price data for each electronic message. The computer apparatus typically stores this product purchase information in non-transitory computer-readable memory. For example, the product purchase information may be stored in one or more data structures that include associations between the product purchase relevant labels and the product purchase information of the respective ones of the extracted product purchase data field tokens.
The extracted product purchase information may be used in a wide variety of useful and tangible real-world applications. For example, for individual users, the extracted product purchase information is processed, for example, to display information about the users' purchases, including information for tracking in-transit orders, information for accessing purchase details, and aggregate purchase summary information. For advertisers, the extracted product purchase information is processed, for example, to assist in targeting advertising to consumers based on their purchase histories. For market analysts, the extracted product purchase information is processed to provide, for example, anonymous item-level purchase detail across retailers, categories, and devices.
Other exemplary applications of the extracted product purchase information are described in, for example, U.S. Patent Publication No. 20130024924 and U.S. Patent Publication No. 20130024525.
Computer apparatus are specifically programmed to provide improved processing systems for performing the functionality of the methods described herein. In some examples, the process of building a structure learning parser and the process of parsing electronic messages with a structure learning parser are performed by separate and distinct computer apparatus. In other examples, the same computer apparatus performs these processes.
A user may interact (e.g., input commands or data) with the computer system 320 using one or more input devices 330 (e.g. one or more keyboards, computer mice, microphones, cameras, joysticks, physical motion sensors, and touch pads). Information may be presented through a graphical user interface (GUI) that is presented to the user on a display monitor 332, which is controlled by a display controller 334. The computer system 320 also may include other input/output hardware (e.g., peripheral output devices, such as speakers and a printer). The computer system 320 connects to other network nodes through a network adapter 336 (also referred to as a “network interface card” or NIC).
A number of program modules may be stored in the system memory 324, including application programming interfaces 338 (APIs), an operating system (OS) 340 (e.g., the Windows® operating system available from Microsoft Corporation of Redmond, Wash. U.S.A.), software applications 341 including one or more software applications programming the computer system 320 to perform one or more of the process of building a structure learning parser and the process of parsing electronic messages with a structure learning parser, drivers 342 (e.g., a GUI driver), network transport protocols 344, and data 346 (e.g., input data, output data, program data, a registry, and configuration settings).
In some embodiments, the one or more server network nodes of the product providers 18, 42, and the recommendation provider 44 are implemented by respective general-purpose computer systems of the same type as the client network node 320, except that each server network node typically includes one or more server software applications.
In other embodiments, one or more of the product purchase information provider 12, the product merchants 14, the product delivery providers 16, the message providers 18, and the product purchase information consumers 20 shown in
The embodiments described herein provide improved systems, methods, and computer-readable media for extracting product purchase information from electronic messages.
Other embodiments are within the scope of the claims.