Documentation
¶
Overview ¶
Package provides easy integration with AWS Comprehend APIs Amazon Comprehend is a platform within Amazon Web Services (AWS) that uses machine learning to find insights in unstructured text. You can either use pre-trained text analysis models or customize your own to extract specific pieces of information, identify sentiment, and find topics in a collection of documents.
Index ¶
- type Message
- type Moderator
- func (m *Moderator) Analyze(text string, translateText bool) Message
- func (m *Moderator) GetEntities(text string) (*comprehend.DetectEntitiesOutput, error)
- func (m *Moderator) GetKeyPhrases(text string) (*comprehend.DetectKeyPhrasesOutput, error)
- func (m *Moderator) GetLanguages(ctx context.Context, text string) (*comprehend.DetectDominantLanguageOutput, error)
- func (m *Moderator) GetPII(text string) (*comprehend.DetectPiiEntitiesOutput, error)
- func (m *Moderator) GetSentiment(text string) (*comprehend.DetectSentimentOutput, error)
- func (m *Moderator) GetSyntax(text string) (*comprehend.DetectSyntaxOutput, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
Duration int64 `json:"duration"`
MessageID string `json:"message_id"`
Text string `json:"text"`
TranslatedText string `json:"translated_text"`
DetectedLanguage string `json:"detected_language`
Sentiment *comprehend.DetectSentimentOutput `json:"sentiment"`
PII *comprehend.DetectPiiEntitiesOutput `json:"pii"`
Languages *comprehend.DetectDominantLanguageOutput `json:"languages"`
Entities *comprehend.DetectEntitiesOutput `json:"entities"`
KeyPhrases *comprehend.DetectKeyPhrasesOutput `json:"key_phrases"`
Syntax *comprehend.DetectSyntaxOutput `json:"syntax"`
}
type Moderator ¶
type Moderator struct {
Client comprehendiface.ComprehendAPI
Translator *translate.Translate
Language *string
Messages chan string
}
func (*Moderator) GetEntities ¶
func (m *Moderator) GetEntities(text string) (*comprehend.DetectEntitiesOutput, error)
Detect Entities — Detect textual references to the names of people, places, and items as well as references to dates and quantities. PERSON | LOCATION | ORGANIZATION | COMMERCIAL_ITEM | EVENT | DATE | QUANTITY | TITLE | OTHER
func (*Moderator) GetKeyPhrases ¶
func (m *Moderator) GetKeyPhrases(text string) (*comprehend.DetectKeyPhrasesOutput, error)
Detect Key Phrases — Find key phrases such as "good morning" in a document or set of documents.
func (*Moderator) GetLanguages ¶
func (m *Moderator) GetLanguages(ctx context.Context, text string) (*comprehend.DetectDominantLanguageOutput, error)
Detect the Dominant Language — Examine text to determine the dominant language.
func (*Moderator) GetPII ¶
func (m *Moderator) GetPII(text string) (*comprehend.DetectPiiEntitiesOutput, error)
Detect Personally Identifiable Information (PII) — Analyze documents to detect personal data that could be used to identify an individual, such as an address, bank account number, or phone number.
func (*Moderator) GetSentiment ¶
func (m *Moderator) GetSentiment(text string) (*comprehend.DetectSentimentOutput, error)
Determine Sentiment — Analyze documents and determine the dominant sentiment of the text.
func (*Moderator) GetSyntax ¶
func (m *Moderator) GetSyntax(text string) (*comprehend.DetectSyntaxOutput, error)
Analyze Syntax — Parse the words in your text and show the speech syntax for each word and enable you to understand the content of the document.