title: TorchText Vocab TypeError: Vocab.__init__() got an unexpected keyword argument 'min_freq'
body: <p>I am working on a CNN Sentiment analysis machine learning model which uses the IMDb dataset provided by the Torchtext library.
  On one of my lines of code</p>
  <p><code>vocab = Vocab(counter, min_freq = 1, specials=('\&lt;unk\&gt;', '\&lt;BOS\&gt;', '\&lt;EOS\&gt;', '\&lt;PAD\&gt;'))</code></p>
  <p>I am getting a TypeError for the min_freq argument even though I am certain that it is one of the accepted arguments for the function. I am also getting UserWarning Lambda function is not supported for pickle, please use regular python function or functools partial instead. Full code</p>
  <pre><code>from torchtext.datasets import IMDB
  from collections import Counter
  from torchtext.data.utils import get_tokenizer
  from torchtext.vocab import Vocab
  tokenizer = get_tokenizer('basic_english')  
  train_iter = IMDB(split='train')
  test_iter = IMDB(split='test')
  counter = Counter()
  for (label, line) in train_iter:
      counter.update(tokenizer(line))
  vocab = Vocab(counter, min_freq = 1, specials=('\&lt;unk\&gt;', '\&lt;BOS\&gt;', '\&lt;EOS\&gt;', '\&lt;PAD\&gt;'))
  </code></pre>
  <p>Source Links
  <a href="https://towardsdatascience.com/cnn-sentiment-analysis-9b1771e7cdd6" rel="nofollow noreferrer">towardsdatascience</a>
  <a href="https://github.com/pytorch/text/blob/master/examples/legacy_tutorial/migration_tutorial.ipynb" rel="nofollow noreferrer">github Legacy to new</a></p>
  <p>I have tried removing the min_freq argument and use the functions default as follows</p>
  <p><code>vocab = Vocab(counter, specials=('\&lt;unk\&gt;', '\&lt;BOS\&gt;', '\&lt;EOS\&gt;', '\&lt;PAD\&gt;'))</code></p>
  <p>however I end up getting the same type error but for the specials argument rather than min_freq.</p>
  <p>Any help will be much appreciated</p>
  <p>Thank you.</p>