Documentation
¶
Index ¶
- Constants
- Variables
- type NlpClassificationCategory
- type NlpClassificationOptions
- type NlpClassificationOutput
- type NlpClassificationResponse
- type NlpClassifier
- func (instance *NlpClassifier) Classify(text string, options *NlpClassificationOptions) (out *NlpClassificationOutput, err error)
- func (instance *NlpClassifier) MatchKeywordsAll(text string, tags []string) (keywords []string)
- func (instance *NlpClassifier) MatchKeywordsUnique(text string, tags []string) (keywords []string)
- func (instance *NlpClassifier) Score(text, level string, tags []string) (score float32, err error)
Constants ¶
View Source
const ( MatchLevelAll = "all" MatchLevelAny = "any" MatchLevelBest = "best" )
Variables ¶
View Source
var ( MissingTextError = errors.New("missing_text_error") MissingTagsError = errors.New("missing_tags_error") )
Functions ¶
This section is empty.
Types ¶
type NlpClassificationOptions ¶
type NlpClassificationOptions struct { DetectLanguage bool `json:"detect-lang"` DetectKeywordsMode string `json:"detect-keywords-mode"` // all, unique, none DetectEntities []string `json:"detect-entities"` SummarizerSentences int `json:"summarizer-sentences"` MatchLevel string `json:"match-level"` // all, any, best Categories []*NlpClassificationCategory `json:"categories"` }
func ParseOptionsFromJson ¶
func ParseOptionsFromJson(text string) (options *NlpClassificationOptions, err error)
type NlpClassificationOutput ¶
type NlpClassificationOutput struct { Language string `json:"language"` Entities map[string][]string `json:"entities"` Summary string `json:"summary"` Response []*NlpClassificationResponse `json:"response"` Error string `json:"error"` }
func (*NlpClassificationOutput) HasError ¶
func (instance *NlpClassificationOutput) HasError() bool
func (*NlpClassificationOutput) SortAsc ¶
func (instance *NlpClassificationOutput) SortAsc() *NlpClassificationOutput
func (*NlpClassificationOutput) SortDesc ¶
func (instance *NlpClassificationOutput) SortDesc() *NlpClassificationOutput
func (*NlpClassificationOutput) String ¶
func (instance *NlpClassificationOutput) String() string
type NlpClassifier ¶
type NlpClassifier struct {
// contains filtered or unexported fields
}
func NewNlpClassifier ¶
func NewNlpClassifier() (instance *NlpClassifier)
func (*NlpClassifier) Classify ¶
func (instance *NlpClassifier) Classify(text string, options *NlpClassificationOptions) (out *NlpClassificationOutput, err error)
func (*NlpClassifier) MatchKeywordsAll ¶
func (instance *NlpClassifier) MatchKeywordsAll(text string, tags []string) (keywords []string)
func (*NlpClassifier) MatchKeywordsUnique ¶
func (instance *NlpClassifier) MatchKeywordsUnique(text string, tags []string) (keywords []string)
Click to show internal directories.
Click to hide internal directories.