Versions in this module Expand all Collapse all v0 v0.1.13 Apr 27, 2026 v0.1.12 Apr 27, 2026 v0.1.11 Apr 26, 2026 v0.1.10 Apr 26, 2026 v0.1.9 Apr 26, 2026 v0.1.8 Apr 26, 2026 Changes in this version + const ModelVersionV2 + type Detector struct + func LoadDetector(modelPath, tokenizerPath string) (*Detector, error) + func LoadDetectorReader(modelR io.Reader, tokenizerR io.Reader) (*Detector, error) + func NewBundledDetector() (*Detector, error) + func NewDetector(model *Model, tk *tokenizer.Tokenizer) (*Detector, error) + func (d *Detector) Close() error + func (d *Detector) Detect(text string) ([]Span, error) + func (d *Detector) ModelVersion() string + type Labels struct + Id2Label map[string]string + Label2Id map[string]int + NumLabels int + SeqLen int type Meta + Labels *Labels + Task string + func EmbeddedV2Meta() (*Meta, error) + func (m *Meta) IsTokenClassification() bool type Model + ClassifierB []float32 + ClassifierW *MaybeWeight + type Span struct + End int + Score float32 + Start int + Type string + func DecodeBIO(logits []float32, K int, id2label map[int]string, offsets [][2]int, ...) []Span v0.1.7 Apr 25, 2026 v0.1.6 Apr 24, 2026 Changes in this version type Model + func (m *Model) ForwardBatch(inputIDs, attentionMask []int32, B int) [][]float32 type Scorer + func (s *Scorer) BatchScore(triples []scanner.SpanTriple) ([]float64, error) v0.1.5 Apr 24, 2026 v0.1.4 Apr 24, 2026 Changes in this version + type Arena struct + func NewArena() *Arena + func (a *Arena) Get(shape ...int) *Tensor + func (a *Arena) Reset() type Tensor + Packed []float32 + func (t *Tensor) PackForMatMul() *Tensor v0.1.3 Apr 24, 2026 v0.1.2 Apr 24, 2026 Changes in this version + const DTypeF32 + const DTypeI32 + const DTypeI8 + const ModelVersion + type Bundle struct + Meta Meta + Tensors map[string]*RawTensor + func Read(r io.Reader) (*Bundle, error) + type Layer struct + Attn1LN_B []float32 + Attn1LN_W []float32 + AttnOutB []float32 + AttnOutW *MaybeWeight + InterB []float32 + InterW *MaybeWeight + KeyB []float32 + KeyW *MaybeWeight + Out2LN_B []float32 + Out2LN_W []float32 + OutputB []float32 + OutputW *MaybeWeight + QueryB []float32 + QueryW *MaybeWeight + ValueB []float32 + ValueW *MaybeWeight + type MaybeWeight struct + F32 *Tensor + I8 *QuantWeight + func (w *MaybeWeight) IsInt8() bool + func (w *MaybeWeight) MatMul(a *Tensor) *Tensor + type Meta struct + FFN int + Heads int + Hidden int + Layers int + MaxPosition int + Model string + OutputClasses int + PaddingIdx int + SeqLen int + TokenTypeCount int + Vocab int + type Model struct + ClsDenseB []float32 + ClsDenseW *MaybeWeight + ClsOutB []float32 + ClsOutW *MaybeWeight + EmbLN_B []float32 + EmbLN_W []float32 + Layers []Layer + Meta Meta + PosEmb *Tensor + TypeEmb *Tensor + WordEmb *Tensor + func LoadModel(b *Bundle) (*Model, error) + func (m *Model) Forward(inputIDs, attentionMask []int32) []float32 + type QuantWeight struct + Data []int8 + In int + Out int + Scale []float32 + func NewQuantWeight(in, out int, data []int8, scale []float32) (*QuantWeight, error) + func (qw *QuantWeight) DequantizeToF32() *Tensor + type RawTensor struct + DType uint8 + F32 []float32 + I32 []int32 + I8 []int8 + Name string + Shape []int + type Scorer struct + func LoadScorer(modelPath, tokenizerPath string) (*Scorer, error) + func LoadScorerReader(modelR io.Reader, tokenizerR io.Reader) (*Scorer, error) + func NewBundledScorer() (*Scorer, error) + func NewScorer(model *Model, tk *tokenizer.Tokenizer, maxLen int) *Scorer + func (s *Scorer) Close() error + func (s *Scorer) ModelVersion() string + func (s *Scorer) Score(left, span, right string) (float64, error) + type Tensor struct + Data []float32 + Shape []int + func Add(a, b *Tensor) *Tensor + func AddBias(x *Tensor, bias []float32) *Tensor + func AddInPlace(a, b *Tensor) *Tensor + func ApplyAdditiveMask(x *Tensor, mask []float32) *Tensor + func BatchMatMul(a, b *Tensor) *Tensor + func FromSlice(shape []int, data []float32) *Tensor + func GELU(x *Tensor) *Tensor + func Gather(table *Tensor, indices []int32, B, T int) *Tensor + func LayerNorm(x *Tensor, gamma, beta []float32, eps float32) *Tensor + func MatMul(a, b *Tensor) *Tensor + func MatMulInt8(a *Tensor, w *QuantWeight) *Tensor + func NewTensor(shape ...int) *Tensor + func Reshape(t *Tensor, shape ...int) *Tensor + func ScaleInPlace(t *Tensor, s float32) *Tensor + func Softmax(x *Tensor) *Tensor + func Transpose(t *Tensor, axes []int) *Tensor + func (t *Tensor) Clone() *Tensor + func (t *Tensor) Numel() int + func (t *Tensor) Stride() []int