Skip to content

Commit

Permalink
feat(nlu): gen release changes and small edits
Browse files Browse the repository at this point in the history
  • Loading branch information
apaparazzi0329 committed May 12, 2021
2 parents 7301a2f + 11b63f1 commit 5abf627
Show file tree
Hide file tree
Showing 22 changed files with 2,321 additions and 35 deletions.
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2017, 2020.
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,6 +61,11 @@ public struct AnalysisResults: Codable, Equatable {
*/
public var categories: [CategoriesResult]?

/**
The classifications assigned to the analyzed text.
*/
public var classifications: [ClassificationsResult]?

/**
The anger, disgust, fear, joy, or sadness conveyed by the content.
*/
Expand Down Expand Up @@ -101,6 +106,7 @@ public struct AnalysisResults: Codable, Equatable {
case entities = "entities"
case keywords = "keywords"
case categories = "categories"
case classifications = "classifications"
case emotion = "emotion"
case metadata = "metadata"
case relations = "relations"
Expand Down
125 changes: 125 additions & 0 deletions Sources/NaturalLanguageUnderstandingV1/Models/CategoriesModel.swift
@@ -0,0 +1,125 @@
/**
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/

import Foundation
import IBMSwiftSDKCore

/**
Categories model.
*/
public struct CategoriesModel: Codable, Equatable {

/**
When the status is `available`, the model is ready to use.
*/
public enum Status: String {
case starting = "starting"
case training = "training"
case deploying = "deploying"
case available = "available"
case error = "error"
case deleted = "deleted"
}

/**
An optional name for the model.
*/
public var name: String?

/**
An optional map of metadata key-value pairs to store with this model.
*/
public var userMetadata: [String: JSON]?

/**
The 2-letter language code of this model.
*/
public var language: String

/**
An optional description of the model.
*/
public var description: String?

/**
An optional version string.
*/
public var modelVersion: String?

/**
Deprecated — use `model_version`.
*/
public var version: String?

/**
ID of the Watson Knowledge Studio workspace that deployed this model to Natural Language Understanding.
*/
public var workspaceID: String?

/**
The description of the version.
*/
public var versionDescription: String?

/**
The service features that are supported by the custom model.
*/
public var features: [String]?

/**
When the status is `available`, the model is ready to use.
*/
public var status: String

/**
Unique model ID.
*/
public var modelID: String

/**
dateTime indicating when the model was created.
*/
public var created: Date

/**
dateTime of last successful model training.
*/
public var lastTrained: Date?

/**
dateTime of last successful model deployment.
*/
public var lastDeployed: Date?

// Map each property name to the key that shall be used for encoding/decoding.
private enum CodingKeys: String, CodingKey {
case name = "name"
case userMetadata = "user_metadata"
case language = "language"
case description = "description"
case modelVersion = "model_version"
case version = "version"
case workspaceID = "workspace_id"
case versionDescription = "version_description"
case features = "features"
case status = "status"
case modelID = "model_id"
case created = "created"
case lastTrained = "last_trained"
case lastDeployed = "last_deployed"
}

}
@@ -0,0 +1,34 @@
/**
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/

import Foundation

/**
List of categories models.
*/
public struct CategoriesModelList: Codable, Equatable {

/**
The categories models.
*/
public var models: [CategoriesModel]?

// Map each property name to the key that shall be used for encoding/decoding.
private enum CodingKeys: String, CodingKey {
case models = "models"
}

}
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2017, 2020.
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,13 +34,9 @@ public struct CategoriesOptions: Codable, Equatable {
public var limit: Int?

/**
Enter a [custom
(Beta) Enter a [custom
model](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-customizing)
ID to override the standard categories model.
The custom categories experimental feature will be retired on 19 December 2019. On that date, deployed custom
categories models will no longer be accessible in Natural Language Understanding. The feature will be removed from
Knowledge Studio on an earlier date. Custom categories models will no longer be accessible in Knowledge Studio on
17 December 2019.
ID to override the standard categories model. **This is available only for English categories.**.
*/
public var model: String?

Expand All @@ -57,13 +53,9 @@ public struct CategoriesOptions: Codable, Equatable {
- parameter explanation: Set this to `true` to return explanations for each categorization. **This is available
only for English categories.**.
- parameter limit: Maximum number of categories to return.
- parameter model: Enter a [custom
- parameter model: (Beta) Enter a [custom
model](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-customizing)
ID to override the standard categories model.
The custom categories experimental feature will be retired on 19 December 2019. On that date, deployed custom
categories models will no longer be accessible in Natural Language Understanding. The feature will be removed
from Knowledge Studio on an earlier date. Custom categories models will no longer be accessible in Knowledge
Studio on 17 December 2019.
ID to override the standard categories model. **This is available only for English categories.**.
- returns: An initialized `CategoriesOptions`.
*/
Expand Down
@@ -0,0 +1,125 @@
/**
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/

import Foundation
import IBMSwiftSDKCore

/**
Classifications model.
*/
public struct ClassificationsModel: Codable, Equatable {

/**
When the status is `available`, the model is ready to use.
*/
public enum Status: String {
case starting = "starting"
case training = "training"
case deploying = "deploying"
case available = "available"
case error = "error"
case deleted = "deleted"
}

/**
An optional name for the model.
*/
public var name: String?

/**
An optional map of metadata key-value pairs to store with this model.
*/
public var userMetadata: [String: JSON]?

/**
The 2-letter language code of this model.
*/
public var language: String

/**
An optional description of the model.
*/
public var description: String?

/**
An optional version string.
*/
public var modelVersion: String?

/**
Deprecated — use `model_version`.
*/
public var version: String?

/**
ID of the Watson Knowledge Studio workspace that deployed this model to Natural Language Understanding.
*/
public var workspaceID: String?

/**
The description of the version.
*/
public var versionDescription: String?

/**
The service features that are supported by the custom model.
*/
public var features: [String]?

/**
When the status is `available`, the model is ready to use.
*/
public var status: String

/**
Unique model ID.
*/
public var modelID: String

/**
dateTime indicating when the model was created.
*/
public var created: Date

/**
dateTime of last successful model training.
*/
public var lastTrained: Date?

/**
dateTime of last successful model deployment.
*/
public var lastDeployed: Date?

// Map each property name to the key that shall be used for encoding/decoding.
private enum CodingKeys: String, CodingKey {
case name = "name"
case userMetadata = "user_metadata"
case language = "language"
case description = "description"
case modelVersion = "model_version"
case version = "version"
case workspaceID = "workspace_id"
case versionDescription = "version_description"
case features = "features"
case status = "status"
case modelID = "model_id"
case created = "created"
case lastTrained = "last_trained"
case lastDeployed = "last_deployed"
}

}
@@ -0,0 +1,34 @@
/**
* (C) Copyright IBM Corp. 2021.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/

import Foundation

/**
List of classifications models.
*/
public struct ClassificationsModelList: Codable, Equatable {

/**
The classifications models.
*/
public var models: [ClassificationsModel]?

// Map each property name to the key that shall be used for encoding/decoding.
private enum CodingKeys: String, CodingKey {
case models = "models"
}

}

0 comments on commit 5abf627

Please sign in to comment.