ai

package
v0.0.0-...-39aa7b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = fmt.Errorf("Not implemented without CUDA")
View Source
var File_lib_gobert_src_keywords_proto protoreflect.FileDescriptor
View Source
var File_lib_gobert_src_sentence_embedding_proto protoreflect.FileDescriptor
View Source
var File_lib_gobert_src_zero_shot_proto protoreflect.FileDescriptor

Functions

func Cosine

func Cosine(a []float32, b []float32) (cosine float32)

Types

type Embedding

type Embedding struct {
	Vectors []float32 `protobuf:"fixed32,1,rep,packed,name=vectors,proto3" json:"vectors,omitempty"`
	// contains filtered or unexported fields
}

func (*Embedding) Descriptor deprecated

func (*Embedding) Descriptor() ([]byte, []int)

Deprecated: Use Embedding.ProtoReflect.Descriptor instead.

func (*Embedding) GetVectors

func (x *Embedding) GetVectors() []float32

func (*Embedding) ProtoMessage

func (*Embedding) ProtoMessage()

func (*Embedding) ProtoReflect

func (x *Embedding) ProtoReflect() protoreflect.Message

func (*Embedding) Reset

func (x *Embedding) Reset()

func (*Embedding) String

func (x *Embedding) String() string

type Keyword

