Text

object Text
class Object
trait Matchable
class Any
Text.type

Value members

Concrete methods

def charsToIntegers(text: String): (Map[Char, Int], Vector[Int])
def charsToIntegers(text: String, chars: Map[Char, Int]): Vector[Int]
def convertIntegersToText(tensor: STen, vocab: Map[Int, Char]): Seq[String]

Convert back to text. Tensor shape: time x batch

Convert back to text. Tensor shape: time x batch

def convertLogitsToText(tensor: STen, vocab: Map[Int, Char])(implicit scope: Scope): Seq[String]

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])