Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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))
Ejemplo n.º 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))