()
| 124 | |
| 125 | |
| 126 | def main(): |
| 127 | parser = argparse.ArgumentParser() |
| 128 | parser.add_argument('--paths', required=True, nargs='+', |
| 129 | help='paths to checkpoint directories used in ensemble') |
| 130 | parser.add_argument('--eval', action='store_true', |
| 131 | help='compute accuracy metrics against labels (dev set)') |
| 132 | parser.add_argument('--outdir', |
| 133 | help='directory to place ensembled predictions in') |
| 134 | parser.add_argument('--prediction-name', default='test_predictions.pt', |
| 135 | help='name of predictions in checkpoint directories') |
| 136 | parser.add_argument('--calc-threshold', action='store_true', |
| 137 | help='calculate threshold classification') |
| 138 | parser.add_argument('--one-threshold', action='store_true', |
| 139 | help='use on threshold for all subdatasets') |
| 140 | parser.add_argument('--threshold', nargs='+', default=None, type=float, |
| 141 | help='user supplied threshold for classification') |
| 142 | parser.add_argument('--labels', nargs='+', default=None, |
| 143 | help='whitespace separated list of label names') |
| 144 | args = parser.parse_args() |
| 145 | ensemble_predictions(args) |
| 146 | |
| 147 | |
| 148 | if __name__ == '__main__': |
no test coverage detected