Text: FEATURE REQUEST: Remove undesired words from vocabulary

Created on 23 Jul 2018  路  5Comments  路  Source: pytorch/text

When building the vocabulary, it would be great to be able to pass a list of undesired words (e.g. punctuation marks, stop words, etc) and they will not belong to the vocabulary (hence, will be '' when "numericalizing").

enhancement help wanted

All 5 comments

@manuelsh Not sure if this helps you, but you could probably pass your own preprocessing/postprocessing pipeline to the Field constructor that would handle the removal of unwanted tokens.

Yes, I actually did that, thanks!

However, being such a common thing to do in NLP, possibly makes sense to add it in the library?

Possibly, yes!

Added in #397

Amazing, thanks!

Was this page helpful?
0 / 5 - 0 ratings