nlp

package
v0.0.0-...-1e9b345 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RegisterNlpServer

func RegisterNlpServer(s *grpc.Server, srv NlpServer)

Types

type Doc

type Doc struct {
	Text        string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	TextWithWs  string `protobuf:"bytes,2,opt,name=text_with_ws,json=textWithWs,proto3" json:"text_with_ws,omitempty"`
	IsTagged    bool   `protobuf:"varint,3,opt,name=is_tagged,json=isTagged,proto3" json:"is_tagged,omitempty"`
	IsParsed    bool   `protobuf:"varint,4,opt,name=is_parsed,json=isParsed,proto3" json:"is_parsed,omitempty"`
	IsNered     bool   `protobuf:"varint,5,opt,name=is_nered,json=isNered,proto3" json:"is_nered,omitempty"`
	IsSentenced bool   `protobuf:"varint,6,opt,name=is_sentenced,json=isSentenced,proto3" json:"is_sentenced,omitempty"`
	// contains filtered or unexported fields
}

func (*Doc) Descriptor deprecated

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

Deprecated: Use Doc.ProtoReflect.Descriptor instead.

func (*Doc) GetIsNered

func (x *Doc) GetIsNered() bool

func (*Doc) GetIsParsed

func (x *Doc) GetIsParsed() bool

func (*Doc) GetIsSentenced

func (x *Doc) GetIsSentenced() bool

func (*Doc) GetIsTagged

func (x *Doc) GetIsTagged() bool

func (*Doc) GetText

func (x *Doc) GetText() string

func (*Doc) GetTextWithWs

func (x *Doc) GetTextWithWs() string

func (*Doc) ProtoMessage

func (*Doc) ProtoMessage()

func (*Doc) ProtoReflect

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

func (*Doc) Reset

func (x *Doc) Reset()

func (*Doc) String

func (x *Doc) String() string

type Ent

type Ent struct {
	Start int32  `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"`
	End   int32  `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"`
	Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"`
	// contains filtered or unexported fields
}

func (*Ent) Descriptor deprecated

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

Deprecated: Use Ent.ProtoReflect.Descriptor instead.

func (*Ent) GetEnd

func (x *Ent) GetEnd() int32

func (*Ent) GetLabel

func (x *Ent) GetLabel() string

func (*Ent) GetStart

func (x *Ent) GetStart() int32

func (*Ent) ProtoMessage

func (*Ent) ProtoMessage()

func (*Ent) ProtoReflect

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

func (*Ent) Reset

func (x *Ent) Reset()

func (*Ent) String

func (x *Ent) String() string

type Match

type Match struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Start int32  `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"`
	End   int32  `protobuf:"varint,3,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

func (*Match) Descriptor deprecated

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

Deprecated: Use Match.ProtoReflect.Descriptor instead.

func (*Match) GetEnd

func (x *Match) GetEnd() int32

func (*Match) GetId

func (x *Match) GetId() string

func (*Match) GetStart

func (x *Match) GetStart() int32

func (*Match) ProtoMessage

func (*Match) ProtoMessage()

func (*Match) ProtoReflect

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

func (*Match) Reset

func (x *Match) Reset()

func (*Match) String

func (x *Match) String() string

type Matches

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

func (*Matches) Descriptor deprecated

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

Deprecated: Use Matches.ProtoReflect.Descriptor instead.

func (*Matches) GetMatches

func (x *Matches) GetMatches() []*Match

func (*Matches) ProtoMessage

func (*Matches) ProtoMessage()

func (*Matches) ProtoReflect

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

func (*Matches) Reset

func (x *Matches) Reset()

func (*Matches) String

func (x *Matches) String() string

type NlpClient

type NlpClient interface {
	LoadModel(ctx context.Context, in *TextRequest, opts ...grpc.CallOption) (*TextResponse, error)
	NlpProcess(ctx context.Context, in *TextRequest, opts ...grpc.CallOption) (*ParsedNLPRes, error)
	DocSimilarity(ctx context.Context, in *TextSimilarityRequest, opts ...grpc.CallOption) (*TextSimilarity, error)
	AddRule(ctx context.Context, in *Rule, opts ...grpc.CallOption) (*TextResponse, error)
	RemoveRule(ctx context.Context, in *TextRequest, opts ...grpc.CallOption) (*TextResponse, error)
	GetRule(ctx context.Context, in *TextRequest, opts ...grpc.CallOption) (*Rule, error)
	GetMatches(ctx context.Context, in *TextRequest, opts ...grpc.CallOption) (*Matches, error)
	ResetMatcher(ctx context.Context, in *TextRequest, opts ...grpc.CallOption) (*TextResponse, error)
}

NlpClient is the client API for Nlp service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewNlpClient

func NewNlpClient(cc grpc.ClientConnInterface) NlpClient

type NlpServer

NlpServer is the server API for Nlp service.

type NounChunk

type NounChunk struct {
	Start int32 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"`
	End   int32 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

