Exemplo n.º 1
0
 def test_datatrainer(self):
     datatrainer = DataTrainer()
     datatrainer.create()
     self.assertEqual( datatrainer.check(), None )
     dire = datatrainer.workdir
     self.assertTrue( os.path.exists( dire ) )
     datatrainer.delete()
     self.assertFalse( os.path.exists( dire ) )
Exemplo n.º 2
0
else:
    setup_logging(None,None)


# ---------------------------------
# 1. Create a Data Manager
# it manages the data created at each step of the acm training procedure
# create parameters:
#  - workdir=None (in)
#  - scriptsdir=DEFAULT_SCRIPTS_DIR (in)
#  - featsdir=DEFAULT_FEATURES_DIR (in)
#  - logdir=DEFAULT_LOG_DIR (in)
#  - protodir=None (in)
#  - protofilename=DEFAULT_PROTO_FILENAME (out)

datatrainer = DataTrainer()
datatrainer.create( workdir=args.t, protodir=args.p )


# ---------------------------------
# 2. Create a Corpus Manager
# it manages the set of training data:
#   - establishes the list of phonemes (from the dict);
#   - converts the input annotated data into the HTK-specific data format;
#   - codes the audio data.

corpus = TrainingCorpus( datatrainer, lang=args.l )
corpus.fix_resources( dictfile=args.r, mappingfile=args.m )

if args.i:
    for entry in args.i: