Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Commit

Permalink
update experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
rain1024 committed Dec 26, 2018
1 parent 67b8497 commit d89026a
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions egs/vlsp2013_crf/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
features = [
"T[-2].lower", "T[-1].lower", "T[0].lower", "T[1].lower", "T[2].lower",

# "T[-1].isdigit", "T[0].isdigit", "T[1].isdigit",
#
# "T[-1].istitle", "T[0].istitle", "T[1].istitle",
# "T[0,1].istitle", "T[0,2].istitle",

# "T[-2].is_in_dict", "T[-1].is_in_dict", "T[0].is_in_dict", "T[1].is_in_dict", "T[2].is_in_dict",
# "T[-2,-1].is_in_dict", "T[-1,0].is_in_dict", "T[0,1].is_in_dict", "T[1,2].is_in_dict",
# "T[-2,0].is_in_dict", "T[-1,1].is_in_dict", "T[0,2].is_in_dict",
"T[-1].isdigit", "T[0].isdigit", "T[1].isdigit",

"T[-1].istitle", "T[0].istitle", "T[1].istitle",
"T[0,1].istitle", "T[0,2].istitle",

"T[-2].is_in_dict", "T[-1].is_in_dict", "T[0].is_in_dict", "T[1].is_in_dict", "T[2].is_in_dict",
"T[-2,-1].is_in_dict", "T[-1,0].is_in_dict", "T[0,1].is_in_dict", "T[1,2].is_in_dict",
"T[-2,0].is_in_dict", "T[-1,1].is_in_dict", "T[0,2].is_in_dict",

"T[-2,-1].lower", "T[-1,0].lower", "T[0,1].lower", "T[1,2].lower",
# word unigram and bigram and trigram
"T[-2]", "T[-1]", "T[0]", "T[1]", "T[2]",
Expand All @@ -26,11 +27,11 @@
trainer = Trainer(tagger, corpus)

params = {
'c1': 1.0, # coefficient for L1 penalty
'c2': 1e-3, # coefficient for L2 penalty
'max_iterations': 1000, #
# include transitions that are possible, but not observed
'feature.possible_transitions': True,
'feature.possible_states': True,
'c1': 1.0, # coefficient for L1 penalty
'c2': 1e-3, # coefficient for L2 penalty
'max_iterations': 1000, #
# include transitions that are possible, but not observed
'feature.possible_transitions': True,
'feature.possible_states': True,
}
trainer.train(params)

0 comments on commit d89026a

Please sign in to comment.