Documentation ¶
Index ¶
- Variables
- func Cosine(a []float32, b []float32) (cosine float32)
- type Embedding
- type Keyword
- type KeywordExtractionModel
- type KeywordRequest
- type KeywordResponse
- type Keywords
- type SentenceEmbeddingModel
- type SentenceEmbeddingRequest
- func (*SentenceEmbeddingRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SentenceEmbeddingRequest) GetTexts() []string
- func (*SentenceEmbeddingRequest) ProtoMessage()
- func (x *SentenceEmbeddingRequest) ProtoReflect() protoreflect.Message
- func (x *SentenceEmbeddingRequest) Reset()
- func (x *SentenceEmbeddingRequest) String() string
- type SentenceEmbeddingResponse
- func (*SentenceEmbeddingResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SentenceEmbeddingResponse) GetTexts() []*Embedding
- func (*SentenceEmbeddingResponse) ProtoMessage()
- func (x *SentenceEmbeddingResponse) ProtoReflect() protoreflect.Message
- func (x *SentenceEmbeddingResponse) Reset()
- func (x *SentenceEmbeddingResponse) String() string
- type ZeroShotClassification
- func (*ZeroShotClassification) Descriptor() ([]byte, []int)deprecated
- func (x *ZeroShotClassification) GetLabel() []byte
- func (x *ZeroShotClassification) GetScore() float32
- func (*ZeroShotClassification) ProtoMessage()
- func (x *ZeroShotClassification) ProtoReflect() protoreflect.Message
- func (x *ZeroShotClassification) Reset()
- func (x *ZeroShotClassification) String() string
- type ZeroShotClassifications
- func (*ZeroShotClassifications) Descriptor() ([]byte, []int)deprecated
- func (x *ZeroShotClassifications) GetClassifications() []*ZeroShotClassification
- func (*ZeroShotClassifications) ProtoMessage()
- func (x *ZeroShotClassifications) ProtoReflect() protoreflect.Message
- func (x *ZeroShotClassifications) Reset()
- func (x *ZeroShotClassifications) String() string
- type ZeroShotModel
- type ZeroShotRequest
- func (*ZeroShotRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ZeroShotRequest) GetLabels() []string
- func (x *ZeroShotRequest) GetTexts() []string
- func (*ZeroShotRequest) ProtoMessage()
- func (x *ZeroShotRequest) ProtoReflect() protoreflect.Message
- func (x *ZeroShotRequest) Reset()
- func (x *ZeroShotRequest) String() string
- type ZeroShotResponse
- func (*ZeroShotResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ZeroShotResponse) GetSentences() []*ZeroShotClassifications
- func (*ZeroShotResponse) ProtoMessage()
- func (x *ZeroShotResponse) ProtoReflect() protoreflect.Message
- func (x *ZeroShotResponse) Reset()
- func (x *ZeroShotResponse) String() string
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 ¶
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) GetVectors ¶
func (*Embedding) ProtoMessage ¶
func (*Embedding) ProtoMessage()
func (*Embedding) ProtoReflect ¶
func (x *Embedding) ProtoReflect() protoreflect.Message
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) ProtoMessage ¶
func (*Keyword) ProtoMessage()
func (*Keyword) ProtoReflect ¶
func (x *Keyword) ProtoReflect() protoreflect.Message
type KeywordExtractionModel ¶
type KeywordExtractionModel struct {
// contains filtered or unexported fields
}
func NewKeywordExtractionModel ¶
func NewKeywordExtractionModel() (*KeywordExtractionModel, error)
func (*KeywordExtractionModel) Close ¶
func (ai *KeywordExtractionModel) Close()
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) GetKeywords ¶
func (*Keywords) ProtoMessage ¶
func (*Keywords) ProtoMessage()
func (*Keywords) ProtoReflect ¶
func (x *Keywords) ProtoReflect() protoreflect.Message
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 (x *SentenceEmbeddingResponse) ProtoReflect() protoreflect.Message
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
Click to show internal directories.
Click to hide internal directories.