Extracts the *set* of keywords found in a Twitter list (name + description).

    Inputs: - twitter_list: A Twitter list in json format.
            - lemmatizing: A string containing one of the following: "porter", "snowball" or "wordnet".

    Output: - keyword_set: A set of keywords (i.e. not a bag-of-words) in python set format.
            - lemma_to_keywordbag: A python dictionary that maps stems/lemmas to original topic keywords.

def clean_twitter_list(twitter_list,
                       sent_tokenize, _treebank_word_tokenize,
                       tagger, lemmatizer, lemmatize, stopset,
                       first_cap_re, all_cap_re, digits_punctuation_whitespace_re,
                       pos_set):
    """
    Extracts the *set* of keywords found in a Twitter list (name + description).

    Inputs: - twitter_list: A Twitter list in json format.
            - lemmatizing: A string containing one of the following: "porter", "snowball" or "wordnet".

    Output: - keyword_set: A set of keywords (i.e. not a bag-of-words) in python set format.
            - lemma_to_keywordbag: A python dictionary that maps stems/lemmas to original topic keywords.
    """
    name_lemmas, name_lemma_to_keywordbag = clean_document(twitter_list["name"].replace("_", " ").replace("-", " "),
                                                           sent_tokenize, _treebank_word_tokenize,
                                                           tagger, lemmatizer, lemmatize, stopset,
                                                           first_cap_re, all_cap_re, digits_punctuation_whitespace_re,
                                                           pos_set)
    description_lemmas, description_lemma_to_keywordbag = clean_document(twitter_list["description"].replace("_", " ").replace("-", " "),
                                                           sent_tokenize, _treebank_word_tokenize,
                                                           tagger, lemmatizer, lemmatize, stopset,
                                                           first_cap_re, all_cap_re, digits_punctuation_whitespace_re,
                                                           pos_set)

    keyword_set = set(name_lemmas + description_lemmas)

    lemma_to_keywordbag = defaultdict(lambda: defaultdict(int))
    for lemma, keywordbag in name_lemma_to_keywordbag.items():
        for keyword, multiplicity in keywordbag.items():
            lemma_to_keywordbag[lemma][keyword] += multiplicity

    for lemma, keywordbag in description_lemma_to_keywordbag.items():
        for keyword, multiplicity in keywordbag.items():
            lemma_to_keywordbag[lemma][keyword] += multiplicity

    return keyword_set, lemma_to_keywordbag