naturallanguageclassifierv1

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Overview

Package naturallanguageclassifierv1 : Operations and models for the NaturalLanguageClassifierV1 service

Index

Constants

View Source
const (
	Classifier_Status_Available   = "Available"
	Classifier_Status_Failed      = "Failed"
	Classifier_Status_NonExistent = "Non Existent"
	Classifier_Status_Training    = "Training"
	Classifier_Status_Unavailable = "Unavailable"
)

Constants associated with the Classifier.Status property. The state of the classifier.

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`).
	Metadata *os.File `json:"training_metadata" validate:"required"`

	// The filename for trainingMetadata.
	MetadataFilename *string `json:"metadata_filename,omitempty"`

	// 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://console.bluemix.net/docs/services/natural-language-classifier/using-your-data.html).
	TrainingData *os.File `json:"training_data" validate:"required"`

	// The filename for trainingData.
	TrainingDataFilename *string `json:"training_data_filename,omitempty"`

	// 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) SetMetadata

func (options *CreateClassifierOptions) SetMetadata(metadata *os.File) *CreateClassifierOptions

SetMetadata : Allow user to set Metadata

func (*CreateClassifierOptions) SetMetadataFilename

func (options *CreateClassifierOptions) SetMetadataFilename(metadataFilename string) *CreateClassifierOptions

SetMetadataFilename : Allow user to set MetadataFilename

func (*CreateClassifierOptions) SetTrainingData

func (options *CreateClassifierOptions) SetTrainingData(trainingData *os.File) *CreateClassifierOptions

SetTrainingData : Allow user to set TrainingData

func (*CreateClassifierOptions) SetTrainingDataFilename

func (options *CreateClassifierOptions) SetTrainingDataFilename(trainingDataFilename string) *CreateClassifierOptions

SetTrainingDataFilename : Allow user to set TrainingDataFilename

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.WatsonService
}

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: V1 See: http://www.ibm.com/watson/developercloud/natural-language-classifier.html

func NewNaturalLanguageClassifierV1

func NewNaturalLanguageClassifierV1(options *NaturalLanguageClassifierV1Options) (*NaturalLanguageClassifierV1, error)

NewNaturalLanguageClassifierV1 : Instantiate NaturalLanguageClassifierV1

func (*NaturalLanguageClassifierV1) Classify

func (naturalLanguageClassifier *NaturalLanguageClassifierV1) Classify(classifyOptions *ClassifyOptions) (*core.DetailedResponse, 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) (*core.DetailedResponse, 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) (*core.DetailedResponse, 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) (*core.DetailedResponse, error)

DeleteClassifier : Delete classifier

func (*NaturalLanguageClassifierV1) GetClassifier

func (naturalLanguageClassifier *NaturalLanguageClassifierV1) GetClassifier(getClassifierOptions *GetClassifierOptions) (*core.DetailedResponse, error)

GetClassifier : Get information about a classifier Returns status and other information about a classifier.

func (*NaturalLanguageClassifierV1) GetClassifyCollectionResult

func (naturalLanguageClassifier *NaturalLanguageClassifierV1) GetClassifyCollectionResult(response *core.DetailedResponse) *ClassificationCollection

GetClassifyCollectionResult : Retrieve result of ClassifyCollection operation

func (*NaturalLanguageClassifierV1) GetClassifyResult

func (naturalLanguageClassifier *NaturalLanguageClassifierV1) GetClassifyResult(response *core.DetailedResponse) *Classification

GetClassifyResult : Retrieve result of Classify operation

func (*NaturalLanguageClassifierV1) GetCreateClassifierResult

func (naturalLanguageClassifier *NaturalLanguageClassifierV1) GetCreateClassifierResult(response *core.DetailedResponse) *Classifier

GetCreateClassifierResult : Retrieve result of CreateClassifier operation

func (*NaturalLanguageClassifierV1) GetGetClassifierResult

func (naturalLanguageClassifier *NaturalLanguageClassifierV1) GetGetClassifierResult(response *core.DetailedResponse) *Classifier

GetGetClassifierResult : Retrieve result of GetClassifier operation

func (*NaturalLanguageClassifierV1) GetListClassifiersResult

func (naturalLanguageClassifier *NaturalLanguageClassifierV1) GetListClassifiersResult(response *core.DetailedResponse) *ClassifierList

GetListClassifiersResult : Retrieve result of ListClassifiers operation

func (*NaturalLanguageClassifierV1) ListClassifiers

func (naturalLanguageClassifier *NaturalLanguageClassifierV1) ListClassifiers(listClassifiersOptions *ListClassifiersOptions) (*core.DetailedResponse, 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) NewClassifyOptions

func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewClassifyOptions(classifierID string, text string) *ClassifyOptions

NewClassifyOptions : Instantiate ClassifyOptions

func (*NaturalLanguageClassifierV1) NewCreateClassifierOptions

func (naturalLanguageClassifier *NaturalLanguageClassifierV1) NewCreateClassifierOptions(metadata *os.File, trainingData *os.File) *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

type NaturalLanguageClassifierV1Options

type NaturalLanguageClassifierV1Options struct {
	URL            string
	Username       string
	Password       string
	IAMApiKey      string
	IAMAccessToken string
	IAMURL         string
}

NaturalLanguageClassifierV1Options : Service options

Jump to

Keyboard shortcuts

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