tweaked document_generator in pmi_cluster.py