stuff-classifier
stuff-classifier copied to clipboard
Storage improvement
- Factorize common code in inMemoryStorage and FileStorage => A new class Storage
- Use a JSON to format data to save
- Others params need to be saved : Language, ignore_word, ...
- New test need to be done in 005_inMemoryStorage
Cool :-)
Observation: just did some testing under ruby 2.0.0p247 using the :cat and :dog example where the class names/labels are defined as symbols. When the training set is sent to file storage and then later retrieved in a new process the class names/labels are now returned from #classify as strings instead of the expected symbols.
@MadBomber thanks for the report, I'll test.
Hi @alexandru ,
I trying to save the training set into a text file by below line:
store = StuffClassifier::FileStorage.new('doc/classifier_storage.txt')
and then cls = StuffClassifier::TfIdf.new("#{row[0]}",:storage => store)
getting error "end of buffer reached"
Any suggestions ?
Thanks Himanshu