Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0dc85a36 authored by Pascal Denis's avatar Pascal Denis
Browse files

bug fix

git-svn-id: https://scm.gforge.inria.fr/authscm/cfourrie/svn/lingwb/metagger/trunk@2699 dc05b511-7f1d-0410-9f1c-d6f32a2df9e4
parent 77821bc0
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ class MegamClassifier:
-maxit: max # of iterations (megam default:100)
"""
print ">>> Training Megam classifier..."
print >> sys.stderr, ">>> Training Megam classifier..."
self.paramfile = paramfile
# build process command
......
......@@ -8,16 +8,14 @@ def tag_dict(file_path):
for s in BrownReader(file_path):
for wd,tag in s:
tag_dict[wd] = tag_dict.get(wd,[]) + [tag]
infile.close()
return tag_dict
def word_list(file_path):
def word_list(file_path,t=5):
word_ct = {}
for s in BrownReader(file_path):
for wd,tag in s:
word_ct[wd] = word_ct.get(wd,0) + 1
infile.close()
filtered_wd_list = {}
for w in word_ct:
ct = word_ct[w]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment