Improvements to calc_precision_recall.py.