func (*NounChunk) Descriptor deprecated

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

Deprecated: Use NounChunk.ProtoReflect.Descriptor instead.

func (*NounChunk) GetEnd

func (x *NounChunk) GetEnd() int32

func (*NounChunk) GetStart

func (x *NounChunk) GetStart() int32

func (*NounChunk) ProtoMessage

func (*NounChunk) ProtoMessage()

func (*NounChunk) ProtoReflect

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

func (*NounChunk) Reset

func (x *NounChunk) Reset()

func (*NounChunk) String

func (x *NounChunk) String() string

type ParsedNLPRes

type ParsedNLPRes struct {
	Model      string       `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
	Doc        *Doc         `protobuf:"bytes,2,opt,name=doc,proto3" json:"doc,omitempty"`
	Ents       []*Ent       `protobuf:"bytes,3,rep,name=ents,proto3" json:"ents,omitempty"`
	Sents      []*Sent      `protobuf:"bytes,4,rep,name=sents,proto3" json:"sents,omitempty"`
	NounChunks []*NounChunk `protobuf:"bytes,5,rep,name=noun_chunks,json=nounChunks,proto3" json:"noun_chunks,omitempty"`
	Tokens     []*Token     `protobuf:"bytes,6,rep,name=tokens,proto3" json:"tokens,omitempty"`
	// contains filtered or unexported fields
}

func (*ParsedNLPRes) Descriptor deprecated

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

Deprecated: Use ParsedNLPRes.ProtoReflect.Descriptor instead.

func (*ParsedNLPRes) GetDoc

func (x *ParsedNLPRes) GetDoc() *Doc

func (*ParsedNLPRes) GetEnts

func (x *ParsedNLPRes) GetEnts() []*Ent

func (*ParsedNLPRes) GetModel

func (x *ParsedNLPRes) GetModel() string

func (*ParsedNLPRes) GetNounChunks

func (x *ParsedNLPRes) GetNounChunks() []*NounChunk

func (*ParsedNLPRes) GetSents

func (x *ParsedNLPRes) GetSents() []*Sent

func (*ParsedNLPRes) GetTokens

func (x *ParsedNLPRes) GetTokens() []*Token

func (*ParsedNLPRes) ProtoMessage

func (*ParsedNLPRes) ProtoMessage()

func (*ParsedNLPRes) ProtoReflect

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

func (*ParsedNLPRes) Reset

func (x *ParsedNLPRes) Reset()

func (*ParsedNLPRes) String

func (x *ParsedNLPRes) String() string

type Pattern

type Pattern struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Pattern) Descriptor deprecated

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

Deprecated: Use Pattern.ProtoReflect.Descriptor instead.

func (*Pattern) GetKey

func (x *Pattern) GetKey() string

func (*Pattern) GetValue

func (x *Pattern) GetValue() string

func (*Pattern) ProtoMessage

func (*Pattern) ProtoMessage()

func (*Pattern) ProtoReflect

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

func (*Pattern) Reset

func (x *Pattern) Reset()

func (*Pattern) String

func (x *Pattern) String() string

type Rule

type Rule struct {
	Id       string     `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Patterns []*Pattern `protobuf:"bytes,2,rep,name=patterns,proto3" json:"patterns,omitempty"`
	// contains filtered or unexported fields
}

