Example #1
0
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)
Example #2
0
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)
Example #3
0
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))
Example #4
0
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))