(content, model)
return y_pred[0]
Classify content
Classify content
Classify content
def classify_content(content, model):
    """
    Classify content
    """
    if not has_sklearn:
        return 0

    try:
        nb = load_model(model)
        y_pred = nb.predict([content])
    except Exception as exc:
        logger.error(exc)
        y_pred = [0]

    return y_pred[0]
def classify_content ( content , model ) : if not has_sklearn : return 0 try : nb = load_model ( model ) y_pred = nb . predict ( [ content ] ) except Exception as exc : logger . error ( exc ) y_pred = [ 0 ] return y_pred [ 0 ]