func (*Rule) Descriptor deprecated

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

Deprecated: Use Rule.ProtoReflect.Descriptor instead.

func (*Rule) GetId

func (x *Rule) GetId() string

func (*Rule) GetPatterns

func (x *Rule) GetPatterns() []*Pattern

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) ProtoReflect

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

func (*Rule) Reset

func (x *Rule) Reset()

func (*Rule) String

func (x *Rule) String() string

type Sent

type Sent struct {
	Start int32 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"`
	End   int32 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"`
	// contains filtered or unexported fields
}

func (*Sent) Descriptor deprecated

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

Deprecated: Use Sent.ProtoReflect.Descriptor instead.

func (*Sent) GetEnd

func (x *Sent) GetEnd() int32

func (*Sent) GetStart

func (x *Sent) GetStart() int32

func (*Sent) ProtoMessage

func (*Sent) ProtoMessage()

func (*Sent) ProtoReflect

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

func (*Sent) Reset

func (x *Sent) Reset()

func (*Sent) String

func (x *Sent) String() string

type TextRequest

type TextRequest struct {
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*TextRequest) Descriptor deprecated

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

Deprecated: Use TextRequest.ProtoReflect.Descriptor instead.

func (*TextRequest) GetText

func (x *TextRequest) GetText() string

func (*TextRequest) ProtoMessage

func (*TextRequest) ProtoMessage()

func (*TextRequest) ProtoReflect

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

func (*TextRequest) Reset

func (x *TextRequest) Reset()

func (*TextRequest) String

func (x *TextRequest) String() string

type TextResponse

type TextResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*TextResponse) Descriptor deprecated

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

Deprecated: Use TextResponse.ProtoReflect.Descriptor instead.

func (*TextResponse) GetMessage

func (x *TextResponse) GetMessage() string

func (*TextResponse) ProtoMessage

func (*TextResponse) ProtoMessage()

func (*TextResponse) ProtoReflect

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

func (*TextResponse) Reset

func (x *TextResponse) Reset()

func (*TextResponse) String

func (x *TextResponse) String() string

type TextSimilarity

type TextSimilarity struct {
	Similarity float32 `protobuf:"fixed32,1,opt,name=similarity,proto3" json:"similarity,omitempty"`
	// contains filtered or unexported fields
}

func (*TextSimilarity) Descriptor deprecated

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

Deprecated: Use TextSimilarity.ProtoReflect.Descriptor instead.

func (*TextSimilarity) GetSimilarity

func (x *TextSimilarity) GetSimilarity() float32

func (*TextSimilarity) ProtoMessage

func (*TextSimilarity) ProtoMessage()

func (*TextSimilarity) ProtoReflect

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

func (*TextSimilarity) Reset

func (x *TextSimilarity) Reset()

func (*TextSimilarity) String

func (x *TextSimilarity) String() string

type TextSimilarityRequest

type TextSimilarityRequest struct {
	Texta string `protobuf:"bytes,1,opt,name=texta,proto3" json:"texta,omitempty"`
	Textb string `protobuf:"bytes,2,opt,name=textb,proto3" json:"textb,omitempty"`
	// contains filtered or unexported fields
}

func (*TextSimilarityRequest) Descriptor deprecated

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

Deprecated: Use TextSimilarityRequest.ProtoReflect.Descriptor instead.

func (*TextSimilarityRequest) GetTexta

func (x *TextSimilarityRequest) GetTexta() string

func (*TextSimilarityRequest) GetTextb

func (x *TextSimilarityRequest) GetTextb() string

func (*TextSimilarityRequest) ProtoMessage

