def basic_extractor(document, train_set):
word_features = _get_words_from_dataset(train_set)<EOL>tokens = _get_document_tokens(document)<EOL>features = dict(((u'<STR_LIT>'.format(word), (word in tokens))<EOL>for word in word_features))<EOL>return features<EOL>
A basic document feature extractor that returns a dict indicating what
    words in ``train_set`` are contained in ``document``.

    :param document: The text to extract features from. Can be a string or an iterable.
    :param list train_set: Training data set, a list of tuples of the form
        ``(words, label)``.