type Keyword struct {
	Text  []byte  `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	Score float32 `protobuf:"fixed32,2,opt,name=score,proto3" json:"score,omitempty"`
	// contains filtered or unexported fields
}

func (*Keyword) Descriptor deprecated

func (*Keyword) Descriptor() ([]byte, []int)

Deprecated: Use Keyword.ProtoReflect.Descriptor instead.

func (*Keyword) GetScore

func (x *Keyword) GetScore() float32

func (*Keyword) GetText

func (x *Keyword) GetText() []byte

func (*Keyword) ProtoMessage

func (*Keyword) ProtoMessage()

func (*Keyword) ProtoReflect

func (x *Keyword) ProtoReflect() protoreflect.Message

func (*Keyword) Reset

func (x *Keyword) Reset()

func (*Keyword) String

func (x *Keyword) String() string

type KeywordExtractionModel

type KeywordExtractionModel struct {
	// contains filtered or unexported fields
}

func NewKeywordExtractionModel

func NewKeywordExtractionModel() (*KeywordExtractionModel, error)

func (*KeywordExtractionModel) Close

func (ai *KeywordExtractionModel) Close()

func (*KeywordExtractionModel) Extract

func (ai *KeywordExtractionModel) Extract(texts []string) ([]*Keywords, error)

type KeywordRequest

type KeywordRequest struct {
	Texts []string `protobuf:"bytes,1,rep,name=texts,proto3" json:"texts,omitempty"`
	// contains filtered or unexported fields
}

func (*KeywordRequest) Descriptor deprecated

func (*KeywordRequest) Descriptor() ([]byte, []int)

Deprecated: Use KeywordRequest.ProtoReflect.Descriptor instead.

func (*KeywordRequest) GetTexts

func (x *KeywordRequest) GetTexts() []string

func (*KeywordRequest) ProtoMessage

func (*KeywordRequest) ProtoMessage()

func (*KeywordRequest) ProtoReflect

func (x *KeywordRequest) ProtoReflect() protoreflect.Message

func (*KeywordRequest) Reset

func (x *KeywordRequest) Reset()

func (*KeywordRequest) String

func (x *KeywordRequest) String() string

type KeywordResponse

type KeywordResponse struct {
	Texts []*Keywords `protobuf:"bytes,1,rep,name=texts,proto3" json:"texts,omitempty"`
	// contains filtered or unexported fields
}

func (*KeywordResponse) Descriptor deprecated

func (*KeywordResponse) Descriptor() ([]byte, []int)

Deprecated: Use KeywordResponse.ProtoReflect.Descriptor instead.

func (*KeywordResponse) GetTexts

func (x *KeywordResponse) GetTexts() []*Keywords

func (*KeywordResponse) ProtoMessage

func (*KeywordResponse) ProtoMessage()

func (*KeywordResponse) ProtoReflect

func (x *KeywordResponse) ProtoReflect() protoreflect.Message

func (*KeywordResponse) Reset

func (x *KeywordResponse) Reset()

func (*KeywordResponse) String

func (x *KeywordResponse) String() string

type Keywords

type Keywords struct {
	Keywords []*Keyword `protobuf:"bytes,1,rep,name=keywords,proto3" json:"keywords,omitempty"`
	// contains filtered or unexported fields
}

func (*Keywords) Descriptor deprecated

func (*Keywords) Descriptor() ([]byte, []int)

Deprecated: Use Keywords.ProtoReflect.Descriptor instead.

func (*Keywords) GetKeywords

func (x *Keywords) GetKeywords() []*Keyword

func (*Keywords) ProtoMessage

func (*Keywords) ProtoMessage()

func (*Keywords) ProtoReflect

func (x *Keywords) ProtoReflect() protoreflect.Message

func (*Keywords) Reset

func (x *Keywords) Reset()

func (*Keywords) String

func (x *Keywords) String() string

type SentenceEmbeddingModel

type SentenceEmbeddingModel struct {
	// contains filtered or unexported fields
}

func NewSentenceEmbeddingModel

func NewSentenceEmbeddingModel() (*SentenceEmbeddingModel, error)

func (*SentenceEmbeddingModel) Close

func (ai *SentenceEmbeddingModel) Close()

func (*SentenceEmbeddingModel) Embeddings

func (ai *SentenceEmbeddingModel) Embeddings(texts []string) ([]*Embedding, error)

type SentenceEmbeddingRequest

type SentenceEmbeddingRequest struct {
	Texts []string `protobuf:"bytes,1,rep,name=texts,proto3" json:"texts,omitempty"`
	// contains filtered or unexported fields
}

func (*SentenceEmbeddingRequest) Descriptor deprecated

func (*SentenceEmbeddingRequest) Descriptor() ([]byte, []int)

Deprecated: Use SentenceEmbeddingRequest.ProtoReflect.Descriptor instead.

func (*SentenceEmbeddingRequest) GetTexts

func (x *SentenceEmbeddingRequest) GetTexts() []string

func (*SentenceEmbeddingRequest) ProtoMessage

func (*SentenceEmbeddingRequest) ProtoMessage()

func (*SentenceEmbeddingRequest) ProtoReflect

func (x *SentenceEmbeddingRequest) ProtoReflect() protoreflect.Message

func (*SentenceEmbeddingRequest) Reset

func (x *SentenceEmbeddingRequest) Reset()

func (*SentenceEmbeddingRequest) String

func (x *SentenceEmbeddingRequest) String() string

type SentenceEmbeddingResponse

type SentenceEmbeddingResponse struct {
	Texts []*Embedding `protobuf:"bytes,1,rep,name=texts,proto3" json:"texts,omitempty"`
	// contains filtered or unexported fields
}

func (*SentenceEmbeddingResponse) Descriptor deprecated

func (*SentenceEmbeddingResponse) Descriptor() ([]byte, []int)

Deprecated: Use SentenceEmbeddingResponse.ProtoReflect.Descriptor instead.

func (*SentenceEmbeddingResponse) GetTexts

func (x *SentenceEmbeddingResponse) GetTexts() []*Embedding

func (*SentenceEmbeddingResponse) ProtoMessage

func (*SentenceEmbeddingResponse) ProtoMessage()

func (*SentenceEmbeddingResponse) ProtoReflect

func (*SentenceEmbeddingResponse) Reset

func (x *SentenceEmbeddingResponse) Reset()

func (*SentenceEmbeddingResponse) String

func (x *SentenceEmbeddingResponse) String() string

type ZeroShotClassification

type ZeroShotClassification struct {
	Label []byte  `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
	Score float32 `protobuf:"fixed32,2,opt,name=score,proto3" json:"score,omitempty"`
	// contains filtered or unexported fields
}

func (*ZeroShotClassification) Descriptor deprecated

func (*ZeroShotClassification) Descriptor() ([]byte, []int)

Deprecated: Use ZeroShotClassification.ProtoReflect.Descriptor instead.

func (*ZeroShotClassification) GetLabel

