def print_predictions(example): words = util.flatten(example["sentences"]) for cluster in example["predicted_clusters"]: print(u"Predicted cluster: {}".format([" ".join(words[m[0]:m[1]+1]) for m in cluster]))