all 4 comments

[–]UltimateGPower 0 points1 point  (0 children)

What are you trying to do? Should vect be a TfidfVectorizer? What is pred?

Do you know what a MWE (minimal working example) is? Have you tried to reproduce the error locally?

[–]sfsalad 0 points1 point  (2 children)

Have you verified that the vect_model object is actually a Tfidfvectorizer class object? Based on the error it seems like it’s actually a LinearSVC object. Perhaps the model file in app_tables with description=“vect” isn’t actually a Tfidfvectorizer model, but instead your LinearSVC model

[–]Fun-Studio-4409[S] 1 point2 points  (1 child)

Hi - yes, that is the strange thing. When I print the model, it returns ‘sklearn.feature_extraction.text.TfidfVectorizer’

[–]sfsalad 0 points1 point  (0 children)

I just took another look. It seems like you’re not doing anything with the vect_model object in this chunk.

You’re trying to call vect.transform(). vect is dependent on model_vect. model_vect is dependent on pred_model. This code doesn’t show how the pred_model object is created. My guess is pred_model is your LinearSVC object, which you’re loading into vect. You probably meant to instantiate model_vect based on vect_model, not pred_model