Skip to content

Instantly share code, notes, and snippets.

@funktor funktor/ Secret
Created Oct 13, 2018

What would you like to do?
def train_crf_model(train_sentences, train_labels, model_file='age_range.crfsuite'):
train_features = [sent2features(sent) for sent in train_sentences]
model = pycrfsuite.Trainer(verbose=True)
for xseq, yseq in zip(train_features, train_labels):
model.append(xseq, yseq)
'c1': 1.0,
'c2': 0.01,
'max_iterations': 200,
'feature.possible_transitions': True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.