model/train_classifier.py
def build_model():
    
    """
    Build Model function
    
    This function output is a Scikit ML Pipeline that process text messages
    according to NLP best-practice and apply a classifier.
    """ 
    model = Pipeline([
        ('features', FeatureUnion([
            
            ('text_pipeline', Pipeline([
                ('vect', CountVectorizer(tokenizer=tokenize)),
                ('tfidf', TfidfTransformer())
            ])),

            ('starting_verb', StartingVerbExtractor())
        ])),
    
        ('clf', MultiOutputClassifier(KNeighborsClassifier()))
])
    
    return model

    Build Model function
    
    This function output is a Scikit ML Pipeline that process text messages
    according to NLP best-practice and apply a classifier.
    
Build Model function
This function output is a Scikit ML Pipeline that process text messages
according to NLP best-practice and apply a classifier.
Build Model function This function output is a Scikit ML Pipeline that process text messages according to NLP best - practice and apply a classifier .
def build_model():
    model = Pipeline([
        ('features', FeatureUnion([
            ('text_pipeline', Pipeline([
                ('vect', CountVectorizer(tokenizer=tokenize)),
                ('tfidf', TfidfTransformer())
            ])),
            ('starting_verb', StartingVerbExtractor())
        ])),
        ('clf', MultiOutputClassifier(KNeighborsClassifier()))
])
    return model
def build_model ( ) : model = Pipeline ( [ ( 'features' , FeatureUnion ( [ ( 'text_pipeline' , Pipeline ( [ ( 'vect' , CountVectorizer ( tokenizer = tokenize ) ) , ( 'tfidf' , TfidfTransformer ( ) ) ] ) ) , ( 'starting_verb' , StartingVerbExtractor ( ) ) ] ) ) , ( 'clf' , MultiOutputClassifier ( KNeighborsClassifier ( ) ) ) ] ) return model
Build Model function
This function output is a Scikit ML Pipeline that process text messages
according to NLP best-practice and apply a classifier.
Build Model function This function output is a Scikit ML Pipeline that process text messages according to NLP best - practice and apply a classifier .
"""
    Build Model function
    
    This function output is a Scikit ML Pipeline that process text messages
    according to NLP best-practice and apply a classifier.
    """