A co-occurrence matrix, also referred to as a co-occurrence distribution, is defined over an image to be the distribution of co-occurring values at a given offset. Any matrix or pair of matrices can be used to generate a co-occurrence matrix, though their most common application and also in best SEO strategies.
In this case, we used co-occurrence matrix to differ out the co-occurring terms from the main site’s content and the competitor site’s content in a matrix form. The terms which appear mostly in the matrix have high TF(term frequency).
Fetching the file:
Creating corpus and cleaning it:
Creating a document term matrix:
Creating the co-occurrence matrix: