luis

package
v0.124.4 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(httpClient *http.Client, httpRetries *httpx.RetryConfig, httpAccess *httpx.AccessConfig, classifier *flows.Classifier, endpoint, appID, key string) flows.ClassificationService

NewService creates a new classification service

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a basic LUIS client

func NewClient

func NewClient(httpClient *http.Client, httpRetries *httpx.RetryConfig, httpAccess *httpx.AccessConfig, endpoint, appID, key string) *Client

NewClient creates a new client

func (*Client) Predict

func (c *Client) Predict(q string) (*PredictResponse, *httpx.Trace, error)

Predict gets the published endpoint predictions for the given query

type ExtractedEntity

type ExtractedEntity struct {
	Entity     string          `json:"entity"`
	Type       string          `json:"type"`
	StartIndex int             `json:"startIndex"`
	EndIndex   int             `json:"endIndex"`
	Score      decimal.Decimal `json:"score"`
}

type ExtractedIntent

type ExtractedIntent struct {
	Intent string          `json:"intent"`
	Score  decimal.Decimal `json:"score"`
}

type PredictResponse

type PredictResponse struct {
	Query             string             `json:"query"`
	TopScoringIntent  *ExtractedIntent   `json:"topScoringIntent"`
	Intents           []ExtractedIntent  `json:"intents" validate:"required"`
	Entities          []ExtractedEntity  `json:"entities"`
	SentimentAnalysis *SentimentAnalysis `json:"sentimentAnalysis"`
}

PredictResponse is the response from a predict request

type SentimentAnalysis

type SentimentAnalysis struct {
	Label string          `json:"label"`
	Score decimal.Decimal `json:"score"`
}

Jump to

Keyboard shortcuts

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