Documentation
¶
Index ¶
- func TopicDetectionStateMonitor(updateInterval time.Duration) chan<- State
- type MatchResult
- type Resource
- type State
- type TextAnalyzer
- func (ta *TextAnalyzer) DetectComponentKeyPhrases(components []types.Component) ([]*models.KeyPhraseBatchResultItemV2, error)
- func (ta *TextAnalyzer) DetectComponentTopics(components []types.Component) (string, error)
- func (ta *TextAnalyzer) DetectStandardKeyPhrases(standard types.NIST80053Standard) ([]*models.KeyPhraseBatchResultItemV2, error)
- func (ta *TextAnalyzer) PollTopicDetectionStatus() string
- func (ta *TextAnalyzer) TopicDetectionPoller(in <-chan *Resource, out chan<- *Resource, status chan<- State)
- type Validation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TopicDetectionStateMonitor ¶
TopicDetectionStateMonitor updates the state of a topic detection operation based on a given update interval
Types ¶
type MatchResult ¶
MatchResult holds the results of a actual vs expected key phrase matches
type Resource ¶
type Resource struct { OperationID string OperationProcessingResult models.OperationProcessingResult ErrCount int }
Resource contains information about an API operation
type State ¶
type State struct {
// contains filtered or unexported fields
}
State holds the state of a topic detection operation
type TextAnalyzer ¶
type TextAnalyzer struct { *textAnalyticsClient.TextAnalytics TextAnalyticsAPIKey string OperationResource *Resource ControlKeyMapping []map[string]string }
TextAnalyzer is used to make all API calls and embeds the generated API client type
func New ¶
func New(textAnalyticsAPIKey string) *TextAnalyzer
New generates a new TextAnalyzer with the Default text analytics client type
func (*TextAnalyzer) DetectComponentKeyPhrases ¶
func (ta *TextAnalyzer) DetectComponentKeyPhrases(components []types.Component) ([]*models.KeyPhraseBatchResultItemV2, error)
DetectComponentKeyPhrases submits all component narratives to the key phrases analysis API
func (*TextAnalyzer) DetectComponentTopics ¶
func (ta *TextAnalyzer) DetectComponentTopics(components []types.Component) (string, error)
DetectComponentTopics submits all component narratives to the topic detection API
func (*TextAnalyzer) DetectStandardKeyPhrases ¶
func (ta *TextAnalyzer) DetectStandardKeyPhrases(standard types.NIST80053Standard) ([]*models.KeyPhraseBatchResultItemV2, error)
DetectStandardKeyPhrases submits the NIST 800-53 standard to the key phrases analysis API
func (*TextAnalyzer) PollTopicDetectionStatus ¶
func (ta *TextAnalyzer) PollTopicDetectionStatus() string
PollTopicDetectionStatus polls the API for the status of a topic detection operation
func (*TextAnalyzer) TopicDetectionPoller ¶
func (ta *TextAnalyzer) TopicDetectionPoller(in <-chan *Resource, out chan<- *Resource, status chan<- State)
TopicDetectionPoller initiates operation polling jobs
type Validation ¶
type Validation struct { ComponentName string MatchResult map[string]MatchResult }
Validation is used to hold the result of a key phrase validation for a specific component
func ValidateKeyPhrases ¶
func ValidateKeyPhrases(components []types.Component, standard types.NIST80053Standard, componentKeyPhraseResults []*models.KeyPhraseBatchResultItemV2, standardKeyPhraseResults []*models.KeyPhraseBatchResultItemV2) []Validation
ValidateKeyPhrases iterates through the analyzed component key phrases and NIST 800-53 key phrases, checks for matching strings and returns a map of the match results
** This function needs to be cleaned up since the structure of the loop is confusing