X-Git-Url: https://code.communitydata.science/cdsc_reddit.git/blobdiff_plain/628a70734b19c25da5df2e0c9ed4f1616c2b5c10..806cfc948f2721bf2ea754bcf0c3b8b0e3d0adf8:/similarities/similarities_helper.py?ds=inline diff --git a/similarities/similarities_helper.py b/similarities/similarities_helper.py index 57a36ca..3ace8f2 100644 --- a/similarities/similarities_helper.py +++ b/similarities/similarities_helper.py @@ -60,7 +60,7 @@ def reindex_tfidf(infile, term_colname, min_df=None, max_df=None, included_subre if included_subreddits is None: included_subreddits = select_topN_subreddits(topN) else: - included_subreddits = set(open(included_subreddits)) + included_subreddits = set(map(str.strip,map(str.lower,open(included_subreddits)))) if exclude_phrases == True: tfidf = tfidf.filter(~f.col(term_colname).contains("_"))