func (x *ZeroShotClassification) GetLabel() []byte

func (*ZeroShotClassification) GetScore

func (x *ZeroShotClassification) GetScore() float32

func (*ZeroShotClassification) ProtoMessage

func (*ZeroShotClassification) ProtoMessage()

func (*ZeroShotClassification) ProtoReflect

func (x *ZeroShotClassification) ProtoReflect() protoreflect.Message

func (*ZeroShotClassification) Reset

func (x *ZeroShotClassification) Reset()

func (*ZeroShotClassification) String

func (x *ZeroShotClassification) String() string

type ZeroShotClassifications

type ZeroShotClassifications struct {
	Classifications []*ZeroShotClassification `protobuf:"bytes,1,rep,name=classifications,proto3" json:"classifications,omitempty"`
	// contains filtered or unexported fields
}

func (*ZeroShotClassifications) Descriptor deprecated

func (*ZeroShotClassifications) Descriptor() ([]byte, []int)

Deprecated: Use ZeroShotClassifications.ProtoReflect.Descriptor instead.

func (*ZeroShotClassifications) GetClassifications

func (x *ZeroShotClassifications) GetClassifications() []*ZeroShotClassification

func (*ZeroShotClassifications) ProtoMessage

func (*ZeroShotClassifications) ProtoMessage()

func (*ZeroShotClassifications) ProtoReflect

func (x *ZeroShotClassifications) ProtoReflect() protoreflect.Message

func (*ZeroShotClassifications) Reset

func (x *ZeroShotClassifications) Reset()

func (*ZeroShotClassifications) String

func (x *ZeroShotClassifications) String() string

type ZeroShotModel

type ZeroShotModel struct {
	// contains filtered or unexported fields
}

func NewZeroShotModel

func NewZeroShotModel() (*ZeroShotModel, error)

func (*ZeroShotModel) Close

func (ai *ZeroShotModel) Close()

func (*ZeroShotModel) Predict

func (ai *ZeroShotModel) Predict(texts []string, labels []string) ([]*ZeroShotClassifications, error)

type ZeroShotRequest

type ZeroShotRequest struct {
	Texts  []string `protobuf:"bytes,1,rep,name=texts,proto3" json:"texts,omitempty"`
	Labels []string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"`
	// contains filtered or unexported fields
}

func (*ZeroShotRequest) Descriptor deprecated

func (*ZeroShotRequest) Descriptor() ([]byte, []int)

Deprecated: Use ZeroShotRequest.ProtoReflect.Descriptor instead.

func (*ZeroShotRequest) GetLabels

func (x *ZeroShotRequest) GetLabels() []string

func (*ZeroShotRequest) GetTexts

func (x *ZeroShotRequest) GetTexts() []string

func (*ZeroShotRequest) ProtoMessage

func (*ZeroShotRequest) ProtoMessage()

func (*ZeroShotRequest) ProtoReflect

func (x *ZeroShotRequest) ProtoReflect() protoreflect.Message

func (*ZeroShotRequest) Reset

func (x *ZeroShotRequest) Reset()

func (*ZeroShotRequest) String

func (x *ZeroShotRequest) String() string

type ZeroShotResponse

type ZeroShotResponse struct {
	Sentences []*ZeroShotClassifications `protobuf:"bytes,1,rep,name=sentences,proto3" json:"sentences,omitempty"`
	// contains filtered or unexported fields
}

func (*ZeroShotResponse) Descriptor deprecated

func (*ZeroShotResponse) Descriptor() ([]byte, []int)

Deprecated: Use ZeroShotResponse.ProtoReflect.Descriptor instead.

func (*ZeroShotResponse) GetSentences

func (x *ZeroShotResponse) GetSentences() []*ZeroShotClassifications

func (*ZeroShotResponse) ProtoMessage

func (*ZeroShotResponse) ProtoMessage()

func (*ZeroShotResponse) ProtoReflect

func (x *ZeroShotResponse) ProtoReflect() protoreflect.Message

func (*ZeroShotResponse) Reset

func (x *ZeroShotResponse) Reset()

func (*ZeroShotResponse) String

func (x *ZeroShotResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL