Saturday, November 9, 2013

There is a topic mentioned in the book on Survey of Text Mining as HotMiner by Malu Castellanos. Here companies would like to find topics that are of interest to their customers i.e. hot problems and making them available on their website  along with links to corresponding solution documents. The customer support centers maintain logs of their customer interactions which becomes the source for discovering hot topics. The author uses these case logs to extract relevant sentences from cases to conform case excerpts. In addition, this approach deals with dirty text containing typos, adhoc abbreviations, incorrect grammar, cryptic tables and ambiguous and missing punctuations. They normalize the terminology with a thesaurus assistant and a sentence identifier.
The suggestion here is that the logs rather than the documents provide information on the topics that are of most interest to the customers. These are called hot topics. This works well given that the document categorization and classification - be it manual or automatic, is not sufficient to detect the topics of interest to the customers. Instead by providing the self-help solution documents by identifying the topics of these hot problems, organizations can better organize their site, reduce customer support costs and improve their customer satisfaction.
The author's approach to mine hot topics from logs of customer support centers, involves the use of two kinds of logs  - a search log and a case log. The search log keeps track of the search strings that customers formulate and the case logs keep track of the cases opened by the customers along with the history of action, events and dialogues, followed while a case is open.
These two logs are complimentary to obtain information on all problems encountered by the customer. 

Friday, November 8, 2013

We discussed the dynamic rescaling of LSI. Let's discuss the dynamic rescaling of COV. Here too, we follow a similar approach as we did with the LSI and LSI-rescaling. In COV-rescale, the residual of the covariance matrix is computed. The Covariance matrix was given by the function C = V E Vt where V is the
orthogonal matrix that diagnolizes C so that the diagonal entries of E are in monotone decreasing order going from top to bottom. Vt is the document
attribute matrix m x n with m row vectors representing documents. V is calculated as the matrix [aiq, ai2, ai3, .. ain]. V and Vt seem to be the left and
right singular vectors of the singular values of document vectors.
So the algorithm repeats the following steps for each of the k dimensions :
First, the max of the residual vector for the documents r1, r2, r3, ... rm is calculated.
Second, the value of the rescale factor is determined as a function of this value obtained from the step above.
Third, the residual matrix is computed as the magnitude of the residual term raised to the rescale factor combined with the corresponding component residual
vector. This is expressed as [(|r1|^q)r1, (|r2|^q)r2, (|r3|^q)r3, ... (|rn|^q)rn].
Fourth, we generate the Covariance matrix based on the residual matrix above.  The covariance matrix function is given above.
Fifth, we perform the singular value decomposition of the covariance matrix. This is a factorization of the real matrix that we get with the step above. The SVD decomposes the covariance matrix into three simple transformations, a rotation V followed by the scaling with E and another rotation Vt
Then we take the first row vector of Vt and perform a Gram-Schmidt transformation on the same.
We then recompute the residual matrix as R-R.b.bt
Then we repeat the iteration with the next k.
Generally speaking the COV-rescaling performs better than LSI, COV and LSI-Rescaling.

Thursday, November 7, 2013

In the previous post we talked about LSI and COV and we are seeing that these fundamentals improve our understanding of why and how to perform the cosine computations and their aggregation, when and how to reduce the dimensions and what benefits come with it and finally how to scale the implementation for large data. The last one is particularly interesting since there is no limit to how much data can be clustered and categorized. In this regard, I want to draw attention to how the document vectors are computed. The document vectors are represented as di = [ai1, ai2, ai3, ... ain] in the m document * n attribute matrix. The ai1 is computed as the attribute relevancy to term 1 in the n terms chosen for the document attribute matrix.  It could be a simple inverse document frequency for that term or it could be the (1 + tf)log2(n/df).  This is a scalar value. The cosine of the two document vectors are computed as their dot products. and the angle between them is determined by the  component wise product divided by their individual vector magnitudes.
Now we can discuss dynamic -rescaling algorithms. We saw that the LSI and COV prevented the major themes from dominating the process of selecting basis vectors for the subspace into which the IR problem is projected. This was done by weights that would decrease the relative importance of attributes that were already well represented by the basis vectors that have already been computed.
 In dynamic rescaling of LSI, the residual matrix R and Rs are computed. Initially R is set to the document term matrix A itself. We follow the same steps as the LSI until the document and query vectors are mapped into the k-dimensional subspace. The steps involved upto this point include updating the R and Rs after each iterative step by taking into account the most recently computed basis vector bi. After the kth basis vector is computed, each document vector dj in the original 1R problem is mapped to its counterpart in the subspace. The query vector is also mapped to this subspace. We rescale document vectors after the computation of the basis vectors and the residual vectors because the length of the residual vector prevents the loss of information during reduction of dimension  and we take the maximum residual vector length. The rescaling factor q is adjusted as a function of this maximum residual vector length tmax. from the previous iteration and depending on the values of tmax. For example, if tmax is greater than 1, we take the inverse as the rescaling factor. If tmax is approximately equal to 1, we just add it to 1 to compute the rescaling factor. If tmax is less than 1, we raise the tmax^-2 to the order of 10. This way we compute the rescaling factor dynamically after each iterations since the max residual vector length could change. Thus the rescaling factor prevents the deletion of vectors from overweighting or over reduction.
