Text
lamp.data.Text
object Text
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Text.type
Members list
Value members
Concrete methods
Convert back to text. Tensor shape: time x batch
Convert back to text. Tensor shape: time x batch
Attributes
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])
In this article