Python
Tuesday, January 3, 2012
Wednesday, December 28, 2011
Parse adaboost log file, get features
fh = open(r"c:\tmp\16_A7_Translation.log","r")
outf = open(r"c:\tmp\16_A7_Translation.features.txt", 'w')
igot = fh.readlines()
for line in igot:
if line.find("best=") > -1:
temp = line.split()
ha = temp[1]
about = ha.strip('best=')
print about ## print to screen
print >> outf, about ## print to file
print
outf.close()
#-----------------------
fh = open(r"c:\tmp\8_A7_Translation.log","r")
outf2 = open(r"c:\tmp\8_A7_Translation.features.txt", 'w')
igot = fh.readlines()
for line in igot:
if line.find("best=") > -1:
temp = line.split()
ha = temp[1]
about = ha.strip('best=')
print about ## print to screen
print >> outf2, about ## print to file
print
outf2.close()
outf = open(r"c:\tmp\16_A7_Translation.features.txt", 'w')
igot = fh.readlines()
for line in igot:
if line.find("best=") > -1:
temp = line.split()
ha = temp[1]
about = ha.strip('best=')
print about ## print to screen
print >> outf, about ## print to file
outf.close()
#-----------------------
fh = open(r"c:\tmp\8_A7_Translation.log","r")
outf2 = open(r"c:\tmp\8_A7_Translation.features.txt", 'w')
igot = fh.readlines()
for line in igot:
if line.find("best=") > -1:
temp = line.split()
ha = temp[1]
about = ha.strip('best=')
print about ## print to screen
print >> outf2, about ## print to file
outf2.close()
Wednesday, October 19, 2011
Monday, December 27, 2010
Subscribe to:
Posts (Atom)