コード例 #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)
コード例 #2
0
ファイル: crfs.py プロジェクト: paulgay/crf_dia_ident
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)
コード例 #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))
コード例 #4
0
ファイル: crfs.py プロジェクト: paulgay/crf_dia_ident
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))