Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in thread "main" java.lang.ClassCastException: cc.mallet.types.FeatureSequence cannot be cast #209

Open
findgit123 opened this issue Sep 14, 2023 · 0 comments

Comments

@findgit123
Copy link

findgit123 commented Sep 14, 2023

how to solve this below: i am using latest Mallet-202108 downloaded here
C:\Users\4>mallet import-dir --input D:\test_mallet\input\ --output D:\test_mallet\data.mallet --keep-sequence --remove-stopwords
Labels =
D:\test_mallet\input
C:\Users\4>mallet train-classifier --input D:\test_mallet\data.mallet --output-classifier D:\test_mallet\my.classifier
Training portion = 1.0
Unlabeled training sub-portion = 0.0
Validation portion = 0.0
Testing portion = 0.0

-------------------- Trial 0 --------------------

Trial 0 Training NaiveBayesTrainer with 639 instances
Exception in thread "main" java.lang.ClassCastException: cc.mallet.types.FeatureSequence cannot be cast to cc.mallet.types.FeatureVector
at cc.mallet.classify.NaiveBayesTrainer.incorporateOneInstance(NaiveBayesTrainer.java:274)
at cc.mallet.classify.NaiveBayesTrainer.trainIncremental(NaiveBayesTrainer.java:202)
at cc.mallet.classify.NaiveBayesTrainer.train(NaiveBayesTrainer.java:191)
at cc.mallet.classify.NaiveBayesTrainer.train(NaiveBayesTrainer.java:57)
at cc.mallet.classify.tui.Vectors2Classify.main(Vectors2Classify.java:446)
C:\Users\4>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant