title: Mallet: Topical N-grams
body: <p>I want to run mallet using the <code>--use-ngrams true</code> option but can't seem to get it working.  I've imported my data using:</p>
  
  <pre><code>./bin/mallet import-dir --input path --output topic-input.mallet --keep-seqence -- removed stopwords
  </code></pre>
  
  <p>Now I want to train a topical ngram model:</p>
  
  <pre><code>bin/mallet train-topics --input topic-input.mallet --use-ngrams true --num-topics 30 --xml-topic-report topic-report.xml
  </code></pre>
  
  <p>But I'm getting this error:</p>
  
  <pre><code>Exception in thread "main" java.lang.ClassCastException: cc.mallet.types.FeatureSequence cannot be cast to cc.mallet.types.FeatureSequenceWithBigrams
  at cc.mallet.topics.TopicalNGrams.estimate(TopicalNGrams.java:78)
  at cc.mallet.topics.tui.Vectors2Topics.main(Vectors2Topics.java:249)
  </code></pre>
  
  <p>As you can see I'm running mallet as a command line tool and would rather not pry into its API to get it working.  Any suggestions?</p>