equal
deleted
inserted
replaced
25 ''' |
25 ''' |
26 self.logger = logging.getLogger('SNoW') |
26 self.logger = logging.getLogger('SNoW') |
27 self.SNoWTrainFile = '../tmp/snow.train' |
27 self.SNoWTrainFile = '../tmp/snow.train' |
28 self.SNoWTestFile = '../snow.test' |
28 self.SNoWTestFile = '../snow.test' |
29 self.SNoWNetFile = '../tmp/snow.net' |
29 self.SNoWNetFile = '../tmp/snow.net' |
30 self.defMaxNameId = 20000 |
30 self.defMaxNameId = 100000 |
31 |
31 |
32 def initializeModel(self,trainData,dicts): |
32 def initializeModel(self,trainData,dicts): |
33 """ |
33 """ |
34 Build basic model from training data. |
34 Build basic model from training data. |
35 """ |
35 """ |
49 OS.close() |
49 OS.close() |
50 |
50 |
51 # Build Model |
51 # Build Model |
52 self.logger.debug('Building Model START.') |
52 self.logger.debug('Building Model START.') |
53 snowTrainCommand = '../bin/snow -train -M+ -I %s -F %s -g- -B :0-%s' % (self.SNoWTrainFile,self.SNoWNetFile,dicts.maxNameId-1) |
53 snowTrainCommand = '../bin/snow -train -M+ -I %s -F %s -g- -B :0-%s' % (self.SNoWTrainFile,self.SNoWNetFile,dicts.maxNameId-1) |
|
54 #print snowTrainCommand |
54 #snowTrainCommand = '../bin/snow -train -M+ -I %s -F %s -g- -B :0-%s' % (self.SNoWTrainFile,self.SNoWNetFile,self.defMaxNameId-1) |
55 #snowTrainCommand = '../bin/snow -train -M+ -I %s -F %s -g- -B :0-%s' % (self.SNoWTrainFile,self.SNoWNetFile,self.defMaxNameId-1) |
55 args = shlex.split(snowTrainCommand) |
56 args = shlex.split(snowTrainCommand) |
56 p = subprocess.Popen(args,stdout=subprocess.PIPE,stderr=subprocess.STDOUT) |
57 p = subprocess.Popen(args,stdout=subprocess.PIPE,stderr=subprocess.STDOUT) |
57 p.wait() |
58 p.wait() |
58 self.logger.debug('Building Model END.') |
59 self.logger.debug('Building Model END.') |