We talked about the cluster retrieval based on summarization and on the premise known as cluster hypothesis. This summarization data could include naturally occurring overlap of clusters. This will prevent omission of clusters that have a significant overlap with others.
LSI and COV can be used to find major document clusters. During the dimension reduction step, the minor clusters are often mistaken for noise and are discarded. There is an algorithm by Ando to identify small clusters in limited contexts. Here major themes from the documents are prevented from dominating the process of selecting the basis vectors for subspace projection step in LSI. This is done during the basis vector selection process by introducing an unfavorable weight also known as filter or negative bias to documents that belong to clusters that are well represented by basis vectors that have already been selected. This weight is computed by finding the residual of each document vector which is the proportion of the document vector that cannot be represented by the basis vectors that have been selected up to that point. Then the magnitude of the document vector is raised to a power q of the magnitude of its residual.
This process is repeated for every cluster where the document vectors are initialized by their r1, r2..rm residual and the residual matrix is calculated as R - RbibiT where bi is the first Eigenvector of RTsRs. We set R to be A initially. After each iterative step, the residual steps are updated to  take into account the new basis vector f. After the klh basis vector is computed, each document vector is mapped to its counterpart in the k-dimensional subspace. This is followed by the relevance ranking.
However, this algorithm does identify all major and minor clusters. Finding the Eigen vector may be unstable when q is large. The basis vectors may not always be orthogonal. The number of documents in the database is even moderately large, intermediate data may not fit into main memory. These shortcomings arise because there is loss of information during rescaling of document vectors after each computation.  Also the document attribute matrices are usually highly sparse but after a few iterations, the residual matrix may become very dense. COV based algorithms can overcome these.

Wednesday, November 6, 2013

In the previous post, we discussed from the article written by Koboyashi and Aono that the LSI and COV both attempt to reduce the problem to k-dimension sub-space. LSI attempted to reduce the ranks to k and COV attempted to choose k largest ^Eigen values and their corresponding vectors. On the plane where these clusters are visualized the LSI had the origin for the document vectors outside the plane while the COV had the origin inside the plane and thus with better discriminating power between the document vectors.
There are several advantages to the COV matrix. The first advantage is the better discrimination between document vectors.
The second advantage is the scalability of the computation with larger databases.
The third advantage is the computation can be distributed in the sense that the subspace can be local at  the different places where the data is spread over as Qu et al have shown. When the data is distributed across different locations, the principal components  are computed locally.  These are then sent to a centralized location and used to compute the global principal components. Further, it reduces the data transmission rates and thus is better than a parallel processing approach. However, the dominant components do not provide a good representation, then it is suggested to include up to 33% more components to improve the level of accuracy over the centralized counterpart implementation. The interesting thing here is that the size of the local data or the overall data does not seem to matter as long as the dominant components provide a  good representation.
Another way to optimize this further has been to identify clusters (or sets of documents that cover similar topics) during the pre-processing stage itself so that they can be retrieved together to reduce the query response time or even when they are to be summarized for smaller storage while processing large data. This approach is called cluster retrieval and is based on the assumption that closely related documents often satisfy the same requests. Incidentally, this summarization and other data structures from pre-processing can help alleviate a variety of problems with large data sets. One more interesting feature of both LSI and COV is that both methods recognize and preserve the naturally occurring overlap of clusters. These overlaps are interesting because they have multiple meanings and therefore are useful in database content analysis from different viewpoints. In the hard partitioning case, the clusters overlaps are removed losing this rich information. In the soft partitioning case, this is preserved and improves results. Both algorithms are not as successful at discriminating similar documents or minor document clusters. The are often mistaken as noise and discarded. On the other hand these minor clusters and outliers have significant information and can add valuable insights. They should be included as much as possible. 

Tuesday, November 5, 2013

