Documentation ¶
Overview ¶
Package naturallanguageclassifierv1 : Operations and models for the NaturalLanguageClassifierV1 service
Index ¶
- Constants
- type Classification
- type ClassificationCollection
- type ClassifiedClass
- type Classifier
- type ClassifierList
- type ClassifyCollectionOptions
- func (options *ClassifyCollectionOptions) SetClassifierID(classifierID string) *ClassifyCollectionOptions
- func (options *ClassifyCollectionOptions) SetCollection(collection []ClassifyInput) *ClassifyCollectionOptions
- func (options *ClassifyCollectionOptions) SetHeaders(param map[string]string) *ClassifyCollectionOptions
- type ClassifyInput
- type ClassifyOptions
- type CollectionItem
- type CreateClassifierOptions
- func (options *CreateClassifierOptions) SetHeaders(param map[string]string) *CreateClassifierOptions
- func (options *CreateClassifierOptions) SetTrainingData(trainingData io.ReadCloser) *CreateClassifierOptions
- func (options *CreateClassifierOptions) SetTrainingMetadata(trainingMetadata io.ReadCloser) *CreateClassifierOptions
- type DeleteClassifierOptions
- type GetClassifierOptions
- type ListClassifiersOptions
- type NaturalLanguageClassifierV1
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) Classify(classifyOptions *ClassifyOptions) (result *Classification, response *core.DetailedResponse, err error)
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) ClassifyCollection(classifyCollectionOptions *ClassifyCollectionOptions) (result *ClassificationCollection, response *core.DetailedResponse, err error)
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) CreateClassifier(createClassifierOptions *CreateClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) DeleteClassifier(deleteClassifierOptions *DeleteClassifierOptions) (response *core.DetailedResponse, err error)
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) DisableSSLVerification()
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) GetClassifier(getClassifierOptions *GetClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) ListClassifiers(listClassifiersOptions *ListClassifiersOptions) (result *ClassifierList, response *core.DetailedResponse, err error)
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewClassifyCollectionOptions(classifierID string, collection []ClassifyInput) *ClassifyCollectionOptions
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewClassifyInput(text string) (model *ClassifyInput, err error)
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewClassifyOptions(classifierID string, text string) *ClassifyOptions
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewCreateClassifierOptions(trainingMetadata io.ReadCloser, trainingData io.ReadCloser) *CreateClassifierOptions
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewDeleteClassifierOptions(classifierID string) *DeleteClassifierOptions
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewGetClassifierOptions(classifierID string) *GetClassifierOptions
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewListClassifiersOptions() *ListClassifiersOptions
- func (naturalLanguageClassifier *NaturalLanguageClassifierV1) SetServiceURL(url string) error
- type NaturalLanguageClassifierV1Options
Constants ¶
const ( Classifier_Status_Available = "Available" Classifier_Status_Failed = "Failed" Classifier_Status_NonExistent = "Non Existent" Classifier_Status_Training = "Training" )
Constants associated with the Classifier.Status property. The state of the classifier.
const DefaultServiceName = "natural_language_classifier"
DefaultServiceName is the default key used to find external configuration information.
const DefaultServiceURL = "https://api.us-south.natural-language-classifier.watson.cloud.ibm.com"
DefaultServiceURL is the default URL to make service requests to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Classification ¶
type Classification struct { // Unique identifier for this classifier. ClassifierID *string `json:"classifier_id,omitempty"` // Link to the classifier. URL *string `json:"url,omitempty"` // The submitted phrase. Text *string `json:"text,omitempty"` // The class with the highest confidence. TopClass *string `json:"top_class,omitempty"` // An array of up to ten class-confidence pairs sorted in descending order of confidence. Classes []ClassifiedClass `json:"classes,omitempty"` }
Classification : Response from the classifier for a phrase.
type ClassificationCollection ¶
type ClassificationCollection struct { // Unique identifier for this classifier. ClassifierID *string `json:"classifier_id,omitempty"` // Link to the classifier. URL *string `json:"url,omitempty"` // An array of classifier responses for each submitted phrase. Collection []CollectionItem `json:"collection,omitempty"` }
ClassificationCollection : Response from the classifier for multiple phrases.
type ClassifiedClass ¶
type ClassifiedClass struct { // A decimal percentage that represents the confidence that Watson has in this class. Higher values represent higher // confidences. Confidence *float64 `json:"confidence,omitempty"` // Class label. ClassName *string `json:"class_name,omitempty"` }
ClassifiedClass : Class and confidence.
type Classifier ¶
type Classifier struct { // User-supplied name for the classifier. Name *string `json:"name,omitempty"` // Link to the classifier. URL *string `json:"url" validate:"required"` // The state of the classifier. Status *string `json:"status,omitempty"` // Unique identifier for this classifier. ClassifierID *string `json:"classifier_id" validate:"required"` // Date and time (UTC) the classifier was created. Created *strfmt.DateTime `json:"created,omitempty"` // Additional detail about the status. StatusDescription *string `json:"status_description,omitempty"` // The language used for the classifier. Language *string `json:"language,omitempty"` }
Classifier : A classifier for natural language phrases.
type ClassifierList ¶
type ClassifierList struct { // The classifiers available to the user. Returns an empty array if no classifiers are available. Classifiers []Classifier `json:"classifiers" validate:"required"` }
ClassifierList : List of available classifiers.
type ClassifyCollectionOptions ¶
type ClassifyCollectionOptions struct { // Classifier ID to use. ClassifierID *string `json:"classifier_id" validate:"required"` // The submitted phrases. Collection []ClassifyInput `json:"collection" validate:"required"` // Allows users to set headers to be GDPR compliant Headers map[string]string }
ClassifyCollectionOptions : The ClassifyCollection options.
func (*ClassifyCollectionOptions) SetClassifierID ¶
func (options *ClassifyCollectionOptions) SetClassifierID(classifierID string) *ClassifyCollectionOptions
SetClassifierID : Allow user to set ClassifierID
func (*ClassifyCollectionOptions) SetCollection ¶
func (options *ClassifyCollectionOptions) SetCollection(collection []ClassifyInput) *ClassifyCollectionOptions
SetCollection : Allow user to set Collection
func (*ClassifyCollectionOptions) SetHeaders ¶
func (options *ClassifyCollectionOptions) SetHeaders(param map[string]string) *ClassifyCollectionOptions
SetHeaders : Allow user to set Headers
type ClassifyInput ¶
type ClassifyInput struct { // The submitted phrase. The maximum length is 2048 characters. Text *string `json:"text" validate:"required"` }
ClassifyInput : Request payload to classify.
type ClassifyOptions ¶
type ClassifyOptions struct { // Classifier ID to use. ClassifierID *string `json:"classifier_id" validate:"required"` // The submitted phrase. The maximum length is 2048 characters. Text *string `json:"text" validate:"required"` // Allows users to set headers to be GDPR compliant Headers map[string]string }
ClassifyOptions : The Classify options.
func (*ClassifyOptions) SetClassifierID ¶
func (options *ClassifyOptions) SetClassifierID(classifierID string) *ClassifyOptions
SetClassifierID : Allow user to set ClassifierID
func (*ClassifyOptions) SetHeaders ¶
func (options *ClassifyOptions) SetHeaders(param map[string]string) *ClassifyOptions
SetHeaders : Allow user to set Headers
func (*ClassifyOptions) SetText ¶
func (options *ClassifyOptions) SetText(text string) *ClassifyOptions
SetText : Allow user to set Text
type CollectionItem ¶
type CollectionItem struct { // The submitted phrase. The maximum length is 2048 characters. Text *string `json:"text,omitempty"` // The class with the highest confidence. TopClass *string `json:"top_class,omitempty"` // An array of up to ten class-confidence pairs sorted in descending order of confidence. Classes []ClassifiedClass `json:"classes,omitempty"` }
CollectionItem : Response from the classifier for a phrase in a collection.
type CreateClassifierOptions ¶
type CreateClassifierOptions struct { // Metadata in JSON format. The metadata identifies the language of the data, and an optional name to identify the // classifier. Specify the language with the 2-letter primary language code as assigned in ISO standard 639. // // Supported languages are English (`en`), Arabic (`ar`), French (`fr`), German, (`de`), Italian (`it`), Japanese // (`ja`), Korean (`ko`), Brazilian Portuguese (`pt`), and Spanish (`es`). TrainingMetadata io.ReadCloser `json:"training_metadata" validate:"required"` // Training data in CSV format. Each text value must have at least one class. The data can include up to 3,000 classes // and 20,000 records. For details, see [Data // preparation](https://cloud.ibm.com/docs/natural-language-classifier?topic=natural-language-classifier-using-your-data). TrainingData io.ReadCloser `json:"training_data" validate:"required"` // Allows users to set headers to be GDPR compliant Headers map[string]string }
CreateClassifierOptions : The CreateClassifier options.
func (*CreateClassifierOptions) SetHeaders ¶
func (options *CreateClassifierOptions) SetHeaders(param map[string]string) *CreateClassifierOptions
SetHeaders : Allow user to set Headers
func (*CreateClassifierOptions) SetTrainingData ¶
func (options *CreateClassifierOptions) SetTrainingData(trainingData io.ReadCloser) *CreateClassifierOptions
SetTrainingData : Allow user to set TrainingData
func (*CreateClassifierOptions) SetTrainingMetadata ¶ added in v0.12.0
func (options *CreateClassifierOptions) SetTrainingMetadata(trainingMetadata io.ReadCloser) *CreateClassifierOptions
SetTrainingMetadata : Allow user to set TrainingMetadata
type DeleteClassifierOptions ¶
type DeleteClassifierOptions struct { // Classifier ID to delete. ClassifierID *string `json:"classifier_id" validate:"required"` // Allows users to set headers to be GDPR compliant Headers map[string]string }
DeleteClassifierOptions : The DeleteClassifier options.
func (*DeleteClassifierOptions) SetClassifierID ¶
func (options *DeleteClassifierOptions) SetClassifierID(classifierID string) *DeleteClassifierOptions
SetClassifierID : Allow user to set ClassifierID
func (*DeleteClassifierOptions) SetHeaders ¶
func (options *DeleteClassifierOptions) SetHeaders(param map[string]string) *DeleteClassifierOptions
SetHeaders : Allow user to set Headers
type GetClassifierOptions ¶
type GetClassifierOptions struct { // Classifier ID to query. ClassifierID *string `json:"classifier_id" validate:"required"` // Allows users to set headers to be GDPR compliant Headers map[string]string }
GetClassifierOptions : The GetClassifier options.
func (*GetClassifierOptions) SetClassifierID ¶
func (options *GetClassifierOptions) SetClassifierID(classifierID string) *GetClassifierOptions
SetClassifierID : Allow user to set ClassifierID
func (*GetClassifierOptions) SetHeaders ¶
func (options *GetClassifierOptions) SetHeaders(param map[string]string) *GetClassifierOptions
SetHeaders : Allow user to set Headers
type ListClassifiersOptions ¶
type ListClassifiersOptions struct { // Allows users to set headers to be GDPR compliant Headers map[string]string }
ListClassifiersOptions : The ListClassifiers options.
func (*ListClassifiersOptions) SetHeaders ¶
func (options *ListClassifiersOptions) SetHeaders(param map[string]string) *ListClassifiersOptions
SetHeaders : Allow user to set Headers
type NaturalLanguageClassifierV1 ¶
type NaturalLanguageClassifierV1 struct {
Service *core.BaseService
}
NaturalLanguageClassifierV1 : IBM Watson™ Natural Language Classifier uses machine learning algorithms to return the top matching predefined classes for short text input. You create and train a classifier to connect predefined classes to example texts so that the service can apply those classes to new inputs.
Version: 1.0 See: https://cloud.ibm.com/docs/natural-language-classifier/
func NewNaturalLanguageClassifierV1 ¶
func NewNaturalLanguageClassifierV1(options *NaturalLanguageClassifierV1Options) (service *NaturalLanguageClassifierV1, err error)
NewNaturalLanguageClassifierV1 : constructs an instance of NaturalLanguageClassifierV1 with passed in options.
func (*NaturalLanguageClassifierV1) Classify ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) Classify(classifyOptions *ClassifyOptions) (result *Classification, response *core.DetailedResponse, err error)
Classify : Classify a phrase Returns label information for the input. The status must be `Available` before you can use the classifier to classify text.
func (*NaturalLanguageClassifierV1) ClassifyCollection ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) ClassifyCollection(classifyCollectionOptions *ClassifyCollectionOptions) (result *ClassificationCollection, response *core.DetailedResponse, err error)
ClassifyCollection : Classify multiple phrases Returns label information for multiple phrases. The status must be `Available` before you can use the classifier to classify text.
Note that classifying Japanese texts is a beta feature.
func (*NaturalLanguageClassifierV1) CreateClassifier ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) CreateClassifier(createClassifierOptions *CreateClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
CreateClassifier : Create classifier Sends data to create and train a classifier and returns information about the new classifier.
func (*NaturalLanguageClassifierV1) DeleteClassifier ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) DeleteClassifier(deleteClassifierOptions *DeleteClassifierOptions) (response *core.DetailedResponse, err error)
DeleteClassifier : Delete classifier
func (*NaturalLanguageClassifierV1) DisableSSLVerification ¶ added in v1.0.0
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) DisableSSLVerification()
DisableSSLVerification bypasses verification of the server's SSL certificate
func (*NaturalLanguageClassifierV1) GetClassifier ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) GetClassifier(getClassifierOptions *GetClassifierOptions) (result *Classifier, response *core.DetailedResponse, err error)
GetClassifier : Get information about a classifier Returns status and other information about a classifier.
func (*NaturalLanguageClassifierV1) ListClassifiers ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) ListClassifiers(listClassifiersOptions *ListClassifiersOptions) (result *ClassifierList, response *core.DetailedResponse, err error)
ListClassifiers : List classifiers Returns an empty array if no classifiers are available.
func (*NaturalLanguageClassifierV1) NewClassifyCollectionOptions ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewClassifyCollectionOptions(classifierID string, collection []ClassifyInput) *ClassifyCollectionOptions
NewClassifyCollectionOptions : Instantiate ClassifyCollectionOptions
func (*NaturalLanguageClassifierV1) NewClassifyInput ¶ added in v1.3.0
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewClassifyInput(text string) (model *ClassifyInput, err error)
NewClassifyInput : Instantiate ClassifyInput (Generic Model Constructor)
func (*NaturalLanguageClassifierV1) NewClassifyOptions ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewClassifyOptions(classifierID string, text string) *ClassifyOptions
NewClassifyOptions : Instantiate ClassifyOptions
func (*NaturalLanguageClassifierV1) NewCreateClassifierOptions ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewCreateClassifierOptions(trainingMetadata io.ReadCloser, trainingData io.ReadCloser) *CreateClassifierOptions
NewCreateClassifierOptions : Instantiate CreateClassifierOptions
func (*NaturalLanguageClassifierV1) NewDeleteClassifierOptions ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewDeleteClassifierOptions(classifierID string) *DeleteClassifierOptions
NewDeleteClassifierOptions : Instantiate DeleteClassifierOptions
func (*NaturalLanguageClassifierV1) NewGetClassifierOptions ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewGetClassifierOptions(classifierID string) *GetClassifierOptions
NewGetClassifierOptions : Instantiate GetClassifierOptions
func (*NaturalLanguageClassifierV1) NewListClassifiersOptions ¶
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewListClassifiersOptions() *ListClassifiersOptions
NewListClassifiersOptions : Instantiate ListClassifiersOptions
func (*NaturalLanguageClassifierV1) SetServiceURL ¶ added in v1.0.0
func (naturalLanguageClassifier *NaturalLanguageClassifierV1) SetServiceURL(url string) error
SetServiceURL sets the service URL
type NaturalLanguageClassifierV1Options ¶
type NaturalLanguageClassifierV1Options struct { ServiceName string URL string Authenticator core.Authenticator }
NaturalLanguageClassifierV1Options : Service options