stuff-classifier icon indicating copy to clipboard operation
stuff-classifier copied to clipboard

Storage improvement

Open Oliviergg opened this issue 12 years ago • 4 comments

  • 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

Oliviergg avatar Apr 24 '12 18:04 Oliviergg

Cool :-)

alexandru avatar Apr 25 '12 07:04 alexandru

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 avatar Jul 01 '13 19:07 MadBomber

@MadBomber thanks for the report, I'll test.

alexandru avatar Jul 01 '13 19:07 alexandru

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

himanshu-saxena avatar Aug 28 '13 07:08 himanshu-saxena