<div dir="ltr">Hi,<div>I am trying to save a Naive Bayes classifier with cPickle (as it says in NLTK: <span style="font-family:'Times New Roman'">Storing Taggers </span><a href="http://nltk.org/book/ch05.html" target="_blank" style="font-size:12.800000190734863px;font-family:arial,sans-serif">http://nltk.org/book/ch05.html</a>), but I got an error. These are the function code I used to save/load it: </div>
<div><br></div><div>import cPickle as cp <br></div><div><br></div><div><div>def salva_fichC(fich1,data):</div><div>    fich=fich1+'.dmp'</div><div>    f = open(fich, 'wb')</div><div>    cp.dump(data, f,-1)</div>
<div>    f.close()</div><div><br></div><div>def carga_fichC(fich1):</div><div>    fich=fich1+'.dmp'</div><div>    f = open(fich, 'rb')</div><div>    data = cp.load(f)</div><div>    f.close()</div><div>    return data</div>
</div><div><br></div><div>I have tried also with pickle, with and without -1 in dump</div><div>Can you help me? Thanks</div><div><div dir="ltr"><br></div>
</div></div>