Showing
1 changed file
with
8 additions
and
6 deletions
| ... | @@ -212,10 +212,11 @@ if __name__ == "__main__": | ... | @@ -212,10 +212,11 @@ if __name__ == "__main__": |
| 212 | # Fixed parameters | 212 | # Fixed parameters |
| 213 | crf = sklearn_crfsuite.CRF( | 213 | crf = sklearn_crfsuite.CRF( |
| 214 | algorithm='lbfgs', | 214 | algorithm='lbfgs', |
| 215 | - c1=0.1, | 215 | + #c1=0.1, |
| 216 | - c2=0.1, | 216 | + #c2=0.1, |
| 217 | - max_iterations=100, | 217 | + max_iterations=100 |
| 218 | - all_possible_transitions=True | 218 | + #, |
| 219 | + #all_possible_transitions=True | ||
| 219 | ) | 220 | ) |
| 220 | 221 | ||
| 221 | # Original: labels = list(crf.classes_) | 222 | # Original: labels = list(crf.classes_) |
| ... | @@ -237,9 +238,10 @@ if __name__ == "__main__": | ... | @@ -237,9 +238,10 @@ if __name__ == "__main__": |
| 237 | oFile.write("********** TRAINING AND TESTING REPORT **********\n") | 238 | oFile.write("********** TRAINING AND TESTING REPORT **********\n") |
| 238 | oFile.write("Training file: " + options.trainingFile + '\n') | 239 | oFile.write("Training file: " + options.trainingFile + '\n') |
| 239 | oFile.write('\n') | 240 | oFile.write('\n') |
| 241 | + oFile.write("Model: {}".format(crf)) | ||
| 240 | #oFile.write('best params:' + str(crf.best_params_) + '\n') | 242 | #oFile.write('best params:' + str(crf.best_params_) + '\n') |
| 241 | - oFile.write('best CV score:' + str(crf.best_score_) + '\n') | 243 | + #oFile.write('best CV score:' + str(crf.best_score_) + '\n') |
| 242 | - oFile.write('model size: {:0.2f}M\n'.format(crf.best_estimator_.size_ / 1000000)) | 244 | + #oFile.write('model size: {:0.2f}M\n'.format(crf.best_estimator_.size_ / 1000000)) |
| 243 | 245 | ||
| 244 | print("Training done in: %fs" % (time() - t0)) | 246 | print("Training done in: %fs" % (time() - t0)) |
| 245 | t0 = time() | 247 | t0 = time() | ... | ... |
-
Please register or login to post a comment