title: 'LabelEncoder' is not defined in nltk
body: <p>I'm using <code>nltk</code> with a scikit-learn classifier and the interface is throwing an error I cannot explain.</p>
  <p>Here is a minimum working example:</p>
  <pre><code>import nltk
  import sklearn
  
  from sklearn.naive_bayes import MultinomialNB
  
  nltk.classify.scikitlearn.SklearnClassifier(MultinomialNB())
  </code></pre>
  <p>This throws the error</p>
  <pre><code>name 'LabelEncoder' is not defined
  </code></pre>
  <p>Importing LabelEncoder (<a href="https://stackoverflow.com/questions/49318155/nameerror-name-labelencoder-is-not-defined">as suggested here</a>) does not work – and it would be strange if it did. Looking at the <a href="http://www.nltk.org/_modules/nltk/classify/scikitlearn.html" rel="nofollow noreferrer">source code</a> of <code>nltk.classify.scikitlearn</code>, <code>LabelEncoder</code> should be loaded internally.</p>
  <p>It seems this is problem of my local installation rather than the nltk or sklearn package. I'm out of ideas, though. Does anyone have an idea what might be going wrong here?</p>
  <p>Versions:</p>
  <pre><code>nltk.__version__ '3.5'; 
  sklearn.__version__ '0.24.0'; 
  sys.version
  '3.9.1 (default, Jan  8 2021, 17:17:43) [Clang 12.0.0 (clang-1200.0.32.28)]
  </code></pre>