def f_beta(precision, recall, beta=1): """ Get F_beta score from precision and recall. """ beta = float(beta) # Make sure that results are in float return (1 + pow(beta, 2)) * (precision * recall) / ( (pow(beta, 2) * precision) + recall) if __name__ == '__main__': args = docopt.docopt(__doc__) logging.debug(args) if args['--stanford']: predicted = StanfordReader() predicted.read(args['--stanford']) if args['--props']: predicted = PropSReader() predicted.read(args['--props']) if args['--ollie']: predicted = OllieReader() predicted.read(args['--ollie']) if args['--reverb']: predicted = ReVerbReader() predicted.read(args['--reverb']) if args['--clausie']:
PTB_ESCAPES = [ ('(', '-LRB-'), (')', '-RRB-'), ('[', '-LSB-'), (']', '-RSB-'), ('{', '-LCB-'), ('}', '-RCB-'), ] if __name__ == '__main__': args = docopt.docopt(__doc__) logging.debug(args) if args['--stanford']: predicted = StanfordReader() predicted.read(args['--stanford']) if args['--props']: predicted = PropSReader() predicted.read(args['--props']) if args['--ollie']: predicted = OllieReader() predicted.read(args['--ollie']) if args['--reverb']: predicted = ReVerbReader() predicted.read(args['--reverb']) if args['--clausie']: