title: how to remove gibberish that exhibits no pattern using python nltk?
body: <p>I am writing a code to clean the urls and extract just the underlying text.</p>
  
  <pre><code> train_str = train_df.to_string()
   letters_only = re.sub("[^a-zA-Z]", " ", train_str)
   words = letters_only.lower().split()
   stops = set(stopwords.words("english"))
   stops.update(['url','https','http','com'])
   meaningful_words = [w for w in words if not w in stops]
   long_words = [w for w in meaningful_words if len(w) &gt; 3]
  </code></pre>
  
  <p>Using the above code i am able to extract just the words after removing the punctuations, stopwords, etc. But i am unable to remove the words that are gibberish in nature. These are some of the many words that i get after cleaning the urls.</p>
  
  <pre><code>['uact', 'ahukewim', 'asvpoahuhxbqkhdtibveqfggtmam', 'fchrisalbon','afqjcnhil', 'ukai', 'khnaantjejdfrhpeza']
  </code></pre>
  
  <p>There is no particular pattern in their occurrence or in the letters to use regex or other functions. Could anyone suggest any ways in which these words could be removed?
  Thanks!</p>