Skip to content

Commit

Permalink
Adds allCap and dashExists emission features
Browse files Browse the repository at this point in the history
  • Loading branch information
svs192219 committed Sep 27, 2017
1 parent 53156a6 commit ede32b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ def extract_emission_features(sentence, word_index, tag, feature_indexer, add_to
maybe_add_feature(feats, feature_indexer, add_to_indexer, tag + ":EndNgram=" + end_ngram)
# Look at a few word shape features
maybe_add_feature(feats, feature_indexer, add_to_indexer, tag + ":IsCap=" + repr(curr_word[0].isupper()))
maybe_add_feature(feats, feature_indexer, add_to_indexer, tag + ":IsAllCap=" + repr(curr_word.isupper()))
maybe_add_feature(feats, feature_indexer, add_to_indexer, tag + ":dashExists=" + repr("-" in curr_word))
# Compute word shape
new_word = []
for i in xrange(0, len(curr_word)):
Expand Down

0 comments on commit ede32b2

Please sign in to comment.