arjunmenon / smalltext

Classify short texts with neural network.
MIT License
16 stars 1 forks source link

Optional model load on initialize #2

Closed modsognir closed 3 years ago

modsognir commented 5 years ago

Thanks for the gem! I'm using in a production app and it's been working fantastic.

I made this change to make it easier to load the classifier with a trained model and memoize in one step, eg:

@classifier ||= Smalltext::Classifier.new("classifications.model")

It's a little cleaner to me than the version I put in a blog post about Smalltext

Thought i'd share the change in case you wanted it.

Thanks again!