<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Import Data for Train and Test
Use a variety of topics and sources of text. Remove everything except letters.
Step1:  Label Samples
Apply topic labels to each sample using a conventional technique like SVD. Later, this might be expanded to include selection among assignment alternatives based on information criteria.
<ASSISTANT_TASK:>
Python Code:
import nltk
from nltk import corpus
# nltk.download()
# print(dir(corpus))
# corp = corpus.gutenberg
files = corpus.gutenberg.fileids()
print(files)
# NOTE: This is only needed to open NLTK's downloads manager!
# nltk.download()
# Get our source corpora from gutenberg in nltk.
emma_sents = corpus.gutenberg.sents('austen-emma.txt')
# Assign all of our samples that we'll be using.
corpora = emma_sents[:20]
# Iterate across the sentences.
alpha_sentences = pd.DataFrame()
for sentence in corpora:
    
#     print(sent)
    sent = list(filter(lambda x: str.isalpha(x), sentence))
    sent = ' '.join(sent)
    sent = pd.Series(sent)
    alpha_sentences = alpha_sentences.append(sent, ignore_index=True)
    
print(alpha_sentences.head(10))
print(emma_sents[3],alpha_sentences.iloc[3][0])
# We'll need to vectorize the words, put that into a dataframe, 
# and then generate another dataframe that's a vector of letter values.
Explanation: Import Data for Train and Test
Use a variety of topics and sources of text. Remove everything except letters.
End of explanation
from sklearn.decomposition import LatentDirichletAllocation as LDA
lda = LDA()
lda.fit(emma_sents)
Explanation: Label Samples
Apply topic labels to each sample using a conventional technique like SVD. Later, this might be expanded to include selection among assignment alternatives based on information criteria.
End of explanation
<END_TASK>