gg_nlp

package
v0.3.37 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keyword

type Keyword struct {
	Weight int
	Value  string
}

func (*Keyword) String

func (instance *Keyword) String() string

type NLPHelper

type NLPHelper struct {
	// contains filtered or unexported fields
}
var NLP *NLPHelper

func (*NLPHelper) Classifier

func (instance *NLPHelper) Classifier() *nlp_classifier.NlpClassifier

func (*NLPHelper) Entities

func (instance *NLPHelper) Entities() *nlp_entities.EntityMatcher

func (*NLPHelper) GetEntities

func (instance *NLPHelper) GetEntities(text string, list []string) map[string][]string

func (*NLPHelper) GetEntitiesAll

func (instance *NLPHelper) GetEntitiesAll(text string) map[string][]string

GetEntitiesAll return only existing entities

func (*NLPHelper) GetKeywords

func (instance *NLPHelper) GetKeywords(text string, minLen int) []string

func (*NLPHelper) GetKeywordsProgression

func (instance *NLPHelper) GetKeywordsProgression(text string, minLen int) []string

GetKeywordsProgression generate an array of keywords with also partial words like ["word", "wor", "wo"]. This is useful searching for partial words

func (*NLPHelper) GetKeywordsSorted

func (instance *NLPHelper) GetKeywordsSorted(text string, minLen int) []string

func (*NLPHelper) GetKeywordsSortedWithSpecialChars

func (instance *NLPHelper) GetKeywordsSortedWithSpecialChars(text string, minLen int) []string

func (*NLPHelper) GetKeywordsWithSpecialChars

func (instance *NLPHelper) GetKeywordsWithSpecialChars(text string, minLen int) []string

func (*NLPHelper) GetLanguageCode

func (instance *NLPHelper) GetLanguageCode(text string) string

func (*NLPHelper) LanguageDetector

func (instance *NLPHelper) LanguageDetector() *nlp_detect.LanguageDetector

func (*NLPHelper) ListKeywords

func (instance *NLPHelper) ListKeywords(text string, minLen int, sortByWeight, includeSpecialChars bool) (response []*Keyword)

func (*NLPHelper) ListKeywordsWith

func (instance *NLPHelper) ListKeywordsWith(text string, minLen int, sortByWeight, includeSpecialChars bool) (response []*Keyword)

func (*NLPHelper) ListKeywordsWithMinWeight

func (instance *NLPHelper) ListKeywordsWithMinWeight(text string, minLen, minWeight int, sortByWeight, includeSpecialChars bool) (response []*Keyword)

func (*NLPHelper) MapKeywords

func (instance *NLPHelper) MapKeywords(text string, minLen int) map[string]int

func (*NLPHelper) MapKeywordsWithSpecialChars

func (instance *NLPHelper) MapKeywordsWithSpecialChars(text string, minLen int) map[string]int

func (*NLPHelper) MatchEntities

func (instance *NLPHelper) MatchEntities(text string, list []string) map[string][]string

func (*NLPHelper) MatchEntitiesAll

func (instance *NLPHelper) MatchEntitiesAll(text string) map[string][]string

func (*NLPHelper) Num2Word

func (instance *NLPHelper) Num2Word(num int, lang ...string) string

func (*NLPHelper) Score

func (instance *NLPHelper) Score() *nlp_scoring.ScoreCalculator

func (*NLPHelper) ScoreAnd

func (instance *NLPHelper) ScoreAnd(text string, expressions []string) float32

ScoreAnd Calculate a matching score between a phrase and a check test using expressions. ALL expressions are evaluated. Failed expressions add negative score to result @param [string] phrase. "hello humanity!! I'm Mario rossi" @param [string] expressions. All expressions to match. ["hel??0 h*", "I* * ros*"]

func (*NLPHelper) ScoreBest

func (instance *NLPHelper) ScoreBest(text string, expressions []string) float32

ScoreBest Calculate a matching score between a phrase and a check test using expressions. ALL expressions are evaluated. Failed expressions do not add negative score to result. Return best score above all @param [string] phrase. "hello humanity!! I'm Mario rossi" @param [string] expressions. All expressions to match. ["hel??0 h*", "I* * ros*"]

func (*NLPHelper) ScoreOr

func (instance *NLPHelper) ScoreOr(text string, expressions []string) float32

ScoreOr Calculate a matching score between a phrase and a check test using expressions. ALL expressions are evaluated. Failed expressions do not add negative score to result @param [string] phrase. "hello humanity!! I'm Mario rossi" @param [string] expressions. All expressions to match. ["hel??0 h*", "I* * ros*"]

func (*NLPHelper) SummarizeLexRank

func (instance *NLPHelper) SummarizeLexRank(text string, intoSentences int) []string

func (*NLPHelper) SummarizeLexRankHigh

func (instance *NLPHelper) SummarizeLexRankHigh(text string) []string

SummarizeLexRankHigh very short text. Response is about 15% of original text

func (*NLPHelper) SummarizeLexRankLow

func (instance *NLPHelper) SummarizeLexRankLow(text string) []string

SummarizeLexRankLow response is about 40% of original text

func (*NLPHelper) SummarizeLexRankMedium

func (instance *NLPHelper) SummarizeLexRankMedium(text string) []string

SummarizeLexRankMedium response is about 25% of original text

func (*NLPHelper) Summarizer

func (instance *NLPHelper) Summarizer() *nlp_summarize.Summarizer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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