nlp

package
v0.0.0-...-047dcd9 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyzeSentiment

func AnalyzeSentiment(text string, language langdetect.Language) (score float64, err error)

func AnalyzeSentimentONLINE

func AnalyzeSentimentONLINE(text string, language langdetect.Language, proxyUrl *string) (score float64, err error)

Types

type Sentiment

type Sentiment struct {
	Polarity     float64 `json:"Polarity"`
	Subjectivity float64 `json:"Subjectivity"`
}

type SentimentReport

type SentimentReport struct {
	Items []SentimentReportItem
}

func (*SentimentReport) DrawImage

func (sp *SentimentReport) DrawImage() ([]byte, error)

type SentimentReportItem

type SentimentReportItem struct {
	Time  time.Time
	Score float64
}

type SentimentSet

type SentimentSet struct {
	Items []SentimentWithTime
	// contains filtered or unexported fields
}

func NewSet

func NewSet(dataKeptInterval time.Duration) *SentimentSet

func (*SentimentSet) Append

func (ss *SentimentSet) Append(tm time.Time, polarity, subjectivity float64)

func (*SentimentSet) IsEmpty

func (ss *SentimentSet) IsEmpty() bool

func (*SentimentSet) ParseReport

func (ss *SentimentSet) ParseReport(interval time.Duration) (*SentimentReport, error)

type SentimentWithTime

type SentimentWithTime struct {
	Time time.Time
	Sentiment
}

Jump to

Keyboard shortcuts

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