Class NLContextualEmbedding

  • All Implemented Interfaces:
    NSObject

    public class NLContextualEmbedding
    extends NSObject
    NLContextualEmbedding is a class representing a model that computes sequences of embedding vectors for natural-language utterances. Predefined contextual embeddings are provided for certain languages/scripts.
    • Constructor Detail

      • NLContextualEmbedding

        protected NLContextualEmbedding​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static NLContextualEmbedding allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • contextualEmbeddingWithLanguage

        @Nullable
        public static @Nullable NLContextualEmbedding contextualEmbeddingWithLanguage​(@NotNull
                                                                                      @NotNull java.lang.String language)
        Convenience APIs for finding the most recent embedding suitable for handling the given language or script.
      • contextualEmbeddingWithModelIdentifier

        public static NLContextualEmbedding contextualEmbeddingWithModelIdentifier​(@NotNull
                                                                                   @NotNull java.lang.String modelIdentifier)
        Each embedding model has a string identifier that uniquely identifies it. When an embedding is used for training, keep track of the identifier. It should be used to locate the same embedding at inference time.
      • contextualEmbeddingWithScript

        @Nullable
        public static @Nullable NLContextualEmbedding contextualEmbeddingWithScript​(@NotNull
                                                                                    @NotNull java.lang.String script)
      • contextualEmbeddingsForValues

        @NotNull
        public static @NotNull NSArray<? extends NLContextualEmbedding> contextualEmbeddingsForValues​(@NotNull
                                                                                                      @NotNull NSDictionary<java.lang.String,​?> valuesDictionary)
        Search the catalog of available embeddings by languages, scripts, or revision numbers.
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • dimension

        public long dimension()
        The dimensionality of the embedding vectors generated by the model.
      • embeddingResultForStringLanguageError

        @Nullable
        public @Nullable NLContextualEmbeddingResult embeddingResultForStringLanguageError​(@NotNull
                                                                                           @NotNull java.lang.String string,
                                                                                           @Nullable
                                                                                           @Nullable java.lang.String language,
                                                                                           @Nullable
                                                                                           @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        This is the method for applying an embedding to a string and obtaining the resulting embedding vectors, encapsulated in an NLContextualEmbeddingResult object. If the language of the string is known, it may be specified here, otherwise it will be inferred from the string.
      • hasAvailableAssets

        public boolean hasAvailableAssets()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • languages

        @NotNull
        public @NotNull NSArray<java.lang.String> languages()
      • loadWithError

        public boolean loadWithError​(@Nullable
                                     @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        When an NLContextualEmbedding is created, the model is not loaded by default until it is needed. The load and unload methods can be used to control when the model is loaded. The return value of load indicates whether it succeeded. The load method will fail if the necessary assets for the specified model are not present on device, in which case hasAvailableAssets and requestEmbeddingAssetsWithCompletionHandler: can be used to manage the loading of the assets.
      • maximumSequenceLength

        public long maximumSequenceLength()
        The maximum number of embedding vectors in sequence which the model will generate.
      • modelIdentifier

        @NotNull
        public @NotNull java.lang.String modelIdentifier()
        Metadata associated with an embedding.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • revision

        public long revision()
      • scripts

        @NotNull
        public @NotNull NSArray<java.lang.String> scripts()
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • unload

        public void unload()
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.
      • version_static

        public static long version_static()