MLKitEntityExtraction Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
Functions
The following functions are available globally.
-
Returns a set that contains EntityType
codes of all entity types supported
by the entity extraction API.
Declaration
Swift
static
func
allEntityTypes
()
->
Set
<
EntityType
>
-
-
Declaration
Swift
func
toLanguageTag
()
->
String
-
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003eThe Entity Extraction API provides functions to access supported entity types and model identifiers.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can retrieve a set of all supported entity types using \u003ccode\u003eallEntityTypes()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eallModelIdentifiers()\u003c/code\u003e returns a set of all supported model identifiers for the API.\u003c/p\u003e\n"],["\u003cp\u003eFunctions are available to convert between model identifiers and BCP 47 language tags.\u003c/p\u003e\n"]]],["The Entity Extraction API offers globally available functions. `allEntityTypes()` returns a set of all supported entity types. `allModelIdentifiers()` returns a set of all model identifiers. `toLanguageTag()` provides the BCP 47 language tag for a given model identifier. `fromLanguageTag(_:)` returns the model identifier for a BCP 47 language tag, or `nil` if invalid or unsupported. These functions enable checking supported entities, accessing identifiers, and managing language tags.\n"],null,["# MLKitEntityExtraction Framework Reference\n\nFunctions\n=========\n\nThe following functions are available globally.\n- `\n ``\n ``\n `\n\n ### [allEntityTypes()](#/c:@F@MLKEntityExtractionEntityTypeAllEntityTypes)\n\n `\n ` \n Returns a set that contains [EntityType](/ml-kit/reference/swift/mlkitentityextraction/api/reference/Type-Definitions#/c:MLKEntity.h@T@MLKEntityExtractionEntityType) codes of all entity types supported\n by the entity extraction API. \n\n #### Declaration\n\n Swift \n\n static func allEntityTypes() -\u003e Set\u003c/ml-kit/reference/swift/mlkitentityextraction/api/reference/Type-Definitions#/c:MLKEntity.h@T@MLKEntityExtractionEntityType\u003e\n\n- `\n ``\n ``\n `\n\n ### [allModelIdentifiers()](#/c:@F@MLKEntityExtractionAllModelIdentifiers)\n\n `\n ` \n Returns a set that contains [EntityExtractionModelIdentifier](/ml-kit/reference/swift/mlkitentityextraction/api/reference/Type-Definitions#/c:MLKEntityExtractionModelIdentifier.h@T@MLKEntityExtractionModelIdentifier) values of all model identifiers\n supported by the Entity Extraction API. \n\n #### Declaration\n\n Swift \n\n static func allModelIdentifiers() -\u003e Set\u003c/ml-kit/reference/swift/mlkitentityextraction/api/reference/Type-Definitions#/c:MLKEntityExtractionModelIdentifier.h@T@MLKEntityExtractionModelIdentifier\u003e\n\n- `\n ``\n ``\n `\n\n ### [toLanguageTag()](#/c:@F@MLKEntityExtractionLanguageTagForModelIdentifier)\n\n `\n ` \n Returns the [BCP 47 language tag](https://tools.ietf.org/rfc/bcp/bcp47.txt) for this\n [EntityExtractionModelIdentifier](/ml-kit/reference/swift/mlkitentityextraction/api/reference/Type-Definitions#/c:MLKEntityExtractionModelIdentifier.h@T@MLKEntityExtractionModelIdentifier). \n\n #### Declaration\n\n Swift \n\n func toLanguageTag() -\u003e String\n\n- `\n ``\n ``\n `\n\n ### [fromLanguageTag(_:)](#/c:@F@MLKEntityExtractionModelIdentifierForLanguageTag)\n\n `\n ` \n Returns the [EntityExtractionModelIdentifier](/ml-kit/reference/swift/mlkitentityextraction/api/reference/Type-Definitions#/c:MLKEntityExtractionModelIdentifier.h@T@MLKEntityExtractionModelIdentifier) for a given [BCP 47 language\n tag](https://tools.ietf.org/rfc/bcp/bcp47.txt), or `nil` if the language tag is invalid or not\n supported by the Entity Extraction API. \n\n #### Declaration\n\n Swift \n\n static func fromLanguageTag(_ languageTag: String) -\u003e /ml-kit/reference/swift/mlkitentityextraction/api/reference/Type-Definitions#/c:MLKEntityExtractionModelIdentifier.h@T@MLKEntityExtractionModelIdentifier?"]]