The present application relates generally to an improved data processing apparatus and method and more specifically to mechanisms for providing parallelized hybrid sparse matrix representations for performing personalized content ranking.
Everyday life is dominated by information technology and systems for obtaining information and knowledge from collections of data. For example, search engines operate on large collections of data to obtain information related to a search query. Question and Answer (QA) systems, such as the IBM Watson™ QA system available from International Business Machines (IBM) Corporation of Armonk, N.Y., operate on a corpus of documents or other portions of information to answer natural language questions. Moreover, many social networking services represent their users, communications, and the like, as large data sets. Many times it is important to perform knowledge extraction, reasoning, and various other analytics on these large scale data sets so as to facilitate the operation of the systems, e.g., answer questions, return search results, or provide functionality within the social networking services. For example, many social networking services help individuals identify other registered users that they may know or have a connection with. Such functionality requires analyzing a large set of data representing the users of the social networking service.
In facilitating searching of information in large sets of documents, such as searches of the web pages on the Internet (or the “web”), search engines are employed which rank results based on various factors. One such search engine is the Google™ search engine which uses a ranking algorithm referred to as “PageRank.” PageRank exploits the linkage structure of the web to compute global “importance” scores that can be used to influence the ranking of search results.
Recently, an effort at Stanford University, as part of their Stanford Global Infobase Project, has developed an algorithm for allowing users to define their own notion of importance for each individual query. This algorithm, referred to as personalized PageRank, provides online personalized web searching with personalized variants of PageRank based on a private, personalized profile.
In one illustrative embodiment, a method, in a data processing system comprising a processor and a memory, for performing a matrix operation is provided. The method comprises configuring the processor of the data processing system to perform hybrid compressed representation matrix operations on an input matrix. Moreover, the method comprises receiving, by the processor, the input matrix. The input matrix comprises zero value and non-zero value entries. The method also comprises obtaining, by the processor, a first compressed representation data structure corresponding to the input matrix. The first compressed representation data structure represents the non-zero value entries of the input matrix in a first compressed format. Furthermore, the method comprises obtaining, by the processor, a second compressed representation data structure corresponding to the input matrix. The second compressed representation data structure represents the non-zero value entries of the input matrix in a second compressed format different from the first compressed format. In addition, the method comprises iteratively executing, by the processor, a matrix operation on the input matrix using the first compressed representation data structure and the second compressed representation data structure. The first compressed representation data structure is utilized for a first subset of iterations of the matrix operation and the second compressed representation data structure is utilized for a second subset of iterations of the matrix operation different from the first subset of iterations.
In other illustrative embodiments, a computer program product comprising a computer useable or readable medium having a computer readable program is provided. The computer readable program, when executed on a computing device, causes the computing device to perform various ones of, and combinations of, the operations outlined above with regard to the method illustrative embodiment.
In yet another illustrative embodiment, a system/apparatus is provided. The system/apparatus may comprise one or more processors and a memory coupled to the one or more processors. The memory may comprise instructions which, when executed by the one or more processors, cause the one or more processors to perform various ones of, and combinations of, the operations outlined above with regard to the method illustrative embodiment.
These and other features and advantages of the present invention will be described in, or will become apparent to those of ordinary skill in the art in view of, the following detailed description of the example embodiments of the present invention.
The invention, as well as a preferred mode of use and further objectives and advantages thereof, will best be understood by reference to the following detailed description of illustrative embodiments when read in conjunction with the accompanying drawings, wherein:
As discussed above, modern computing systems often are engaged in performing knowledge extraction, reasoning, and various other analytical operations on large scale data sets. Search engines, Question and Answer systems, Natural Language Processing (NLP) systems, relationship analytics engines, and the like, are only some examples of these types of modern computing systems which operate on large scale data sets to facilitate their operations.
These large scale data sets are often represented as networks or graphs, with the operations being performed on these networks or graphs often involving runtime resource-intensive operations. These networks or graphs comprise nodes and edges between nodes. The nodes represent concepts, entities, or information while the edges between the nodes represent relationships between the concepts, entities, or information. The edges of the graph can be uni-directional or bi-direction and have weights corresponding to their importance, i.e. the relative strengths between the nodes. In one illustrative embodiment, the sum of all weights on every outgoing edge stemming from a node is 1.0. It should also be noted that with such graphs, there may be “self-edges” or “self-links”, which are edges that point back to the node from which they originated.
These networks or graphs may also be represented as large scale matrices in which indices (column and row indices) represent the nodes, and weights (or strengths) of the edges are represented by values in the matrix. In such a representation, “self-edges” appear on the diagonal of the matrix. Such matrices may often have millions or even billions of nodes with the edges corresponding to relative weights (or strengths) that are constant during a matrix operation on the matrix but which may change due to dynamic events or updates happening in real time between matrix operations.
In one illustrative embodiment, the properties of such a matrix are as follows:
Matrix operations are performed on these large scale matrices to extract relationships between the entries in the matrices so as to glean knowledge, perform reasoning operations, or the like. For example, if a process wants to know what concepts are related to concept A (e.g., a search term concept), concept A may be represented as an index (column and/or row) in the matrix (and may be specified by way of an input vector for example) and other concepts may be represented as other indices in the matrix, organized into rows and columns. Intersections of rows and columns in the matrix have values that are set to non-zero values if column A is related to the other concept, e.g., if concept A is represented as an index in a row, indices along the columns may represent other concepts and the intersection of each column with concept A represents whether or not concept A is related to the other concept (non-zero if concept A is related to the other concept and zero if concept A is not related to the other concept). Again, “relations” between concepts are represented in the graph by edges and associated weights/strengths of the edges such that the zero or non-zero value in the matrix is the weight/strength of the edge between concept A and the other concept.
Most matrix operations for knowledge or information extraction, or other analysis operations directed to identifying relationships between nodes of a graph using matrix representations, involve a matrix vector multiplication operation in which the matrix is multiplied by a vector which results in an output indicative of the intersection of the vector with the matrix, e.g., non-zero values in the vector multiplied with non-zero values in the matrix result in non-zero values in the output indicative of a relationship between the corresponding vector element and the matrix index. The sparsity of the matrix and the sparsity of the vector both influence the efficiency by which this matrix vector multiplication operation can be accomplished due to limited size of cache memories.
Because these large scale matrices tend to be very sparse, i.e. a majority of the entries in the matrix have a zero value, the processes executing on these sparse matrices often involve runtime resource-intensive large sparse matrix operations comprising matrix vector multiplication operations. That is, typically when a matrix vector multiplication operation is performed, portions of the matrix are loaded speculatively so as to perform the matrix vector multiplication. A portion of the matrix/vector is loaded into cache memory and used to perform a partial product multiplication of the matrix/vector. When a particular entry or location in the matrix is loaded into the cache, other entries or locations in close proximity to the selected entry/location are also loaded to speculate that the next matrix vector multiplication will target an entry/location in close proximity to the selected entry/location. However, in a sparse matrix, this speculative loading of the cache memory, more often than not, results in a cache miss, i.e. the non-zero entry or location of interest is not present in the cache memory and must be loaded from main memory or storage. Hence, sparse matrices/vectors, along with limited size cache memories results in cache misses which affect performance.
Thus, it can be appreciated that a process to identify related concepts, or perform other knowledge or information extraction on a large scale data set, may be very resource intensive involving a large number of cache misses and thus, loadings from main memory or storage, as the size of the matrix and the sparsity of the matrix increases. This is also the case when the vector is sparse since the matrix vector multiplication operation essentially is looking for non-zero entries in the matrix with which the non-zero elements of the vector are multiplied and if the vector and matrix are sparse, the majority of entries/elements will be zero when loaded into the cache memory. Therefore, the efficiency by which functionality of the system is provided may be limited by the efficiency and speed of performing the matrix operations on these large scale data sets.
The illustrative embodiments provide mechanisms for improving the efficiency and speed by which such operations are performed on such large scale matrices. The illustrative embodiments leverage the efficiency of different matrix storage formats for ordering non-zero entries in a large data set represented by a large sparse matrix. The particular storage format used for performing iterations of the matrix vector multiplication operation is selected dynamically based on the sparsity of the matrix and/or vector involved in the matrix vector multiplication operation. The leveraging of these different storage formats facilitates parallel execution of partial matrix vector multiplication operations by parallel threads, execution engines, processors, or the like.
In one illustrative embodiment, for iterations of the matrix vector multiplication operation where the sparsity of the vector is less than a predetermined threshold, a first matrix storage format data structure is utilized to resolve the matrix vector multiplication operation. For iterations of the matrix vector multiplication operation where the sparsity of the vector is equal to or greater than the predetermined threshold, a second matrix storage format data structure is utilized to resolve the matrix vector multiplication operation. In one illustrative embodiment, the first matrix storage format data structure is utilized for the first and second iterations of the matrix vector multiplication operation while subsequent iterations utilize the second matrix storage format. In these subsequent iterations, parallel “workers”, i.e. threads, engines, processors, or the like, perform distributed/parallel partial matrix vector multiplication operations utilizing the second matrix storage format data structure with the result being aggregated via weighted summations.
In one illustrative embodiment, the first matrix storage format is a Compact Sparse Row (CSR) matrix storage format and the second matrix storage format is the Compact Sparse Column (CSC) matrix storage format. The CSR matrix storage format orders non-zero entries or locations of a matrix row by row and is suitable for parallel execution for dense vectors, as will be described hereafter. The CSC matrix storage format orders non-zero entries or locations of a matrix column by column and is more suitable/efficient for sparse vectors, as will be described hereafter.
As further shown in
As shown in
On the other side of extremity, consider another case where the multiplicand is a dense vector, as shown in
Where the two representations appear to be at the same cost, in contemporary multi-threaded computer architectures and in the application of distributed/parallel computer platforms, they display distinctly differing processing characteristics. For dense multiplicand vectors, the CSC representation has a large amount of parallelizable (distributable) tasks assigned to different columns of the matrix. These tasks could then be aggregated into a single output vector by vector addition. As shown in
On the other hand, as shown in
By providing a mechanism to select between the use of CSR or CSC based on the sparsity of the vector, the mechanisms of the illustrative embodiments implement a hybrid sparse matrix representation for matrix vector multiplication operations and ultimately knowledge or information extraction and analysis operations on large data sets. Multiplication with the CSC representation is highly effective where the multiplicand vector is very sparse, since this operation is simply dereferencing the outputs and collecting the scaled vectors and aggregating to generate the output vector. Compared to the large size of the matrix, CSC could simply copy very minimal number of floating point numbers to the registers and memory and perform this operation very effectively even with a single thread assigned. When the multiplicand vector has a significantly non-sparse or dense shape, the contention of the writing with the CSC representation becomes the real bottleneck and thus, for such cases the CSR representation becomes much more effective since it can load the multiplicand vector in its cache to be used by each row with each row being assigned to different threads in multiple worker threads. By sharing the read of each multiplicand vector and distributing the computation for multiple rows (done by different parallel threads) the computation runtime is minimized by a scale of the number of threads supported by the system.
It should be appreciated that the description set forth herein will utilize terms associated with matrices and matrix operations and thus, it is important to first understand what these terms represent in the context of the present description. An “index” of a matrix refers to a row or column designation for the matrix, e.g., a row index of “1” refers to the first row in the matrix and a column index of “1” refers to a first column in the matrix. In the case of a zero-based index convention, the first row, first column may instead be designated as (0, 0).
The term “node” also refers to an “index” and is interchangeable with the term “index”. The term “node” refers to the representation of a graph of inter-related elements as a matrix, where the elements of the graph are referred to as “nodes” and are represented in a matrix as an index, e.g., a network is often represented as a graph comprising nodes and “edges” or “connections” between the nodes.
A “location” in a matrix is a combination of a row index and a column index, e.g., (1, 1) points to the location in the matrix corresponding to row 1 and column 1 and thus, the corresponding “entry” which is the value stored at that location. The terms “location”, “node”, and “index” or “indices” may sometimes be interchanged since they all utilize the index values to represent portions of the matrix, but with different connotations as noted above. That is, the index refers to the row and column indicators, the node also refers to the indices but has the connotation of a graph node represented as an index, and the location in the matrix is the portion of the matrix where the value or “entry” representing the intersection of the row and column is stored. A non-zero value or “entry” stored in a particular location of a matrix is referred to herein as a “connection” or “relationship” since it designates a connection or relationship between the two indices corresponding to that location, e.g., in a graph of a person's friends on a social networking site, a non-zero value may indicate that person A is friends with person B. The non-zero value itself may have various values indicative of a weight or strength of the relationship or connection between the two indices. For example, a weight or strength on an edge between node A (concept A) and node B (concept B) that has a value of 0.75 represents a relatively stronger relationship between concept A and concept B than a weight or strength on an edge between node A and node C (concept C) that has a value of 0.35.
While numerical designations for indices, nodes, and locations may be utilized, in some implementations of the illustrative embodiments, the indices may represent various types of information, concepts, or entities and thus, may not necessarily be numerical. For example, rather than using numerical row and column indices, the indices may be identifiers of persons, places, things, concepts, or the like, e.g., a row index of “John Smith” or “person A” or “concept A” or “search term A” and a column index of “Mary Johnson” or “person B” or “concept B” or “search term B”.
As mentioned above, the illustrative embodiments provide mechanisms for providing a hybrid matrix representation mechanism for performing knowledge or information extraction and analysis processes on large data sets such that a more efficient performance of these processes is achieved. The runtime execution of these processes tends to be dominated by cache misses since much of the large sparse matrices representing the large data set are populated with zero entries and non-zero entries may be sparsely spread across the matrix. Moreover, cache memories used to store portions of these large matrices and vectors that they interact with have limited size such that only a relatively small portion of the matrix and input/output vectors may be loaded into the cache memory at a time for performance of matrix operation. For example, if the cache size is X and a first non-zero element of the matrix interacts with an entry within a first portion of size X of a vector but a next non-zero element interacts with another entry in a second portion of the vector that lies at a location greater than size X away, then a cache miss occurs and the second portion must be retrieved from main memory or storage and loaded into the cache memory before the matrix operation can continue. Since such matrices can be very large and very sparsely populated, such cache misses happen often and result in a large source of inefficiency when performing such large sparse matrix operations.
One basic matrix operation used with sparse matrices, and which is the basis for most knowledge extraction, reasoning operations, relationship analysis, and the like, is sparse matrix to vector multiplication operation, or “matrix vector multiplication” operation. Thus, such sparse matrix vector multiplication also tends to be the basis for runtime bottlenecks in knowledge, reasoning, information extraction, and relationship analysis algorithms.
The input vector V, in this social networking example may comprise, for example, entries representing the current friend list of a person B (Jane Doe, for example). Thus, an entry in the output vector O is non-zero if the corresponding person B has at least one common friend with person A (John Smith, for example), and the more common friends that persons A and B have, the larger the entry is in the output vector O.
In an alternative example, assume that row and column indices of the matrix M represent concepts, and the intersection of row A and column B is non-zero if concept A and concept B are related, and the more related they are the larger the entry is. For example, assume that the concept “mental disorder” and concept “psychiatrist” are strongly related and this relation is represented by a non-zero and large value, while the concept “mental disorder” and the concept “ice cream” are unrelated and the corresponding entry is zero. Assume that an input vector represents concepts in a question, where an entry is non-zero if the corresponding concept is included in the question, e.g., a question “Where can I buy ice cream in Manhattan?” would result in a vector where the entry for the concept “ice cream” is non-zero and that for “Manhattan” is non-zero. Multiplying the matrix M with the input vector V results in an entry in the output vector O being non-zero if, and only if, the corresponding concept is related to either “ice cream” or “Manhattan”. Thus, an ice cream shop in Manhattan would likely have a large value in the output vector because it is related to both concepts in the input vector V. Note that this is only a basic example, and more sophisticated matrix operations (which are comprised of more matrix-vector multiplications where vectors become dense) would yield more complex results.
With such matrix and vector multiplication operations, it can be appreciated that as the matrix M and the input vector V become larger, the reading in of selected elements of the matrix M and the input vector V causes cache misses due to the limited size of the cache memory and the large size of the matrix and/or vector that is being processed. These cache misses dominate the runtime cost of performing the matrix multiplication operation.
For example, using the elements of
In the case of sparse matrix vector multiplication, whether this hope materializes, i.e. the speculative loading of data into the cache results in cache hits, depends on the column index of the next non-zero entries in the matrix M. That is, the speculative loading of the cache results in a cache hit only when the next column index happens to fall in the portion that was loaded around the selected entry 120.
In a social network example, suppose a row in the matrix M represents Tom's friend list, and Tom has five friends. If these five friends are indexed as the 1000001th person, 1000002th person, . . . 1000005th person, then their entries in the input vector V are loaded into cache memory together when the processor first asks for the 1000001th entry, and therefore there are no cache misses and subsequent data requests for 1000002th to 1000005th entries in the input vector V are satisfied by the data already present in the cache memory due to the speculative loading of the cache memory. On the other hand, if Tom's five friends are indexed as the 1000000th person, 2000000th person, . . . 5000000th person, then cache misses will happen while processing this row of the matrix M, and the processor has to make separate requests to load each of the five entries in the input vector V from main memory. The wait time for each loading from main memory can be hundreds of times that of an arithmetic operation. These cache misses happen in the processing of each row of the matrix M, and their total latencies add up to a dominant portion of sparse matrix-vector multiplication runtime operation.
In the example matrix multiplication operation of
In both cases as shown in
One way to make the matrix more compact is to utilize matrix reorganization mechanisms to reorganize the matrix such that the non-zero values are closer together. The Cuthill-McKee algorithm is one type of algorithm that reorganizes the matrix to concentrate non-zero values along the diagonal of the matrix. Another method of performing such compaction is described in commonly assigned and co-pending U.S. patent application Ser. No. 14/611,297 (Attorney Docket No. AUS920150003US1), entitled “Matrix Ordering for Cache Efficiency in Performing Large Sparse Matrix Operations,” filed Feb. 2, 2015, which is hereby incorporated by reference.
Another way to improve the performance of the matrix vector multiplication operation is to represent the matrix in one or more compressed formats that concentrate on the non-zero values in the matrix. By compressing the matrix representation into a compressed format that is directed to the non-zero values, the matrix may be more efficiently loaded into cache memory and analyzed to identify non-zero values to multiply by the vector input to generate a vector output.
To illustrate this further, it should be appreciated that, in a basic approach, a matrix is typically stored in main memory or storage as a two-dimensional array. Each entry in the array represents an element aij of the matrix and is accessed by the two indices i and j, where i conventionally refers to the row index numbered from top to bottom, and j refers to the column index, numbered from left to right. For an m×n matrix, the amount of memory required to store the matrix in this format is proportional to m×n.
In the case of a sparse matrix, substantial memory requirement reductions can be realized by storing only the non-zero entries. Depending on the number and distribution of the non-zero entries, different data structures can be used and yield large savings in memory usage when compared to the basic approach. Some data structures, such as Dictionary of Keys (DOK), list of lists, or Coordinate list (COO) provide for efficient modification of the data structures, while other data structures, such as Compressed Sparse Row (CSR) and Compressed Sparse Column (CSC) support efficient access and matrix operations. The DOK data structure comprises a dictionary that maps (row, column) pairs to values of the elements with any elements that are missing from the dictionary being assumed to be zero. List of Lists data structures store one list per row with each entry containing the column index and the value. COO stores a list of (row, column, value) tuples sorted by row index and then column index.
Another type of data structure format that is sometimes used is referred to the Yale sparse matrix format, which stores an initial m×n matrix, M, in row form using three one-dimensional arrays, or vectors, (A, IA, JA). To further illustrate the Yale sparse matrix format, let NNZ denote the number of non-zero entries in the matrix M (Note that zero-based indices shall be used here, i.e. indices start at (0, 0)). The array A is of length NNZ and holds all the non-zero entries of M in left-to-right top-to-bottom (“row-major”) order. The array IA is of length m+1 and contains the index in A of the first element in each row, followed by the total number of non-zero elements NNZ. IA[i] contains the index in A of the first non-zero element of row i. Row i of the original matrix extends from A[IA[i]] to A[IA[i+1]−1], i.e. from the start of one row to the last index before the start of the next row. The last entry, IA[m], must be the number of elements in A. The third array, JA, contains the column index in the matrix M of each element of A and hence is of length NNZ as well.
For example, assume that one has the following example matrix M, which is a 4×4 matrix with 4 non-zero elements:
Using the Yale sparse matrix format, the values of the arrays A, IA, and JA are as follows:
Thus, in array JA, the element “5” from A has column index 0, “8” and “6” have index 1, and element “3” has index 2. In this case, the Yale sparse matrix format contains 13 entries, compared to 16 in the original matrix. The Yale sparse matrix format saves on memory only when NNZ<(m (n−1)−1)/2. It can be appreciated that as the size of the matrix increases, and the sparsity (ratio of non-zero to zero entries) increases, the memory, savings is substantially increased. Thus, a smaller size memory, and cache memory, is needed to load and store the matrix M using this compressed format.
CSR is effectively identical to the Yale sparse matrix format, except that the column array is normally stored ahead of the row index array, i.e. CSR format is (val, col_ind, row_ptr), where val is an array of the (left-to-right, then top-to-bottom) non-zero values of the matrix, col_ind is the column indices corresponding to the non-zero values, and, row_ptr is the list of value indexes where each row starts. CSC is similar to CSR except that values are read first by column, a row index is stored for each value, and column pointers are stored, i.e. CSC format is (val, row_ind, col_ptr), where val is an array of the (top-to-bottom, then left-to-right) non-zero values of the matrix, row_ind is the row indices corresponding to the non-zero values, and col_ptr is the list of val indexes where each column starts.
Typically, when storing a large scale sparse matrix, one of the compressed data formats is utilized to represent the large scale sparse matrix, e.g., either Yale spares matrix format, CSR format, or CSC format. However, it has been recognized that, to facilitate parallel execution of matrix vector multiplication operations, different formats are more efficient based on the sparsity of the vector with which the matrix is being multiplied.
For example, it has been recognized that CSR formatted matrices are more suitable for parallel execution of matrix vector multiplication operations for dense vectors, i.e. vectors having more non-zero values than zero values. This is because CSR orders the non-zero values of the matrix row by row and allows non-zero values of a row to be grouped together with the value of the vector with which they are being multiplied. As a result, each multiplication of a row by a vector element can be distributed to a different worker, i.e. thread, engine, processor, or the like (collectively referred to herein as “workers”).
For example,
As shown in
As shown in the pseudo-code for performing the partial matrix vector multiplication operations, for each row i, and for each pointer value k in the ptr array 236, a partial matrix vector multiplication operation result is generated as y[i]=y[i]+val[k]*x[ind[k]], essentially calculating the matrix vector multiply kernel noted above for each row of the matrix A. The result is a sum of weighted rows. It should be noted that the calculations associated with each row can be performed in parallel at substantially a same time and thus, may be distributed to different workers.
As shown in
As shown in the pseudo-code for performing the partial matrix vector multiplication operations, for each column i, and for each pointer value k in the ptr array 266, a partial matrix vector multiplication operation result is generated as y[ind[k]]=y[ind[k]]+val[k]*x[k], essentially calculating the matrix vector multiply kernel noted above for each column of the matrix A. This results in a sum of weighted columns. It should be noted that the calculations associated with each vector value x[k] can be distributed for small numbers of non-zero x[k] values to exploit the superposition. Since the x vector can be represented by the sum of many single-entry vectors, their corresponding outputs (y[ ]) can simply be added together for the final output vector.
Thus, while CSR and CSC formatted data structures may be used to represent a large scale sparse matrix in a compact manner within memory, each of these formats provides different levels of efficiency for parallel execution in a data processing system based on the sparsity of the vector with which the matrix is being multiplied in a matrix vector multiplication operation. The CSR representation of the matrix is suitable and more efficient for parallel execution for dense vectors X while the CSC representation of the matrix is suitable and more efficient for sparse vectors X. The illustrative embodiments leverage this difference in format efficiency to provide a hybrid approach to performing matrix vector multiplication operations. The matrix representation that is utilized in the illustrative embodiments is dependent upon the sparsity of the vector.
Since knowledge extraction, information extraction, relationship analysis, and other complex processes for obtaining information from large scale networks or matrices utilize multiple iterations of matrix operations, which comprise matrix vector multiplication operations, the density of the vectors by which the matrix is multiplied tends to increase with subsequent iterations. Thus, a vector X, in an initial iteration of process may be rather sparse, while in later iterations the vector X may become denser. For example, an initial iteration may determine “what concepts are related to concept A” which may be determined by multiplying the matrix M by a vector X where the entry in vector X that is a non-zero value is the entry corresponding to concept A. This operation may output a result as an output vector of Y having a plurality of non-zero elements. In order to determine what other concepts may be related to concept A, it is necessary to then multiply matrix M by the vector Y to determine what concepts are related to the concepts in vector Y. As a result, an output vector Z may be generated that includes an even larger set of non-zero elements. This may continue until the difference in number of non-zero elements in the output vector from the previous output vector converges, i.e. does not exceed a predetermined threshold at which point the process is complete and the result is the combination of the vector outputs. Thus, it can be seen that as the vectors X, Y, and Z, etc. become more dense with each subsequent iteration of the process, and hence, different matrix representations may be more efficient for parallel execution of subsequent iterations.
The illustrative embodiments dynamically modify the matrix representation used during iterations of a knowledge, information, or relationship extraction process, or other analytical process operating on a large scale matrix by either providing a predetermined number of iterations in which a first matrix representation is utilized with subsequent switching to a second matrix representation during subsequent iterations, or providing a mechanism for evaluating the sparsity of the vector of the matrix vector multiplication operations being performed during an iteration of the process with a threshold sparsity value to determine if switching of the matrix representation should be performed. The selection of a matrix representation is made so as to maximize parallel execution of the partial matrix vector multiplication operations that are performed.
Before beginning the discussion of the various aspects of the illustrative embodiments in more detail, it should first be appreciated that throughout this description the term “mechanism” will be used to refer to elements of the present invention that perform various operations, functions, and the like. A “mechanism,” as the term is used herein, may be an implementation of the functions or aspects of the illustrative embodiments in the form of an apparatus, a procedure, or a computer program product. In the case of a procedure, the procedure is implemented by one or more devices, apparatus, computers, data processing systems, or the like. In the case of a computer program product, the logic represented by computer code or instructions embodied in or on the computer program product is executed by one or more hardware devices in order to implement the functionality or perform the operations associated with the specific “mechanism.” Thus, the mechanisms described herein may be implemented as specialized hardware, software executing on general purpose hardware, software instructions stored on a medium such that the instructions are readily executable by specialized or general purpose hardware, a procedure or method for executing the functions, or a combination of any of the above.
The present description and claims may make use of the terms “a”, “at least one of”, and “one or more of” with regard to particular features and elements of the illustrative embodiments. It should be appreciated that these terms and phrases are intended to state that there is at least one of the particular feature or element present in the particular illustrative embodiment, but that more than one can also be present. That is, these terms/phrases are not intended to limit the description or claims to a single feature/element being present or require that a plurality of such features/elements be present. To the contrary, these terms/phrases only require at least a single feature/element with the possibility of a plurality of such features/elements being within the scope of the description and claims.
In addition, it should be appreciated that the following description uses a plurality of various examples for various elements of the illustrative embodiments to further illustrate example implementations of the illustrative embodiments and to aid in the understanding of the mechanisms of the illustrative embodiments. These examples intended to be non-limiting and are not exhaustive of the various possibilities for implementing the mechanisms of the illustrative embodiments. It will be apparent to those of ordinary skill in the art in view of the present description that there are many other alternative implementations for these various elements that may be utilized in addition to, or in replacement of, the examples provided herein without departing from the spirit and scope of the present invention.
It should be appreciated that the present invention may be a system, a method, and/or a computer program product. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention.
The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.
As mentioned above, the mechanisms of the illustrative embodiments provide a hybrid matrix representation mechanism for performing matrix vector operations as part of an analytics process. The mechanism of the illustrative embodiments selects a matrix representation based on the sparsity of the vector being multiplied by the matrix for the particular iteration of the process. Thereafter, parallel execution of partial matrix vector multiplication operations are performed until the iterations of the process converge and a final output is generated as the sum of the partial matrix vector multiplication operation results.
In another example, the matrix may represent users of a service, such as a social networking service, and relationships between such users. Strengths of the relationships between users may be specified by the values associated with the edges between nodes (which represent the users themselves). As such, the resulting matrix will have indices representing the users and values within the matrix corresponding to the strength (or weight) values associated with the edges between the users.
It should be appreciated that in other systems, the matrix may represent other types of entities, concepts, information, or the like, and relationships between these entities, concepts, information, etc. The generation of such networks, graphs, and corresponding matrix representations is generally known in the art and thus, a more detailed explanation is not presented herein. It is assumed for purposes of this description that the matrix has already been generated through any known or later developed mechanism for generating such a matrix, and is provided as input to the mechanisms of the illustrative embodiments.
Having received the matrix as input, the mechanisms of the illustrative embodiments generate a plurality of compressed representation data structures of the matrix, each compressed representation data structure being for a different type of compressed representation of the matrix (step 320). The compressed representations represent the matrix in a compressed manner, preferably by concentrating the representation on specifying the non-zero values within the matrix and assuming that any values not represented by the compressed representation are zero values. For example, the plurality of compressed representations, in one illustrative embodiment, comprises a CSR representation and a CSC representation. Other representations may also be utilized, including, but not limited to, the Yale sparse matrix representation, for example. In some illustrative embodiments, the compressed representation represents the matrix as a plurality of arrays or vectors that focus on the non-zero values present within the input matrix.
A vector is received that specifies the entity, concept, information, or the like, of interest (step 330). For example, the vector may have multiple entries for different concepts that can be the basis for the evaluation of the matrix with one of these entries being set to a non-zero value to indicate the particular concept of interest, e.g., concept i in
For an initial set of iterations of the process, a first matrix representation data structure is selected for use in performing the partial matrix vector multiplication operations (step 340). In one illustrative embodiment, this first matrix representation may be the CSC matrix representation data structure which, as discussed above, is efficient for sparse vectors. For example, with a vector input that has a single non-zero value in the vector, e.g., concept i, during a first iteration 342 of the process a CSC matrix representation data structure may be selected and CSC based sparse matrix multiplication operations may be performed to generate a partial matrix vector multiplication output. Alternatively, since the vector has only a single non-zero value, a lookup in the CSC formulation data structure may be performed for the i'th vector which is then used as the output for the partial matrix vector multiplication operation of the first iteration.
For a second iteration 344 of the process, the CSC representation data structure may again be utilized to perform a partial matrix vector multiplication operation for this iteration using the vector output of the first iteration as the vector to multiply with the matrix for this second iteration. During this iteration, a weighted sum of columns of the CSC representation data structure based on the output vector of the first iteration is generated. As noted above in the description of the CSC representation with regard to
As shown in
Hence, in addition to the parallelization of step 340 above, step 350 may be performed in parallel using multiple workers as well. Thus, parallelization of the matrix vector multiplication operation is maximized through the selection of compressed matrix representations that are suited to the particular sparsity of the vector involved in the iteration of the matrix vector multiplication operation and overall process. The workers may be separate processors, service processors, graphics processors, general purpose computing on graphics processing units (GPGPUs), various hardware/software engines present in one or more data processing systems/devices, separate threads on the same or different processing devices, or the like.
The parallel partial matrix vector multiplication operations 350 may be repeated until the iterations of the process converge (step 360). Iterations typically converge (step 360) based on monitoring the change in the output vector. If the output vector change becomes very small in relative terms and in magnitude, the iterations are deemed to be converged, and the system generates the output vector (step 370). Based on a benchmark set that typically represents the test cases, the iteration convergence can be also be set as a fixed number of iterations. For example, one could set the number of iterations to 5 based on the benchmark test, where the final output vector is generated upon execution of the fifth iteration.
The resulting vector output generated from the convergence of the iterations is then output as the final result of the process (step 370). For example, if the process was attempting to find concepts related to concept A, then the resulting vector output would have non-zero values in each entry of the vector corresponding to a concept that is related either directly or indirectly with concept A, as determined from the multiple iterations of the matrix vector multiplication operation.
It should be appreciated that this process can be extended to instances where there are multiple vector inputs. In such a case, as shown in
While
A next iteration of the matrix operation is then initiated (step 440). At the start of the matrix operation, the “next iteration” is the first iteration and utilized the vector that is input in step 430. In subsequent iterations, the input vector will be the output vector generated from the previous iteration of the matrix operation.
The sparsity (or alternatively the density) of the input vector is calculated and compared to one or more sparsity (or density) threshold values (step 450). It should be appreciated that sparsity and density are alternative sides of the same characteristics. Both measure a relation between zero and non-zero values in the input vector. When the number of zero values in the input vector is greater than the number of non-zero values, the input vector is more sparse, or less dense. When the number of zero values in the input vector is less than the number of non-zero values in the input vector, then the input vector is less sparse, or more dense. Thus, sparsity or density may be evaluated in this operation. Hereafter, it will be assumed that sparsity is utilized for purposes of illustration.
Based on results of the comparison, a corresponding compressed matrix representation data structure is selected for use with the current iteration (step 460). For example, if the sparsity of the input vector is equal to or greater than a sparsity threshold value, i.e. the vector is sufficiently sparse, then a first compressed matrix representation data structure (e.g., CSC) is selected for use during the present iteration. However, if the sparsity of the input vector is less than the sparsity threshold value, i.e. the input vector is dense, then a second compressed matrix representation data structure (e.g., CSR) is selected for use during the present iteration. Of course this may be extended to additional types of compressed matrix representations based on additional threshold values such that as the density continues to increase, other compressed matrix representations suitable for parallelized execution at higher density input vectors may be selected.
The iteration of the matrix operation is then executed in a parallel manner using the selected compressed matrix representation data structure (step 470). A determination is made as to whether the iterations have converged (step 480) and, if not, the operation returns to step 440 with the input vector now being the output vector of the previous iteration. Otherwise, if the iterations have converged, then the output vector is generated as the aggregate of the output vectors of the partial matrix vector multiplication operations performed during the iterations (step 490).
Thus, the illustrative embodiments provide a hybrid compressed matrix representation based matrix vector multiplication operation mechanism which greatly increases the possibility of parallel execution of the matrix vector multiplication operation and thus, the efficiency with which the overall matrix operation or process is performed. The matrix operation or process may take many different forms depending upon the particular knowledge or information extraction, relationship extraction, or other analytical process being performed.
In one illustrative embodiment, the matrix operation may be a personalized PageRank matrix operation which ranks web pages based on the correspondence of the concepts within the web pages to private personalized profiles. In such an implementation, the matrix would represent the concepts of one or more web pages of a corpus of web pages while the input vector would represent the private, personalized profile. The mechanisms of the illustrative embodiments improve the efficiency by which the personalized PageRank mechanism operates by selecting the best compressed matrix representation to utilized for the particular sparsity (or density) of the vector being multiplied by the matrix.
In other implementations, the mechanisms of the illustrative embodiments may be implemented with various natural language processing (NLP) systems that process natural language text, passages, or documents in electronic form to perform a desired operation. For example, an NLP system may evaluate documents, such as web pages or the like, to identify documents that are related to one another. One type of NLP system in which the mechanisms of the illustrative embodiments may be utilized is a Question and Answer, or Question Answering, (QA) system which accepts as an input, a natural language question and processes the natural language question to attempt to generate an answer for the question based on content in a corpus or corpora of electronic documents, web pages, passages, or other textual information. In such a case, the matrix may represent the concepts, textual terms, or other information elements of a document or a corpus/corpora, while the input vector may represent features of the input question.
One example of a QA system in which the mechanisms of the illustrative embodiments may be implemented is the IBM Watson™ QA system available from IBM Corporation.
Since the QA system is used as one example of the implementation environment for the mechanisms of the illustrative embodiments, it is important to first have an understanding of how question and answer creation in a QA system is implemented before describing how the mechanisms of the illustrative embodiments are integrated in and augment such QA systems. It should be appreciated that the QA mechanisms described in
As an overview, a Question Answering system (QA system) is an artificial intelligence application executing on data processing hardware that answers questions pertaining to a given subject-matter domain presented in natural language. The QA system receives inputs from various sources including input over a network, a corpus of electronic documents or other data, data from a content creator, information from one or more content users, and other such inputs from other possible sources of input. Data storage devices store the corpus of data. A content creator creates content in a document for use as part of a corpus of data with the QA system. The document may include any file, text, article, or source of data for use in the QA system. For example, a QA system accesses a body of knowledge about the domain, or subject matter area, e.g., financial domain, medical domain, legal domain, etc., where the body of knowledge (knowledgebase) can be organized in a variety of configurations, e.g., a structured repository of domain-specific information, such as ontologies, or unstructured data related to the domain, or a collection of natural language documents about the domain.
Content users input questions to the QA system which then answers the input questions using the content in the corpus of data by evaluating documents, sections of documents, portions of data in the corpus, or the like. When a process evaluates a given section of a document for semantic content, the process can use a variety of conventions to query such document from the QA system, e.g., sending the query to the QA system as a well-formed question which are then interpreted by the QA system and a response is provided containing one or more answers to the question. Semantic content is content based on the relation between signifiers, such as words, phrases, signs, and symbols, and what they stand for, their denotation, or connotation. In other words, semantic content is content that interprets an expression, such as by using Natural Language Processing.
As will be described in greater detail hereafter, the QA system receives an input question, parses the question to extract the major features of the question, uses the extracted features to formulate queries, and then applies those queries to the corpus of data. Based on the application of the queries to the corpus of data, the QA system generates a set of hypotheses, or candidate answers to the input question, by looking across the corpus of data for portions of the corpus of data that have some potential for containing a valuable response to the input question. The QA system then performs deep analysis, e.g., English Slot Grammar (ESG) and Predicate Argument Structure (PAS) builder, on the language of the input question and the language used in each of the portions of the corpus of data found during the application of the queries using a variety of reasoning algorithms (see, for example, McCord et al., “Deep Parsing in Watson,” IBM J. Res. & Dev., vol. 56, no. 3/4, May/July 2012 for more information on deep analysis in IBM Watson™). There may be hundreds or even thousands of reasoning algorithms applied, each of which performs different analysis, e.g., comparisons, natural language analysis, lexical analysis, or the like, and generates a score. For example, some reasoning algorithms may look at the matching of terms and synonyms within the language of the input question and the found portions of the corpus of data. Other reasoning algorithms may look at temporal or spatial features in the language, while others may evaluate the source of the portion of the corpus of data and evaluate its veracity.
The scores obtained from the various reasoning algorithms indicate the extent to which the potential response is inferred by the input question based on the specific area of focus of that reasoning algorithm. Each resulting score is then weighted against a statistical model. The statistical model captures how well the reasoning algorithm performed at establishing the inference between two similar passages for a particular domain during the training period of the QA system. The statistical model is used to summarize a level of confidence that the QA system has regarding the evidence that the potential response, i.e. candidate answer, is inferred by the question. This process is repeated for each of the candidate answers until the QA system identifies candidate answers that surface as being significantly stronger than others and thus, generates a final answer, or ranked set of answers, for the input question.
As mentioned above, QA systems and mechanisms operate by accessing information from a corpus of data or information (also referred to as a corpus of content), analyzing it, and then generating answer results based on the analysis of this data. Accessing information from a corpus of data typically includes: a database query that answers questions about what is in a collection of structured records, and a search that delivers a collection of document links in response to a query against a collection of unstructured data (text, markup language, etc.). Conventional question answering systems are capable of generating answers based on the corpus of data and the input question, verifying answers to a collection of questions for the corpus of data, correcting errors in digital text using a corpus of data, and selecting answers to questions from a pool of potential answers, i.e. candidate answers.
Content creators, such as article authors, electronic document creators, web page authors, document database creators, and the like, determine use cases for products, solutions, and services described in such content before writing their content. Consequently, the content creators know what questions the content is intended to answer in a particular topic addressed by the content. Categorizing the questions, such as in terms of roles, type of information, tasks, or the like, associated with the question, in each document of a corpus of data allows the QA system to more quickly and efficiently identify documents containing content related to a specific query. The content may also answer other questions that the content creator did not contemplate that may be useful to content users. The questions and answers may be verified by the content creator to be contained in the content for a given document. These capabilities contribute to improved accuracy, system performance, machine learning, and confidence of the QA system. Content creators, automated tools, or the like, annotate or otherwise generate metadata for providing information useable by the QA system to identify these question and answer attributes of the content.
Operating on such content, the QA system generates answers for input questions using a plurality of intensive analysis mechanisms which evaluate the content to identify the most probable answers, i.e. candidate answers, for the input question. The most probable answers are output as a ranked listing of candidate answers ranked according to their relative scores or confidence measures calculated during evaluation of the candidate answers, as a single final answer having a highest ranking score or confidence measure, or which is a best match to the input question, or a combination of ranked listing and final answer.
The QA system 500 is configured to implement a QA system pipeline 508 that receive inputs from various sources. For example, the QA system 500 receives input from the network 502, a corpus of electronic documents 506, QA system users, and/or other data and other possible sources of input. In one embodiment, some or all of the inputs to the QA system 500 are routed through the network 502. The various computing devices 504 on the network 502 include access points for content creators and QA system users. Some of the computing devices 504 include devices for a database storing the corpus of data 506 (which is shown as a separate entity in
In one embodiment, the content creator creates content in a document of the corpus of data 506 for use as part of a corpus of data with the QA system 500. The document includes any file, text, article, or source of data for use in the QA system 500. QA system users access the QA system 500 via a network connection or an Internet connection to the network 502, and input questions to the QA system 500 that are answered by the content in the corpus of data 506. In one embodiment, the questions are formed using natural language. The QA system 500 parses and interprets the question, and provides a response to the QA system user, e.g., QA system user 510, containing one or more answers to the question. In some embodiments, the QA system 500 provides a response to users in a ranked list of candidate answers while in other illustrative embodiments, the QA system 500 provides a single final answer or a combination of a final answer and ranked listing of other candidate answers.
The QA system 500 implements a QA system pipeline 508 which comprises a plurality of stages for processing an input question and the corpus of data 506. The QA system pipeline 508 generates answers for the input question based on the processing of the input question and the corpus of data 506. The QA system pipeline 508 will be described in greater detail hereafter with regard to
In some illustrative embodiments, the QA system 500 may be the IBM Watson™ QA system available from International Business Machines Corporation of Armonk, N.Y., which is augmented with the mechanisms of the illustrative embodiments described hereafter. As outlined previously, the IBM Watson™ QA system receives an input question which it then parses to extract the major features of the question, that in turn are then used to formulate queries that are applied to the corpus of data. Based on the application of the queries to the corpus of data, a set of hypotheses, or candidate answers to the input question, are generated by looking across the corpus of data for portions of the corpus of data that have some potential for containing a valuable response to the input question. The IBM Watson™ QA system then performs deep analysis on the language of the input question and the language used in each of the portions of the corpus of data found during the application of the queries using a variety of reasoning algorithms. The scores obtained from the various reasoning algorithms are then weighted against a statistical model that summarizes a level of confidence that the IBM Watson™ QA system has regarding the evidence that the potential response, i.e. candidate answer, is inferred by the question. This process is be repeated for each of the candidate answers to generate ranked listing of candidate answers which may then be presented to the user that submitted the input question, or from which a final answer is selected and presented to the user. More information about the IBM Watson™ QA system may be obtained, for example, from the IBM Corporation website, IBM Redbooks, and the like. For example, information about the IBM Watson™ QA system can be found in Yuan et al., “Watson and Healthcare,” IBM developerWorks, 2011 and “The Era of Cognitive Systems: An Inside Look at IBM Watson and How it Works” by Rob High, IBM Redbooks, 2012.
As shown in
The compressed matrix representation generator 522 of the matrix operation engine 520 comprises logic that operates to generate a plurality of compressed matrix representations of an input matrix for use in performing matrix operations. For example, the compressed matrix representation generator 522 may generate a CSR and a CSC representation of an input matrix which may be stored by the matrix operation engine 520 and utilized when performing iterations of a matrix operation as described previously, based on the sparsity of the input vector that the matrix is being multiplied with.
The vector sparsity evaluator 524 comprises logic that operates to determine the sparsity (or density) of an input vector. The sparsity of the input vector may be calculated as a ratio, or percentage, of the zero values to non-zero values, or non-zero values to zero values, in the input vector. In addition, the vector sparsity evaluate 524 may comprise logic to compare the calculated sparsity (or density) of the input vector to one or more threshold values to determine if a predetermined relationship exists between the calculated sparsity (or density value) and the one or more thresholds. For example, a determination may be whether or not the sparsity value is equal to or greater than the threshold value, less than the threshold value, or similar evaluation with regard to density value. It should be appreciated that this evaluation may be performed for each iteration of a matrix operation such that the input vector is the output vector of a previous iteration.
The compressed matrix representation selector 526 comprises logic that selects a compressed matrix representation based on the results of the evaluation made by the vector sparsity evaluator 524. For example, if the sparsity of the input vector is equal to or greater than a threshold value, then a first compressed matrix representation may be selected (e.g., CSC), whereas if it is less than the threshold value, then a second compressed matrix representation may be selected (e.g., CSR).
The matrix operation engine 520 may comprise further logic, not explicitly shown, for actually performing the partial matrix vector multiplication operations, matrix operations, and the like, and generating an output that is returned to the QA system 500 for use in evaluating the question and corpus and generating candidate answer output. This other logic may perform the matrix operations in the manner previously described above using the selection of the compressed matrix representations in accordance with the illustrative embodiments based on the sparsity of the vector.
In the depicted example, data processing system 600 employs a hub architecture including north bridge and memory controller hub (NB/MCH) 602 and south bridge and input/output (I/O) controller hub (SB/ICH) 604. Processing unit 606, main memory 608, and graphics processor 610 are connected to NB/MCH 602. Graphics processor 610 is connected to NB/MCH 602 through an accelerated graphics port (AGP).
In the depicted example, local area network (LAN) adapter 612 connects to SB/ICH 604. Audio adapter 616, keyboard and mouse adapter 620, modem 622, read only memory (ROM) 624, hard disk drive (HDD) 626, CD-ROM drive 630, universal serial bus (USB) ports and other communication ports 632, and PCI/PCIe devices 634 connect to SB/ICH 604 through bus 638 and bus 640. PCI/PCIe devices may include, for example, Ethernet adapters, add-in cards, and PC cards for notebook computers. PCI uses a card bus controller, while PCIe does not. ROM 624 may be, for example, a flash basic input/output system (BIOS).
HDD 626 and CD-ROM drive 630 connect to SB/ICH 604 through bus 640. HDD 626 and CD-ROM drive 630 may use, for example, an integrated drive electronics (IDE) or serial advanced technology attachment (SATA) interface. Super I/O (SIO) device 636 is connected to SB/ICH 604.
An operating system runs on processing unit 606. The operating system coordinates and provides control of various components within the data processing system 600 in
As a server, data processing system 600 may be, for example, an IBM® eServer™ System P® computer system, running the Advanced Interactive Executive (AIX®) operating system or the LINUX® operating system. Data processing system 600 may be a symmetric multiprocessor (SMP) system including a plurality of processors in processing unit 606. Alternatively, a single processor system may be employed.
Instructions for the operating system, the object-oriented programming system, and applications or programs are located on storage devices, such as HDD 626, and are loaded into main memory 608 for execution by processing unit 606. The processes for illustrative embodiments of the present invention are performed by processing unit 606 using computer usable program code, which is located in a memory such as, for example, main memory 608, ROM 624, or in one or more peripheral devices 626 and 630, for example.
A bus system, such as bus 638 or bus 640 as shown in
Those of ordinary skill in the art will appreciate that the hardware depicted in
Moreover, the data processing system 600 may take the form of any of a number of different data processing systems including client computing devices, server computing devices, a tablet computer, laptop computer, telephone or other communication device, a personal digital assistant (PDA), or the like. In some illustrative examples, data processing system 600 may be a portable computing device that is configured with flash memory to provide non-volatile memory for storing operating system files and/or user-generated data, for example. Essentially, data processing system 700 may be any known or later developed data processing system without architectural limitation.
As shown in
In addition, the extracted major features include key words and phrases classified into question characteristics, such as the focus of the question, the lexical answer type (LAT) of the question, and the like. As referred to herein, a lexical answer type (LAT) is a word in, or a word inferred from, the input question that indicates the type of the answer, independent of assigning semantics to that word. For example, in the question “What maneuver was invented in the 1500s to speed up the game and involves two pieces of the same color?,” the LAT is the string “maneuver.” The focus of a question is the part of the question that, if replaced by the answer, makes the question a standalone statement. For example, in the question “What drug has been shown to relieve the symptoms of ADD with relatively few side effects?,” the focus is “drug” since if this word were replaced with the answer, e.g., the answer “Adderall” can be used to replace the term “drug” to generate the sentence “Adderall has been shown to relieve the symptoms of ADD with relatively few side effects.” The focus often, but not always, contains the LAT. On the other hand, in many cases it is not possible to infer a meaningful LAT from the focus.
Referring again to
The queries are applied to one or more databases storing information about the electronic texts, documents, articles, websites, and the like, that make up the corpus of data/information, e.g., the corpus of data 506 in
The QA system pipeline 700, in stage 750, then performs a deep analysis and comparison of the language of the input question and the language of each hypothesis or “candidate answer,” as well as performs evidence scoring to evaluate the likelihood that the particular hypothesis is a correct answer for the input question. As mentioned above, this involves using a plurality of reasoning algorithms, each performing a separate type of analysis of the language of the input question and/or content of the corpus that provides evidence in support of, or not in support of, the hypothesis. Each reasoning algorithm generates a score based on the analysis it performs which indicates a measure of relevance of the individual portions of the corpus of data/information extracted by application of the queries as well as a measure of the correctness of the corresponding hypothesis, i.e. a measure of confidence in the hypothesis. There are various ways of generating such scores depending upon the particular analysis being performed. In generally, however, these algorithms look for particular terms, phrases, or patterns of text that are indicative of terms, phrases, or patterns of interest and determine a degree of matching with higher degrees of matching being given relatively higher scores than lower degrees of matching.
Thus, for example, an algorithm may be configured to look for the exact term from an input question or synonyms to that term in the input question, e.g., the exact term or synonyms for the term “movie,” and generate a score based on a frequency of use of these exact terms or synonyms. In such a case, exact matches will be given the highest scores, while synonyms may be given lower scores based on a relative ranking of the synonyms as may be specified by a subject matter expert (person with knowledge of the particular domain and terminology used) or automatically determined from frequency of use of the synonym in the corpus corresponding to the domain. Thus, for example, an exact match of the term “movie” in content of the corpus (also referred to as evidence, or evidence passages) is given a highest score. A synonym of movie, such as “motion picture” may be given a lower score but still higher than a synonym of the type “film” or “moving picture show.” Instances of the exact matches and synonyms for each evidence passage may be compiled and used in a quantitative function to generate a score for the degree of matching of the evidence passage to the input question.
Thus, for example, a hypothesis or candidate answer to the input question of “What was the first movie?” is “The Horse in Motion.” If the evidence passage contains the statements “The first motion picture ever made was ‘The Horse in Motion’ in 1878 by Eadweard Muybridge. It was a movie of a horse running,” and the algorithm is looking for exact matches or synonyms to the focus of the input question, i.e. “movie,” then an exact match of “movie” is found in the second sentence of the evidence passage and a highly scored synonym to “movie,” i.e. “motion picture,” is found in the first sentence of the evidence passage. This may be combined with further analysis of the evidence passage to identify that the text of the candidate answer is present in the evidence passage as well, i.e. “The Horse in Motion.” These factors may be combined to give this evidence passage a relatively high score as supporting evidence for the candidate answer “The Horse in Motion” being a correct answer.
It should be appreciated that this is just one simple example of how scoring can be performed. Many other algorithms of various complexity may be used to generate scores for candidate answers and evidence without departing from the spirit and scope of the present invention.
In the synthesis stage 760, the large number of scores generated by the various reasoning algorithms are synthesized into confidence scores or confidence measures for the various hypotheses. This process involves applying weights to the various scores, where the weights have been determined through training of the statistical model employed by the QA system and/or dynamically updated. For example, the weights for scores generated by algorithms that identify exactly matching terms and synonym may be set relatively higher than other algorithms that are evaluating publication dates for evidence passages. The weights themselves may be specified by subject matter experts or learned through machine learning processes that evaluate the significance of characteristics evidence passages and their relative importance to overall candidate answer generation.
The weighted scores are processed in accordance with a statistical model generated through training of the QA system that identifies a manner by which these scores may be combined to generate a confidence score or measure for the individual hypotheses or candidate answers. This confidence score or measure summarizes the level of confidence that the QA system has about the evidence that the candidate answer is inferred by the input question, i.e. that the candidate answer is the correct answer for the input question.
The resulting confidence scores or measures are processed by a final confidence merging and ranking stage 770 which compares the confidence scores and measures to each other, compares them against predetermined thresholds, or performs any other analysis on the confidence scores to determine which hypotheses/candidate answers are the most likely to be the correct answer to the input question. The hypotheses/candidate answers are ranked according to these comparisons to generate a ranked listing of hypotheses/candidate answers (hereafter simply referred to as “candidate answers”). From the ranked listing of candidate answers, at stage 780, a final answer and confidence score, or final set of candidate answers and confidence scores, are generated and output to the submitter of the original input question via a graphical user interface or other mechanism for outputting information.
As shown in
As shown in
The matrix operation engine 799 may operate in conjunction with one or more stages, e.g., hypothesis generation stage 740, hypothesis and evidence scoring stage 750, or the like, of the QA system pipeline 700 to perform matrix operations. The matrix operation engine 799 comprises the input vector sparsity evaluator 796, which is similar to the evaluator 524 in
Thus, the illustrative embodiments provide mechanisms for improving the execution of matrix operations in a computing device by providing hybrid matrix representation mechanisms. The efficiency of the matrix operations is improved by selecting a compressed matrix representation that is well suited for parallelized execution of the matrix operation based on the sparsity of the vector utilized during each iteration of the matrix operation.
As noted above, it should be appreciated that the illustrative embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In one example embodiment, the mechanisms of the illustrative embodiments are implemented in software or program code, which includes but is not limited to firmware, resident software, microcode, etc.
A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers. Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modems and Ethernet cards are just a few of the currently available types of network adapters.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated. The terminology used herein was chosen to best explain the principles of the embodiments, the practical application or technical improvement over technologies found in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.