The present teaching generally relates to data processing. More specifically, the present teaching relates to data representation and derivation thereof.
With the development of the Internet and the ubiquitous network connections, more and more commercial and social activities are conducted online. Online content is served or recommended to millions at different locations. Advertising is more and more shifted to online and ads are displayed to users while content is delivered to the users. To make online content serving or recommendation to be provided in a more targeted manner, much effort has been exercised in the industry to optimize the content selection process to maximize the return. Different factors have been considered during targeting, including some categorical features of context associated with each opportunity. Examples of such categorical features are shown in
Some location related features may have a fixed vocabulary, such as zip codes, and some may have an open vocabulary, such as IP addresses. Conventional methods to predicting a user's location are shown in
A deep learning model for predicting a location takes, e.g., the above features as input, and automatically learns meaningful information from those features to infer a user's location. Most of these prior art methods focus on improving the prediction accuracy via optimizing deep learning models. However, such approaches do not concern about how to represent the features (feature representation learning) to make the learning more effective. It is widely recognized that the quality of feature representation in training samples has a significant impact on the performance of a model learned via deep learning. Inappropriate representation of features may indeed lead to limited model performance, while carefully and accurately derived representations of features usually improve the performance of a model in downstream prediction tasks.
Using a one hot vector to represent a specific zip code, each attribute may have a value of 1 or 0, with 1 indicating that the feature corresponds to a zip code indicated by the attribute and 0 indicating that the feature is a zip code that does not correspond to the attribute. This is illustrated in
The one hot vector representation has several drawbacks. One is the problem associated with high dimensionality. As mentioned, in US alone, there are 41,000 zip codes, leading to a 41K dimensional vector for representing zip codes, which significantly enlarges the size of downstream location prediction model and further increases the cost of model training and inference. Another problem associated with using one hot vector representation for location is that is cannot be used directly to represent a location feature that has an open vocabulary. Yet another issue associated with one hot vector representation is that because each attribute is perpendicular to all other attributes, without considering any geographical information of locations and, hence, cannot and does not encode relative distances of different locations. For instance, in the example illustrated in
Thus, there is a need for a better representation for local features that can capture useful information that, once represented and learned, can enhance the performance of the traditional approaches.
The teachings disclosed herein relate to methods, systems, and programming for information management. More particularly, the present teaching relates to methods, systems, and programming related to hash table and storage management using the same.
In one example, a method, implemented on a machine having at least one processor, storage, and a communication platform capable of connecting to a network for characterizing data. A location feature is first received. A distance-aware embedding for the received location feature is obtained, where the distance-aware embedding for the location feature is learned based on distances between different pairs of locations. A representation of the location feature is then generated based on the embedding for location related predictions.
In a different example, a system is disclosed for characterizing data. The system includes a location feature determiner configured for receiving a location feature and a location representation generator. The location representation generator is configured for obtaining an embedding related to the location feature with distance-awareness, wherein the embedding for the location feature is learned based on distances between different pairs of locations and generating a representation of the location feature based on the embedding, wherein the representation of the location feature using the embedding is to be used for location related predictions.
Other concepts relate to software for implementing the present teaching. A software product, in accordance with this concept, includes at least one machine-readable non-transitory medium and information carried by the medium. The information carried by the medium may be executable program code data, parameters in association with the executable program code, and/or information related to a user, a request, content, or other additional information.
Another example is a machine-readable, non-transitory and tangible medium having information recorded thereon for characterizing data. The information, when read by the machine, causes the machine to perform various steps. A location feature is first received. A distance-aware embedding for the received location feature is obtained, where the distance-aware embedding for the location feature is learned based on distances between different pairs of locations. A representation of the location feature is then generated based on the embedding for location related predictions.
Additional advantages and novel features will be set forth in part in the description which follows, and in part will become apparent to those skilled in the art upon examination of the following and the accompanying drawings or may be learned by production or operation of the examples. The advantages of the present teachings may be realized and attained by practice or use of various aspects of the methodologies, instrumentalities and combinations set forth in the detailed examples discussed below.
The methods, systems and/or programming described herein are further described in terms of exemplary embodiments. These exemplary embodiments are described in detail with reference to the drawings. These embodiments are non-limiting exemplary embodiments, in which like reference numerals represent similar structures throughout the several views of the drawings, and wherein:
In the following detailed description, numerous specific details are set forth by way of examples in order to facilitate a thorough understanding of the relevant teachings. However, it should be apparent to those skilled in the art that the present teachings may be practiced without such details. In other instances, well known methods, procedures, components, and/or system have been described at a relatively high-level, without detail, in order to avoid unnecessarily obscuring aspects of the present teachings.
The present teaching discloses solutions of representing a category feature via embeddings and learning mechanisms thereof. The representation scheme for category features as disclosed herein may be used for both category features that have a fixed vocabulary and category features that have an open vocabulary. For a category feature that has a fixed vocabulary, such as zip codes, embeddings are obtained via machine learning by leveraging the geographical distances among different zip code as ground truth during learning so that the learned embeddings retain the semantic relative distances among different zip codes. For a category feature that has an open vocabulary, such as IP addresses, the present teaching as disclosed herein facilitates learning of embeddings of different IP addresses based on ground truth obtained via the coordinates of the IP addresses so that the semantic relative distances among different IP addresses are retained. The scheme for learning embeddings for IP addresses having an open vocabulary is not limited to presently known IP addresses but also for future IP addresses.
The category feature representation using embeddings as disclosed herein overcomes the shortcomings of prior art solutions. It has a significantly lower dimensionality than that of the prior art. For example, if one hot vector representation is used for, e.g., zip codes, the required dimension is 41,000 even just for zip codes in the USA. As will be seen below, the dimension of the embedding representation is much lower, e.g., 16 as opposed to 41,000 of the prior art. In addition, the embedding representations as disclosed herein are geographical distance aware because the embeddings are learned based on meaningful geographical distances corresponding to the location features. As discussed in the background, the prior art solutions are completely blind as it comes to geographical semantics. Furthermore, the embedding representation for location features with an open vocabulary, according to the present teaching, is capable of also being used for new features that have not existed previously.
The present teaching is presented first with respect to embedding representation and learning thereof for location features with a fixed vocabulary and then second with respect to embedding representation and learning thereof for local features having an open vocabulary such IP addresses. Although embeddings are used for both types of location features, due to the difference in their nature of a fixed or an open vocabulary, specifics in deriving the embeddings vary. For example, a zip code is a location feature with a fixed vocabulary. An IP address is an example of a location feature that has an open vocabulary. For instance, an IP address may have 12 or 16 or even more digits organized in a well formulated manner. Although having a known number of digits, existing IP addresses may not exhaust all possible combinations. That is, some of the IP addresses are known and can be used in learning to derive their embeddings and some may not yet be known (open vocabulary) and may emerge later as new and unknown feature values. The embedding scheme and learning process thereof according to the present teaching is capable of deriving embeddings for unknown vocabularies.
The discussion focuses first on embedding representation and learning thereof for local features that have a fixed vocabulary. Zip codes may be used to illustrate the concepts, not as a limitation. As shown in
The present teaching involves operations of three stages: 1) generate feature representation, 2) estimate pair-wise distances, and 3) optimize the feature representation via loss reduction. Generating feature representation focuses on providing a dimension reduced representation for zip codes. As discussed herein, embeddings of a certain dimension, e.g., 16, may be adopted and initialized with random numbers. Such embedding values may then be learned by minimizing a loss function to converge. For example, with respect to a fixed population of zip codes (e.g., 41K of U.S. zip codes), embeddings for such zip codes may first be initialized as a batch of [Zipcode1, Zipcode2, . . . , Zipcodeb], where b is the size of the population. This is shown in
To train these embeddings against some optimization criteria, a loss function may be defined. In an exemplary embodiment, the loss function is defined so that the learned embeddings are distance-aware, i.e., the distances among different embeddings mimic the geographical distances among physical regions corresponding to the underlying zip codes. The initial embeddings derived using random numeric values may be used to compute pair wise distances 240 and such distances are used to construct an estimated distance matrix 250. The estimated pair-wise distances computed using the embeddings may be used as the basis for a loss function in order for adjusting the embedding values by minimizing the loss function. According to the present teaching, a loss function 260 is defined based on the difference between the distances estimated using embeddings and the distances among regions represented by the zip codes. As such, the loss function is made distance aware.
To learn the embeddings for zip codes, a batch of zip codes [Zipcode1, Zipcode2, . . . , Zipcodeb] are used to form into a simple lookup table that stores an embedding matrix with a fixed dictionary and size. The output includes the embeddings of the corresponding zip codes, represented as EZb×|e
where {circumflex over (d)}Zij is the estimated Euclidean distance between two zip code embeddings eZi and eZj, and the dimension of {circumflex over (D)}Z is b×b. As discussed herein, the values in the embeddings are initialized with random numbers and they are adjusted during learning by minimize a loss function, which is defined based on discrepancy of the pair-wise distances estimated using the embeddings and that of the computed pair-wise distances of the zip codes determined based on the approach described below.
Each zip code has a region that it represents, and such a region has a center with a coordinate that can be obtained via publicly available information (e.g., from the world_knowledgeprd_database). The coordinates representing regions corresponding to different zip codes may be leveraged to compute the distance between any pair of zip codes. For example, given two zip codes Zipcodei and Zipcodej, the coordinates of centers of the regions they each correspond may be obtained, respectively. The coordinates may be represented by their respective longitude and latitude, i.e., (loni, lati) (for Zipcodei) and (lonj, latj) (for Zipcodej), respectively. The physical distance distij between Zipcodei and Zipcodej may then be computed as follows:
Here, r is the earth's radius (=6371). Based on such computed distance between a pair of zip codes, a normalized distance dZij for the pair can be determined as follows:
where max(dist) is the maximum Haversine distance between all possible pairs of zip codes and K is a hyperparameter. In some embodiments, K=100 by default. The normalized real distance dZij is used as the ground truth between two zip codes. The normalized real distances are used as ground truth distances and they form a distance matrix Dz, where each element dZij in the matrix represents the normalized distance of a pair of zip codes.
Since both Dz and {circumflex over (D)}Z are symmetric matrix, the upper triangular portion of each matrix is used to calculate the mean squared error (MSE) as the loss function defined below:
During the learning, embeddings for zip codes are learned by minimizing the Loss. In some embodiments, an Adam optimizer may be adopted with a set fixed learning rate while learning zip code embeddings.
With the learning scheme as described above, the embeddings for zip codes can be derived in a manner so that they are distance aware. That is, the embeddings of two zip codes have a high similarity if both zip codes are geographically close to each other.
Based on the estimated embedding distances, dZij, and ground truth distances, dZij, the loss determiner 370 determines, at 355, the Loss as defined above. In some embodiments, the loss determiner 370 may compute the Loss based on a loss function specified in a loss function configuration 380. With respect to the computed Loss, the ZC embedding parameter optimizer 390 adjusts, at 365, the values in current embeddings to minimize the Loss. The adjusted embeddings may be stored in 395 as the current version of the learned embeddings. The learning process may be iterative, and the process may be controlled based on some pre-determined convergence condition or criteria. For instance, if the learning has not yet converged, determined at 375 based on the convergence condition, the learning may proceed to step 345 for the next iteration so that the current version of the embeddings may be used to compute embedding distances, {circumflex over (d)}Zij, which may then be used to compute the Loss in the next iteration. The learning based on the current batch of zip codes will iterate until the embeddings for the zip codes in the bath converge. If there are more batches of zip codes, determined at 385, the embedding learning continues by returning to step 305, where another batch of zip codes is obtained and their embeddings are learned via the optimization scheme as disclosed herein.
As discussed herein, for a location feature with a fixed vocabulary, such as zip codes, the above-described learning scheme enables learning of distance-aware embeddings to represent zip codes. Such learned embeddings are used to represent zip codes in location prediction. The embeddings learned in this manner not only can represent zip codes in a more semantically meaningful way (distance-aware) but also have significantly lower dimension, making the downstream usage and application more efficient and accurate. As discussed herein, some location features do not have a fixed vocabulary. Instead, they have an open vocabulary, such as IP addresses. That is, even though an IP address may have a known number of digits, there are only a certain number of combinations in use. For example, there are IPV4 and IPV6 addresses, and they are designed with certain meaning. For instance, each raw IPV6 IP address has 32 hexadecimal digits, where the first 12 digits are for site prefix, the next 4 digits are for subnet ID, and the rest digits are for interface ID. As the interface ID in general has little impact on user location prediction, the first half (i.e., site prefix and subnet ID) may be considered for representation learning.
Given an IP address, it can be decompressed to ensure that each IPV4 IP address has 12 digits and each IPV6 IP address has 16 digits. For example, an IPV4 IP address 123.456.78.9 may be converted into [1, 2, 3, 4, 5, 6, 0, 7, 8, 0, 0, 9], while an IPV4 IP address 2001:19f0:200:4000:0:0:0:109 may be converted into [2, 0, 0, 1, 1, 9, f, 0, 0, 2, 0, 0, 4, 0, 0, 0].
The similar mechanism may also be applied to, e.g., 16-digit IPV6 IP addresses. To develop a common framework for both types of IP addresses, four (4) zeros may be padded to the left of IPV4 digits to make it 16-digit as well so that there is a consistency in terms of digit length that can accommodate both IPV4 and IPV6 IP addresses. To generate an embedding for an EP address based on the multiple one hot vectors, the present teaching employs a multilayer neural network that takes one hot vectors for an IP address as input and outputs an embedding for the IP address by combine the one hot vectors.
The multilayer neural network framework 400 comprises different layers, e.g., 16 layers 400-1, 400-2, 400-3, . . . , 400-15, and 400-16 in this example. An IP address 400 may first be encoded (410) by using a one-hot vector for each digit to generate, e.g., 16 one hot vectors labeled as 410-1, 410-2, 410-3, . . . , 410-15, and 410-16, as shown in
where n is the dimension of the one-hot vector of each digit while m is the dimension of the IP representation. At each layer, the output oi is a linear combination of the input xi along with an activation function ƒ. That is,
where wi* and bi* represent weights and biases, respectively. In some embodiments, random values are used to initialize all weights and biases.
In some embodiments, softsign may be used as the activation function ƒ, as it is more robust to saturation, resulting in more effective learning. The siftsign activation function may be expressed as:
As a result, the multi-layer serial neural network 400 takes an IP address as input and produces, at the last layer, a corresponding embedding (016 or e in
With the multilayer neural network 400, given an IP address, whether it is seen before or not, an embedding can be generated as discussed herein. Such a generated embedding may serve as an initialized embedding and can be optimized. As IP addresses are location features, in some embodiments, their embedding representation may be trained to be distance-aware. In this case, a learning mechanism for IP address embeddings may be provided similar to the distance-aware training for embeddings for zip codes. According to the present teaching, to facilitate learning distance-aware IP address embeddings, each IP address may be mapped to a geographic coordinate. For instance, an IP address may correspond to a zip code, i.e., the coverage region of the IP address may overlap with an area represented by the zip code. In this case, coordinates of the centers of geographical areas of zip codes may be used to represent the geographical coordinates of the overlapping IP addresses. For instance, for two IP addresses, ipi and ipj, the corresponding golden zip codes zipi and zipj, can be identified, respectively, and corresponding longitude and latitude information for each may be obtained. Under this premise, such geographic information of the zip codes may be used to compute the real distances (as ground truth distance) of pairs of IP addresses which in turn can be used to calculate the loss.
Based on the coordinates of the IPAs obtained by the IPA coordinate determiner 540, the IPA pair geo distance determiner 530 computes, at 545, the pair-wise distances between any two IPAs and generates the ground truth IPA distance matrix. To learn the distance-aware embeddings for the IPAs, the IPA embedding pair similarity estimator 560 estimates, at 555, pair-wise embedding similarities based on the embeddings stored in the IPA embeddings 595. Based on the ground truth geo distances between pairs of IPAs in the IPA distance matrix and the estimated embedding similarities (computed based on the current embeddings), the loss determiner 570 computes, at 565, the loss, which is then used by the IPA embedding parameter optimizer 590 to determine how to adjust, at 575, the embedding values to minimize the loss. The learning process is iterative. If the loss indicates that the learning is not yet converged, determined at 585, the process goes back to 555, where the adjusted embeddings are again used to compute the pair-wise similarities in order to determine the next loss and adjustment for incremental learning. When the embedding learning for the current IPA data batch converges, it is determined, at 595, whether the learning process is to continue for another IPA data batch. If not, the learning process ends. If yes, the process goes back to step 505 to handle the learning of the next IPA data batch.
In this embodiment, the location feature determiner 600 includes a ZC-based embedding estimator 610, an IPA based embedding determination controller 620, and a location representation generator 630. If the input location feature is a zip code, the ZC-based embedding estimator 610 is invoked to produce an embedding for the input zip code. As a zip code has a fixed vocabulary, the embeddings for all zip codes were learned and stored in the zip code embedding storage 395. In this situation, the ZO-based embedding estimator 610 retrieves, from 395, the embedding previously learned for the input zip code and sends to the location representation generator 630. If the input is an IP address, the IPA based embedding determination controller 620 is invoked to generate an embedding for the input IP address. Different from a zip code that has a fixed vocabulary, an IP address has an open vocabulary. Given that, an input IP address may or may not have a corresponding previously trained embedding. If an IP address is one that have been seen before with a previously trained embedding, the previous trained embedding can be retrieved by the IPA based embedding determination controller 620 from the IPA embedding storage 595 and sent to the location representation generator 630.
If the IP address does not have a previously learned embedding, i.e., either it is a new IP address not used before or was not seen previously, the IPA based embedding determination controller 620 needs to generate a new embedding, which can be done using the same method as discussed herein. To do so, the new IP address is sent to the previously described IP address embedding learning mechanism 500 so that a new embedding for the new IP address can be generated using the framework described with reference to
To implement various modules, units, and their functionalities described in the present disclosure, computer hardware platforms may be used as the hardware platform(s) for one or more of the elements described herein. The hardware elements, operating systems and programming languages of such computers are conventional in nature, and it is presumed that those skilled in the art are adequately familiar with to adapt those technologies to appropriate settings as described herein. A computer with user interface elements may be used to implement a personal computer (PC) or other type of workstation or terminal device, although a computer may also act as a server if appropriately programmed. It is believed that those skilled in the art are familiar with the structure, programming, and general operation of such computer equipment and as a result the drawings should be self-explanatory.
Computer 800, for example, includes COM ports 850 connected to and from a network connected thereto to facilitate data communications. Computer 800 also includes a central processing unit (CPU) 820, in the form of one or more processors, for executing program instructions. The exemplary computer platform includes an internal communication bus 810, program storage and data storage of different forms (e.g., disk 870, read only memory (ROM) 830, or random-access memory (RAM) 840), for various data files to be processed and/or communicated by computer 800, as well as possibly program instructions to be executed by CPU 820. Computer 800 also includes an I/O component 860, supporting input/output flows between the computer and other components therein such as user interface elements 880. Computer 800 may also receive programming and data via network communications.
Hence, aspects of the methods of information analytics and management and/or other processes, as outlined above, may be embodied in programming. Program aspects of the technology may be thought of as “products” or “articles of manufacture” typically in the form of executable code and/or associated data that is carried on or embodied in a type of machine readable medium. Tangible non-transitory “storage” type media include any or all of the memory or other storage for the computers, processors or the like, or associated modules thereof, such as various semiconductor memories, tape drives, disk drives and the like, which may provide storage at any time for the software programming.
All or portions of the software may at times be communicated through a network such as the Internet or various other telecommunication networks. Such communications, for example, may enable loading of the software from one computer or processor into another, for example, in connection with information analytics and management. Thus, another type of media that may bear the software elements includes optical, electrical, and electromagnetic waves, such as used across physical interfaces between local devices, through wired and optical landline networks and over various air-links. The physical elements that carry such waves, such as wired or wireless links, optical links, or the like, also may be considered as media bearing the software. As used herein, unless restricted to tangible “storage” media, terms such as computer or machine “readable medium” refer to any medium that participates in providing instructions to a processor for execution.
Hence, a machine-readable medium may take many forms, including but not limited to, a tangible storage medium, a carrier wave medium or physical transmission medium. Non-volatile storage media include, for example, optical or magnetic disks, such as any of the storage devices in any computer(s) or the like, which may be used to implement the system or any of its components as shown in the drawings. Volatile storage media include dynamic memory, such as a main memory of such a computer platform. Tangible transmission media include coaxial cables; copper wire and fiber optics, including the wires that form a bus within a computer system. Carrier-wave transmission media may take the form of electric or electromagnetic signals, or acoustic or light waves such as those generated during radio frequency (RF) and infrared (IR) data communications. Common forms of computer-readable media therefore include for example: a floppy disk, a flexible disk, hard disk, magnetic tape, any other magnetic medium, a CD-ROM, DVD or DVD-ROM, any other optical medium, punch cards paper tape, any other physical storage medium with patterns of holes, a RAM, a PROM and EPROM, a FLASH-EPROM, any other memory chip or cartridge, a carrier wave transporting data or instructions, cables or links transporting such a carrier wave, or any other medium from which a computer may read programming code and/or data. Many of these forms of computer readable media may be involved in carrying one or more sequences of one or more instructions to a physical processor for execution.
Those skilled in the art will recognize that the present teachings are amenable to a variety of modifications and/or enhancements. For example, although the implementation of various components described above may be embodied in a hardware device, it may also be implemented as a software only solution, e.g., an installation on an existing server. In addition, the techniques as disclosed herein may be implemented as a firmware, firmware/software combination, firmware/hardware combination, or a hardware/firmware/software combination.
While the foregoing has described what are considered to constitute the present teachings and/or other examples, it is understood that various modifications may be made thereto and that the subject matter disclosed herein may be implemented in various forms and examples, and that the teachings may be applied in numerous applications, only some of which have been described herein. It is intended by the following claims to claim any and all applications, modifications and variations that fall within the true scope of the present teachings.