sentimentanalyzer

package
v0.0.0-...-8a4ab9d Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analysis

type Analysis struct {
	Sentiment        Sentiment
	Confidence       float32
	SentenceAnalyses []SentenceAnalysis
}

Analysis represents the sentiment analysis.

func GetSentiment

func GetSentiment(svc sentimentAnalyzer, comment string) (Analysis, error)

GetSentiment calls a sentimentService and retrieves the corresponding analysis.

func (Analysis) NegativeSentences

func (a Analysis) NegativeSentences() []SentenceAnalysis

NegativeSentences returns any negative sentences.

type SentenceAnalysis

type SentenceAnalysis struct {
	Sentiment  Sentiment
	Confidence float32
	Text       string
}

SentenceAnalysis represents individual sentence analysis.

type Sentiment

type Sentiment int

Sentiment is the type representation of a sentiment.

const (
	Positive Sentiment = iota
	Negative
	Neutral
)

func (Sentiment) String

func (i Sentiment) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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