def make_content_recs(article_id, df_content, df, m=10):
    '\n    INPUT:\n    article_id = (int) a article id in df_content\n    m - (int) the number of recommendations you want for the user\n    df_content -  (pandas dataframe) df_content as defined at the top of the notebook \n    df - (pandas dataframe) df as defined at the top of the notebook \n\n    OUTPUT:\n    recs - (list) a list of recommendations for the user by article id\n    rec_names - (list) a list of recommendations for the user by article title\n    '

    def tokenize(text):
        '\n        Function splits text into separate words and gets a word lowercased and removes whitespaces at the ends of a word. \n        The funtions also cleans irrelevant stopwords.\n        Input:\n        1. text: text message\n        Output:\n        1. Clean_tokens : list of tokenized clean words\n        '
        text = re.sub('[^a-zA-Z0-9]', ' ', text)
        tokens = word_tokenize(text)
        lemmatizer = WordNetLemmatizer()
        clean_tokens = []
        for tok in tokens:
            clean_tok = lemmatizer.lemmatize(tok, pos='v').lower().strip()
            clean_tokens.append(clean_tok)
        stopwords = nltk.corpus.stopwords.words('english')
        clean_tokens = [token for token in clean_tokens if (token not in stopwords)]
        return clean_tokens
    (vect, X) = make_Tfidf_array(df_content)
    if (article_id in df_content.article_id):
        cosine_similarity = linear_kernel(X, X)
        df_similarity = pd.DataFrame(cosine_similarity[article_id], columns=['similarity'])
        df_similarity_modified = df_similarity.drop(article_id)
        recs = df_similarity_modified.similarity.sort_values(ascending=False).index[0:10].tolist()
        rec_names = []
        for i in recs:
            name = df_content[(df_content['article_id'] == i)]['doc_full_name'].values[0]
            rec_names.append(name)
    else:
        tfidf_feature_name = vect.get_feature_names()
        booktitle = df[(df['article_id'] == article_id)]['title'].values[0]
        booktitle_tokenized = tokenize(booktitle)
        X_slice_list = []
        for i in booktitle_tokenized:
            if (i in tfidf_feature_name):
                X_slice_list.append(tfidf_feature_name.index(i))
        X_slice_list.sort()
        X_sliced = X[:, X_slice_list]
        check_df = pd.DataFrame(X_sliced, columns=X_slice_list)
        check_df['sum'] = check_df.sum(axis=1)
        recs = check_df.sort_values('sum', ascending=False)[0:10].index.tolist()
        rec_names = []
        for i in recs:
            name = df_content[(df_content['article_id'] == i)]['doc_full_name'].values[0]
            rec_names.append(name)
    return (recs, rec_names)
INPUT:
article_id = (int) a article id in df_content
m - (int) the number of recommendations you want for the user
df_content -  (pandas dataframe) df_content as defined at the top of the notebook 
df - (pandas dataframe) df as defined at the top of the notebook 

OUTPUT:
recs - (list) a list of recommendations for the user by article id
rec_names - (list) a list of recommendations for the user by article title
def make_content_recs(article_id, df_content, df, m=10):
    '\n    INPUT:\n    article_id = (int) a article id in df_content\n    m - (int) the number of recommendations you want for the user\n    df_content -  (pandas dataframe) df_content as defined at the top of the notebook \n    df - (pandas dataframe) df as defined at the top of the notebook \n\n    OUTPUT:\n    recs - (list) a list of recommendations for the user by article id\n    rec_names - (list) a list of recommendations for the user by article title\n    '

    def tokenize(text):
        '\n        Function splits text into separate words and gets a word lowercased and removes whitespaces at the ends of a word. \n        The funtions also cleans irrelevant stopwords.\n        Input:\n        1. text: text message\n        Output:\n        1. Clean_tokens : list of tokenized clean words\n        '
        text = re.sub('[^a-zA-Z0-9]', ' ', text)
        tokens = word_tokenize(text)
        lemmatizer = WordNetLemmatizer()
        clean_tokens = []
        for tok in tokens:
            clean_tok = lemmatizer.lemmatize(tok, pos='v').lower().strip()
            clean_tokens.append(clean_tok)
        stopwords = nltk.corpus.stopwords.words('english')
        clean_tokens = [token for token in clean_tokens if (token not in stopwords)]
        return clean_tokens
    (vect, X) = make_Tfidf_array(df_content)
    if (article_id in df_content.article_id):
        cosine_similarity = linear_kernel(X, X)
        df_similarity = pd.DataFrame(cosine_similarity[article_id], columns=['similarity'])
        df_similarity_modified = df_similarity.drop(article_id)
        recs = df_similarity_modified.similarity.sort_values(ascending=False).index[0:10].tolist()
        rec_names = []
        for i in recs:
            name = df_content[(df_content['article_id'] == i)]['doc_full_name'].values[0]
            rec_names.append(name)
    else:
        tfidf_feature_name = vect.get_feature_names()
        booktitle = df[(df['article_id'] == article_id)]['title'].values[0]
        booktitle_tokenized = tokenize(booktitle)
        X_slice_list = []
        for i in booktitle_tokenized:
            if (i in tfidf_feature_name):
                X_slice_list.append(tfidf_feature_name.index(i))
        X_slice_list.sort()
        X_sliced = X[:, X_slice_list]
        check_df = pd.DataFrame(X_sliced, columns=X_slice_list)
        check_df['sum'] = check_df.sum(axis=1)
        recs = check_df.sort_values('sum', ascending=False)[0:10].index.tolist()
        rec_names = []
        for i in recs:
            name = df_content[(df_content['article_id'] == i)]['doc_full_name'].values[0]
            rec_names.append(name)
    return (recs, rec_names)