generate co-occurrence matrix