func (*TextSimilarityRequest) ProtoMessage()

func (*TextSimilarityRequest) ProtoReflect

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

func (*TextSimilarityRequest) Reset

func (x *TextSimilarityRequest) Reset()

func (*TextSimilarityRequest) String

func (x *TextSimilarityRequest) String() string

type Token

type Token struct {
	Text         string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	TextWithWs   string `protobuf:"bytes,2,opt,name=text_with_ws,json=textWithWs,proto3" json:"text_with_ws,omitempty"`
	Whitespace   string `protobuf:"bytes,3,opt,name=whitespace,proto3" json:"whitespace,omitempty"`
	EntType      string `protobuf:"bytes,5,opt,name=ent_type,json=entType,proto3" json:"ent_type,omitempty"`
	EntIob       string `protobuf:"bytes,6,opt,name=ent_iob,json=entIob,proto3" json:"ent_iob,omitempty"`
	Lemma        string `protobuf:"bytes,7,opt,name=lemma,proto3" json:"lemma,omitempty"`
	Norm         string `protobuf:"bytes,8,opt,name=norm,proto3" json:"norm,omitempty"`
	Lower        string `protobuf:"bytes,9,opt,name=lower,proto3" json:"lower,omitempty"`
	Shape        string `protobuf:"bytes,10,opt,name=shape,proto3" json:"shape,omitempty"`
	Prefix       string `protobuf:"bytes,11,opt,name=prefix,proto3" json:"prefix,omitempty"`
	Suffix       string `protobuf:"bytes,12,opt,name=suffix,proto3" json:"suffix,omitempty"`
	Pos          string `protobuf:"bytes,13,opt,name=pos,proto3" json:"pos,omitempty"`
	Tag          string `protobuf:"bytes,14,opt,name=tag,proto3" json:"tag,omitempty"`
	Dep          string `protobuf:"bytes,15,opt,name=dep,proto3" json:"dep,omitempty"`
	IsAlpha      bool   `protobuf:"varint,16,opt,name=is_alpha,json=isAlpha,proto3" json:"is_alpha,omitempty"`
	IsAscii      bool   `protobuf:"varint,17,opt,name=is_ascii,json=isAscii,proto3" json:"is_ascii,omitempty"`
	IsDigit      bool   `protobuf:"varint,18,opt,name=is_digit,json=isDigit,proto3" json:"is_digit,omitempty"`
	IsLower      bool   `protobuf:"varint,19,opt,name=is_lower,json=isLower,proto3" json:"is_lower,omitempty"`
	IsUpper      bool   `protobuf:"varint,20,opt,name=is_upper,json=isUpper,proto3" json:"is_upper,omitempty"`
	IsTitle      bool   `protobuf:"varint,21,opt,name=is_title,json=isTitle,proto3" json:"is_title,omitempty"`
	IsPunct      bool   `protobuf:"varint,22,opt,name=is_punct,json=isPunct,proto3" json:"is_punct,omitempty"`
	IsLeftPunct  bool   `protobuf:"varint,23,opt,name=is_left_punct,json=isLeftPunct,proto3" json:"is_left_punct,omitempty"`
	IsRightPunct bool   `protobuf:"varint,24,opt,name=is_right_punct,json=isRightPunct,proto3" json:"is_right_punct,omitempty"`
	IsSpace      bool   `protobuf:"varint,25,opt,name=is_space,json=isSpace,proto3" json:"is_space,omitempty"`
	IsBracket    bool   `protobuf:"varint,26,opt,name=is_bracket,json=isBracket,proto3" json:"is_bracket,omitempty"`
	IsCurrency   bool   `protobuf:"varint,27,opt,name=is_currency,json=isCurrency,proto3" json:"is_currency,omitempty"`
	LikeUrl      bool   `protobuf:"varint,28,opt,name=like_url,json=likeUrl,proto3" json:"like_url,omitempty"`
	LikeNum      bool   `protobuf:"varint,29,opt,name=like_num,json=likeNum,proto3" json:"like_num,omitempty"`
	LikeEmail    bool   `protobuf:"varint,30,opt,name=like_email,json=likeEmail,proto3" json:"like_email,omitempty"`
	IsOov        bool   `protobuf:"varint,31,opt,name=is_oov,json=isOov,proto3" json:"is_oov,omitempty"`
	IsStop       bool   `protobuf:"varint,32,opt,name=is_stop,json=isStop,proto3" json:"is_stop,omitempty"`
	IsSentStart  bool   `protobuf:"varint,33,opt,name=is_sent_start,json=isSentStart,proto3" json:"is_sent_start,omitempty"`
	Head         int32  `protobuf:"varint,34,opt,name=head,proto3" json:"head,omitempty"`
	// contains filtered or unexported fields
}

func (*Token) Descriptor deprecated

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

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetDep

func (x *Token) GetDep() string

func (*Token) GetEntIob

func (x *Token) GetEntIob() string

func (*Token) GetEntType

func (x *Token) GetEntType() string

func (*Token) GetHead

func (x *Token) GetHead() int32

func (*Token) GetIsAlpha

func (x *Token) GetIsAlpha() bool

func (*Token) GetIsAscii

func (x *Token) GetIsAscii() bool

func (*Token) GetIsBracket

func (x *Token) GetIsBracket() bool

func (*Token) GetIsCurrency

func (x *Token) GetIsCurrency() bool

func (*Token) GetIsDigit

func (x *Token) GetIsDigit() bool

func (*Token) GetIsLeftPunct

func (x *Token) GetIsLeftPunct() bool

func (*Token) GetIsLower

func (x *Token) GetIsLower() bool

func (*Token) GetIsOov

func (x *Token) GetIsOov() bool

func (*Token) GetIsPunct

func (x *Token) GetIsPunct() bool

func (*Token) GetIsRightPunct

func (x *Token) GetIsRightPunct() bool

func (*Token) GetIsSentStart

func (x *Token) GetIsSentStart() bool

func (*Token) GetIsSpace

func (x *Token) GetIsSpace() bool

func (*Token) GetIsStop

func (x *Token) GetIsStop() bool

func (*Token) GetIsTitle

func (x *Token) GetIsTitle() bool

func (*Token) GetIsUpper

func (x *Token) GetIsUpper() bool

func (*Token) GetLemma

func (x *Token) GetLemma() string

func (*Token) GetLikeEmail

func (x *Token) GetLikeEmail() bool

func (*Token) GetLikeNum

func (x *Token) GetLikeNum() bool

func (*Token) GetLikeUrl

func (x *Token) GetLikeUrl() bool

func (*Token) GetLower

func (x *Token) GetLower() string

func (*Token) GetNorm

func (x *Token) GetNorm() string

func (*Token) GetPos

func (x *Token) GetPos() string

func (*Token) GetPrefix

func (x *Token) GetPrefix() string

func (*Token) GetShape

func (x *Token) GetShape() string

func (*Token) GetSuffix

func (x *Token) GetSuffix() string

func (*Token) GetTag

func (x *Token) GetTag() string

func (*Token) GetText

func (x *Token) GetText() string

func (*Token) GetTextWithWs

func (x *Token) GetTextWithWs() string

func (*Token) GetWhitespace

func (x *Token) GetWhitespace() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

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

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

type UnimplementedNlpServer

type UnimplementedNlpServer struct {
}

UnimplementedNlpServer can be embedded to have forward compatible implementations.

func (*UnimplementedNlpServer) AddRule

func (*UnimplementedNlpServer) DocSimilarity

func (*UnimplementedNlpServer) GetMatches

func (*UnimplementedNlpServer) GetRule

func (*UnimplementedNlpServer) LoadModel

func (*UnimplementedNlpServer) NlpProcess

func (*UnimplementedNlpServer) RemoveRule

func (*UnimplementedNlpServer) ResetMatcher

Jump to

Keyboard shortcuts

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