예제 #1
0
def estimateJobSet(
        distPrevArt,
        accArts,
        createAccArt=liftLocal(d.getDefaultCreateAcc)(),
        estimateArt=liftLocal(d.getDefaultEstimate)(),
        afterAccArt=lit(None),
        verbosityArt=lit(0),
):
    return lift(estimate)(distPrevArt, createAccArt, estimateArt, afterAccArt,
                          verbosityArt, *accArts)
예제 #2
0
def estimateWithTotAuxJobSet(
        distPrevArt,
        accArts,
        createAccArt=liftLocal(d.getDefaultCreateAcc)(),
        estimateTotAuxArt=liftLocal(d.getDefaultEstimateTotAux)(),
        afterAccArt=lit(None),
        monotoneAuxArt=lit(True),
        verbosityArt=lit(0),
):
    return lift(estimateWithTotAux)(distPrevArt, createAccArt,
                                    estimateTotAuxArt, afterAccArt,
                                    monotoneAuxArt, verbosityArt, *accArts)
예제 #3
0
def estimateJobSet(
    distPrevArt,
    accArts,
    createAccArt = liftLocal(d.getDefaultCreateAcc)(),
    estimateArt = liftLocal(d.getDefaultEstimate)(),
    afterAccArt = lit(None),
    verbosityArt = lit(0),
):
    return lift(estimate)(
        distPrevArt, createAccArt, estimateArt, afterAccArt, verbosityArt,
        *accArts
    )
예제 #4
0
def estimateWithTotAuxJobSet(
    distPrevArt,
    accArts,
    createAccArt = liftLocal(d.getDefaultCreateAcc)(),
    estimateTotAuxArt = liftLocal(d.getDefaultEstimateTotAux)(),
    afterAccArt = lit(None),
    monotoneAuxArt = lit(True),
    verbosityArt = lit(0),
):
    return lift(estimateWithTotAux)(
        distPrevArt, createAccArt, estimateTotAuxArt, afterAccArt,
        monotoneAuxArt, verbosityArt, *accArts
    )
예제 #5
0
def expectationMaximizationJobSet(
        distPrevArt,
        corpusArt,
        uttIdChunkArts,
        createAccArt=liftLocal(d.getDefaultCreateAcc)(),
        estimateTotAuxArt=liftLocal(d.getDefaultEstimateTotAux)(),
        afterAccArt=lit(None),
        monotoneAuxArt=lit(True),
        verbosityArt=lit(0),
):
    """Returns job set to perform one step of expectation maximization."""
    accArts = accumulateJobSet(distPrevArt, corpusArt, uttIdChunkArts,
                               createAccArt)
    distArt = estimateWithTotAuxJobSet(distPrevArt, accArts, createAccArt,
                                       estimateTotAuxArt, afterAccArt,
                                       monotoneAuxArt, verbosityArt)
    return distArt
예제 #6
0
def expectationMaximizationJobSet(
    distPrevArt,
    corpusArt,
    uttIdChunkArts,
    createAccArt = liftLocal(d.getDefaultCreateAcc)(),
    estimateTotAuxArt = liftLocal(d.getDefaultEstimateTotAux)(),
    afterAccArt = lit(None),
    monotoneAuxArt = lit(True),
    verbosityArt = lit(0),
):
    """Returns job set to perform one step of expectation maximization."""
    accArts = accumulateJobSet(distPrevArt, corpusArt, uttIdChunkArts,
                               createAccArt)
    distArt = estimateWithTotAuxJobSet(distPrevArt, accArts, createAccArt,
                                       estimateTotAuxArt, afterAccArt,
                                       monotoneAuxArt, verbosityArt)
    return distArt
예제 #7
0
def trainEMJobSet(
        distInitArt,
        corpusArt,
        uttIdChunkArts,
        numIterationsLit=lit(1),
        createAccArt=liftLocal(d.getDefaultCreateAcc)(),
        estimateTotAuxArt=liftLocal(d.getDefaultEstimateTotAux)(),
        afterAccArt=lit(None),
        monotoneAuxArt=lit(True),
        verbosityArt=lit(0),
):
    numIterations = numIterationsLit.litValue
    distArt = distInitArt
    for it in range(numIterations):
        distArt = expectationMaximizationJobSet(distArt, corpusArt,
                                                uttIdChunkArts, createAccArt,
                                                estimateTotAuxArt, afterAccArt,
                                                monotoneAuxArt, verbosityArt)
    return distArt
예제 #8
0
def trainEMJobSet(
    distInitArt,
    corpusArt,
    uttIdChunkArts,
    numIterationsLit = lit(1),
    createAccArt = liftLocal(d.getDefaultCreateAcc)(),
    estimateTotAuxArt = liftLocal(d.getDefaultEstimateTotAux)(),
    afterAccArt = lit(None),
    monotoneAuxArt = lit(True),
    verbosityArt = lit(0),
):
    numIterations = numIterationsLit.litValue
    distArt = distInitArt
    for it in range(numIterations):
        distArt = expectationMaximizationJobSet(distArt, corpusArt,
                                                uttIdChunkArts, createAccArt,
                                                estimateTotAuxArt, afterAccArt,
                                                monotoneAuxArt, verbosityArt)
    return distArt
예제 #9
0
def getUttIdChunkArts(corpusArt, numChunksLit = lit(1)):
    numChunks = numChunksLit.litValue
    return liftLocal(getUttIdChunks, numOut = numChunks)(corpusArt,
                                                         numChunksLit)
예제 #10
0
def getUttIdChunkArts(corpusArt, numChunksLit=lit(1)):
    numChunks = numChunksLit.litValue
    return liftLocal(getUttIdChunks, numOut=numChunks)(corpusArt, numChunksLit)