Text

lamp.data.Text
object Text

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Text.type

Members list

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

Attributes

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

Attributes

def makePredictionBatch(examples: Seq[Vector[Long]], device: Device)(implicit scope: Scope): Variable
def minibatchesFromText(text: Vector[Int], minibatchSize: Int, timeSteps: Int, rng: Random): BatchStream[(Constant, STen), Int, Unit]

Yields tensors of shape (time step x batch size)

Yields tensors of shape (time step x batch size)

Attributes

def sentenceToPaddedVec(sentence: String, maxLength: Int, pad: Int, vocabulary: Map[Char, Int]): Array[Int]
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])