How to learn irrelevant words in an information retrieval system?
If you are working with TF-IDF then it's important to experiment with min_df and max_df parameter. I guess you are on Python since you linked a Python tutorial. Here is the TF-IDF documentation and the related text to the above parameters. 


  max_df : float in range [0.0, 1.0] or int, default=1.0 When building the vocabulary ignore terms that have a document frequency
  strictly higher than the given threshold (corpus-specific stop words).
  If float, the parameter represents a proportion of documents, integer
  absolute counts. This parameter is ignored if vocabulary is not None.
  
  min_df : float in range [0.0, 1.0] or int, default=1 When building the vocabulary ignore terms that have a document frequency strictly
  lower than the given threshold. This value is also called cut-off in
  the literature. If float, the parameter represents a proportion of
  documents, integer absolute counts. This parameter is ignored if
  vocabulary is not None.


You might find several rules of thumb on the web. Some of them suggest using a flat number on the min_df close to 5-7 documents and a percentage on the max_df about 80-85%. Maybe even lower. With this, you will be able to get rid of garbage, misspelt or unwanted tokens. Keep in mind that you need to try different combinations to get the right balance in your model.