'Train the crf tagger based on the training data.'

def _train_model(self, df_train):

    import sklearn_crfsuite
    X_train = [self._sentence_to_features(sent) for sent in df_train]
    y_train = [self._sentence_to_labels(sent) for sent in df_train]
    self.ent_tagger = sklearn_crfsuite.CRF(algorithm=u'lbfgs', c1=1.0, c2=0.001, max_iterations=50, all_possible_transitions=True)
    self.ent_tagger.fit(X_train, y_train)
