Re: pickle module doens't work

2013-01-02 Thread Omer Korat
Yeah, right. I didn't think about that. I'll check in the source how the data is stored. Thanks for helping sort it all out. -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle module doens't work

2013-01-01 Thread Tim Roberts
Omer Korat wrote: > >I am using the nltk.classify.MaxEntClassifier. This object has a set of >labels, and a set of probabilities: P(label | features). It modifies >this probability given data. SO for example, if you tell this object >that the label L appears 60% of the time with the feature F,

Re: pickle module doens't work

2013-01-01 Thread Omer Korat
I am using the nltk.classify.MaxEntClassifier. This object has a set of labels, and a set of probabilities: P(label | features). It modifies this probability given data. SO for example, if you tell this object that the label L appears 60% of the time with the feature F, then P(L | F) = 0.6. The

Re: pickle module doens't work

2012-12-28 Thread Tim Roberts
Omer Korat wrote: > >So it means pickle doesn't ever save the object's values, only how it was >created? You say that as though there were a difference between the two. There isn't. An object is just a dictionary of values. If you set an object member to a string, then that object's dictiona

Re: pickle module doens't work

2012-12-27 Thread Terry Reedy
On 12/27/2012 7:34 AM, Dave Angel wrote: Perhaps you'd rather see it in the Python docs. http://docs.python.org/2/library/pickle.html http://docs.python.org/3.3/library/pickle.html pickle can save and restore class instances transpare

Re: pickle module doens't work

2012-12-27 Thread Chris Angelico
On Fri, Dec 28, 2012 at 12:16 AM, Omer Korat wrote: > I see. In that case, all I have to do is make sure NLTK is available when I > load the pickled objects. That pretty much solves my problem. Thanks! > So it means pickle doesn't ever save the object's values, only how it was > created? > > Say

Re: pickle module doens't work

2012-12-27 Thread Omer Korat
I see. In that case, all I have to do is make sure NLTK is available when I load the pickled objects. That pretty much solves my problem. Thanks! So it means pickle doesn't ever save the object's values, only how it was created? Say I have a large object that requires a lot of time to train on

Re: pickle module doens't work

2012-12-27 Thread Dave Angel
On 12/27/2012 07:05 AM, Omer Korat wrote: > You're probably right in general, for me the 3.3 and 2.7 pickles definitely > don't work the same: > > 3.3: type(pickle.dumps(1)) > > > 2.7: type(pickle.dumps(1, pickle.HIGHEST_PROTOCOL)) > That is the same. In 2.7, str is made up of bytes,

Re: pickle module doens't work

2012-12-27 Thread Omer Korat
You're probably right in general, for me the 3.3 and 2.7 pickles definitely don't work the same: 3.3: >>> type(pickle.dumps(1)) 2.7: >>> type(pickle.dumps(1, pickle.HIGHEST_PROTOCOL)) As you can see, in 2.7 when I try to dump something, I get useless string. Look what I gen when I dump an N

Re: pickle module doens't work

2012-12-27 Thread Peter Otten
Omer Korat wrote: > I'm working on a project in Python 2.7. I have a few large objects, and I > want to save them for later use, so that it will be possible to load them > whole from a file, instead of creating them every time anew. It is > critical that they be transportable between platforms. P