In the previous post I mentioned about Latent Semantic Indexing and in this post I want to introduce both LSI and Covariance Matrix Analysis COV and then we could compare LSI and COV.
In LSI, we are given a database with m documents and n distinguishing attributes for relevancy ranking. A is the corresponding m x n document-attribute matrix model. The idea is to reduce the dimensions to k where k is much smaller than m or n  and where k is a ranking.
In the COV algorithm, document and query vectors are projected onto the subspace spanned by the k-eigenvectors corresponding to the corresponding to the max eigenvalues of the covariance matrix of document vectors. Thus the COV is based on selecting a subset k vectors. The covariance is computed by taking the averages along the individual component or dimensions Note that taking the averages along the individual dimensions from 1 to n is something that we find in Fuzzy SKWIC too.  So its particularly helpful to pay attention to the fundamentals here.  We define the component wise averages as d' = a1', a2' ... an'. where the ith document for i ranging from 1 to m has attributes /components as ai1, ai2, ai3, .. ain. Then the averages for each attribute is computed as the average across the m documents along that attribute. In a matrix with m documents as rows and n attributes as columns, this component-wise average translates to averaging the individual columns. This matrix can be decomposed into a set of matrices of the form VEVt where V is the orthogonal matrix that diagnolizes C, E is the diagonal matrix whose diagonal values are in decreasing order from top to bottom and proceeding from left to right and finally Vt which is the term matrix.  The diagonal values with k-largest are used to construct the eigen vectors v1, v2, ... vk that reduces the dimensions to k from m,n. In other words all the document vectors and the query vectors are then projected into the subspace defined by these k-eigen vectors.  The difference between COV and LSI is that in the LSI we reduce the dimensions to k while in the COV we select a subset of vectors and transform the document and query vectors to a subspace involving a subset k eigenvectors.  By reducing the dimensions, the vectors continue to have the same origin and there is less distinction between the documents in the document-attribute matrix.  In the covariance analysis, the origin is the center of the basis vectors in the subspace so that the document vectors are more evenly spaced so that the document vectors are more evenly spaced. This enables finer detection of  differences between document vectors in different clusters. Both COV and LSI project the query and document vectors into the k-dimensional subspace and then measure similarity between documents.
 Another advantage with COV is that the computations for the k eigenvectors and Eigen values are independent of the document vectors and query vectors. So they need not be performed for each document and query vector and since this is done only once, the document and query vectors can be processed in near real-time. This is a significant advantage when compared with the LSI which did not scale as the size of the database grew. However, the cost for the Eigen-vectors is still significant in comparision to the cost of the individual vector processing.

Monday, November 4, 2013

I will continue today's discussion on the fuzzy SKWIC implementation. We are getting closer to covering the implementation details. The computations for the feature weights, fuzzy membership labels and tau involve components that we could be better prepared for. Although we have discussed the sequence, we are looking at it for the storage or data structures. And to pick up the thread where we left off from the previous post, we have not discussed whether the sample data collections a sufficient for our case since the test document could be from any origin. The sample we collect was part of a predefined finite set of categories of documents. Hence. The given test document could enc
"up as a noise in a cluster. So we have to avoid that as much as possible. One way would have been to used conditional probability. but we did not proceed with it because we will have to use PLSI techniques such as a probability that a randomly selected occurrence of term t has source document d and the randomly selected term occurrence from d is an instance of term t as Wartena put it. There is a standard to building a Vector Space Model for information retrieval. One of the advantages of the method is that it enables relevance ranking of documents of heterogeneous format (eg text, multilingual text, ) with respect to the user input queries as long as the attributes are well defined characteristics of the documents. If the attribute is present, the corresponding co-ordinate for the document vector is unity and when the attribute is absent, the coordinate is zero. This is called the binary vector model. Term weighting is another model that is a refinement over the Boolean model. When the term-weight is Term frequency  Inverse document frequency TF-IDF , the weight of the ith term in the jth document is defined as weight(i, j) = (1 + tf) log n /df when the term frequency is >= 1 and 0 if the term frequency is equal to zero and where df is the number of documents in which the term appears out of n. Given a single query term , two documents can be ranked for similarity based on the difference in the angles their vectors make with respect to q and hence the use of cosine. Cosine is simpler to use than the computing the Euclidean distance since we want relative comparision. Every query is modeled as  a vector using the same attribute space as the documents. Even this similarity measure is too time-consuming for computation in real time for large databases. This is a serious concern for massive databases.  In addition, users consistently select the most relevant features from the IR engines. Scalability of such techniques suffers simply because of the large number of dimensions involved in such computations.
 One approach is to reduce the number of dimensions by transforming it to a subspace with sufficiently small dimensions  that enable fast response time.  The subspace should still be able to discriminate contents of individual documents. This is where Latent Semantic Indexing helps and when it is probability such that the weights add up to unity, we call it Probabilistic Latent Semantic Indexing. For our implementation, we are first concerned with a working implementation prior to using LSI or PLSI and performance optimization techniques.