saul
saul copied to clipboard
Reading a trained model!
It seems we need a different constructor for the classifier inside Learnable. When loading model the lex and lc should not be removed but used.
Ah! I see the same problem here :https://github.com/IllinoisCogComp/saul/blob/master/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EmailSpam/spamClassifiers.scala#L28 this usecache flag should not be here inside the definition of the classifier, it should be passed to the constructor. How we can do it? Do @sameersingh or anyone else have any idea? I need to do the same thing for loading a pre trained classifier.
You can create a function that takes the parameter and returns this object with the appropriate usecache flag set.
Thank you, for now, the save() and load() seems to be fine. But the implementation is still an issue because the model has not been saved properly in general. https://github.com/IllinoisCogComp/saul/blob/master/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala#L108 . I keep this issue open.
@kordjamshidi is it still a valid issue?
I think load and save can be refined still, yes. When we need to specify the path, if a path is not there what happens, etc. It is both syntax variation and documentation issue.