def saveModel(crf, filename): """ Save a CRF model to a file. The file will be automagically gzipped if the file name ends in gz. """ if (filename.endswith("gz")): FileUtils.writeGzippedObject(File(filename), crf) else: FileUtils.writeObject(File(filename), crf)
def saveModel(crf, filename): """ Save a CRF model to a file. The file will be automagically gzipped if the file name ends in gz. """ if (filename.endswith ("gz")): FileUtils.writeGzippedObject (File (filename), crf) else: FileUtils.writeObject (File (filename), crf)
def loadModel(filename): """ Read a CRF model from a file. The file will be automagically gunzipped if the fille name ends in gz. """ return FileUtils.readObject(File(filename))
def loadModel(filename): """ Read a CRF model from a file. The file will be automagically gunzipped if the fille name ends in gz. """ return FileUtils.readObject (File (filename))