Example #1
0
File: bovw.py Project: apacha/mscr
 def load(self, infile):
     assert pex(infile), 'bovw.py: %s dosen\'t exist' % infile
     self._vq, self._cl = pickle.load(open(infile, 'rb'))
Example #2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Usage: fit_bovw.py -i <prep_data> -o <out>

Options:
    -h --help
"""


def parse_args():
    args = docopt(__doc__)
    infile = args['<prep_data>']
    outfile = args['<out>']
    return infile, outfile

if __name__ == '__main__':
    from os.path import exists as pex
    from docopt import docopt
    from mscr.bovw import BoVW

    infile, outfile = parse_args()
    assert pex(infile), "file %s dosen't exist" % infile

    bbb = BoVW()
    bbb.fit_from_prep(infile)
    bbb.save(outfile)
Example #3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage: fit_bovw.py -i <prep_data> -o <out>

Options:
    -h --help
"""


def parse_args():
    args = docopt(__doc__)
    infile = args['<prep_data>']
    outfile = args['<out>']
    return infile, outfile


if __name__ == '__main__':
    from os.path import exists as pex
    from docopt import docopt
    from mscr.bovw import BoVW

    infile, outfile = parse_args()
    assert pex(infile), "file %s dosen't exist" % infile

    bbb = BoVW()
    bbb.fit_from_prep(infile)
    bbb.save(outfile)