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)
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)
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 )
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 )
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
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
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
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
def getUttIdChunkArts(corpusArt, numChunksLit = lit(1)): numChunks = numChunksLit.litValue return liftLocal(getUttIdChunks, numOut = numChunks)(corpusArt, numChunksLit)
def getUttIdChunkArts(corpusArt, numChunksLit=lit(1)): numChunks = numChunksLit.litValue return liftLocal(getUttIdChunks, numOut=numChunks)(corpusArt, numChunksLit)