Low eval accuracy for TextClassifier (Might because of cannot save text_vectorization)
See original GitHub issueI have run the Text Classification example here: https://autokeras.com/tutorial/text_classification/
My validation accuracy gets to the high 90s, but when I run inference on the test set, it is close to 50%. There’s nothing inherently wrong with that if that’s the expected output. However, it looks as though it is just using the last model trained and not the best model based on the printed results from the last model being trained.
Also, when I run clf.evaluate(x_train, y_train)
I get the same results of 50% accuracy. I apologize if I’m missing something obvious here, but this does not look right to me.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to save TextVectorization to disk in tensorflow?
You can try using following code snippet to save vectorized data into pickle format pickle.dump(vectorized_text, open("vector.pickel", "wb")) ...
Read more >Can't save TextVectorization model. I just failed the ... - Reddit
I just failed the exam because I couldn't save it. This isn't from the exam. This is the kaggle dataset on NLP I...
Read more >model.save and load giving different result #4875 - GitHub
I am trying to save a simple LSTM model for text classification. The input of the model is padded vectorized sentences. model =...
Read more >Basic text classification | TensorFlow Core
This notebook trains a sentiment analysis model to classify movie reviews as positive or negative, based on the text of the review. This...
Read more >Text classification from scratch - Keras
Introduction. This example shows how to do text classification starting from raw text (as a set of text files on disk). We demonstrate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dzimmerman-nci Thank you for the work solution! Hope tf would release this “fit to adapt” feature soon.
@haifeng-jin it seems the only way to get it to work is if I retrain the exported Keras model after adapting the TextVectorization layer like this:
If I exclude the
keras_model.fit(x_train, y_train)
line, I get the same results as I do when I do not adapt the TextVectorization layer.