I wrote a code for reading article and self-learning AI. First, I read the article with URL and download it.Then I parse the article and use it for my AI's learning text.But now I want to read text from txt file.How can I assign txt file's text to Article object ? (Please check code to clear my wish ) Thanks all.
article = Article('URL for article')
article.download()
article.parse()
article.nlp()
corpus = article.text
text= corpus
sentence_list = nltk.sent_tokenize(text)
PS:I want to use txt file instead of URL. But I do not remove article from code because it will be necessary again.