Text
object Text
Value members
Concrete methods
Convert back to text. Tensor shape: time x batch x dim
Convert back to text. Tensor shape: time x batch x dim
def makePredictionBatch(examples: Seq[Vector[Long]], device: Device)(implicit scope: Scope): Variable
def minibatchesForSeq2Seq(text: IndexedSeq[(Vector[Long], Vector[Long])], minibatchSize: Int, timeSteps: Int, pad: Long, rng: Random): BatchStream[(Variable, Variable), Int, Unit]
Yields tensors of shape (time step x batch size)
Yields tensors of shape (time step x batch size)
- Value parameters:
- text
pairs of (source,destination) units
def minibatchesFromText(text: Vector[Int], minibatchSize: Int, timeSteps: Int, rng: Random): BatchStream[Constant, Int, Unit]
Yields tensors of shape (time step x batch size)
Yields tensors of shape (time step x batch size)
def sentencesToPaddedMatrix(sentences: Seq[String], maxLength: Int, pad: Int, vocabulary: Map[Char, Int]): Seq[Array[Int]]
def sequencePrediction[T, M <: StatefulModule[Variable, Variable, T]](batch: Seq[Vector[Long]], device: Device, module: M & StatefulModule[Variable, Variable, T], steps: Int)(implicit is: InitState[M, T], scope: Scope): STen
def sequencePredictionBeam[T, M <: StatefulModule[Variable, Variable, T]](prefix: Vector[Long], device: Device, module: M & StatefulModule[Variable, Variable, T], steps: Int, startSequence: Int, endOfSequence: Int)(implicit is: InitState[M, T], scope: Scope): Seq[(STen, Double)]
def wordsToIntegers(text: String, minimumTokenId: Int, minimumFrequency: Int): (Array[Int], Map[String, Int])