Corpus

public struct Corpus : Codable, Equatable

Information about a corpus from a custom language model.

  • The status of the corpus:

    • analyzed: The service successfully analyzed the corpus. The custom model can be trained with data from the corpus.
    • being_processed: The service is still analyzing the corpus. The service cannot accept requests to add new resources or to train the custom model.
    • undetermined: The service encountered an error while processing the corpus. The error field describes the failure.
    See more

    Declaration

    Swift

    public enum Status : String
  • The name of the corpus.

    Declaration

    Swift

    public var name: String
  • The total number of words in the corpus. The value is 0 while the corpus is being processed.

    Declaration

    Swift

    public var totalWords: Int
  • For custom models that are based on previous-generation models, the number of OOV words extracted from the corpus. The value is 0 while the corpus is being processed. For custom models that are based on next-generation models, no OOV words are extracted from corpora, so the value is always 0.

    Declaration

    Swift

    public var outOfVocabularyWords: Int
  • The status of the corpus:

    • analyzed: The service successfully analyzed the corpus. The custom model can be trained with data from the corpus.
    • being_processed: The service is still analyzing the corpus. The service cannot accept requests to add new resources or to train the custom model.
    • undetermined: The service encountered an error while processing the corpus. The error field describes the failure.

    Declaration

    Swift

    public var status: String
  • If the status of the corpus is undetermined, the following message: Analysis of corpus 'name' failed. Please try adding the corpus again by setting the 'allow_overwrite' flag to 'true'.

    Declaration

    Swift

    public var error: String?