blobcity / ai-seed

1000+ ready code templates to kickstart your next AI experiment
https://cloud.blobcity.com
Apache License 2.0
116 stars 55 forks source link

TextClassification_LSTM #947

Closed ageerHarikrishna closed 3 years ago

Thilakraj1998 commented 3 years ago

Required Changes:

  1. Change file name to TextClassification_LSTM

  2. In this code: avoid print(i)

    from nltk.stem.porter import PorterStemmer ps = PorterStemmer() corpus = [] for i in range(0, len(messages)): print(i) review = re.sub('[^a-zA-Z]', ' ', messages['title'][i]) review = review.lower() review = review.split() review = [ps.stem(word) for word in review if not word in stopwords.words('english')] review = ' '.join(review) corpus.append(review)

  3. from corpus first 10 sentences instead of all

  4. avoid large print statments or limit print.