Stay organized with collections
Save and categorize content based on your preferences.
TextClassificationSessionFactory
interface TextClassificationSessionFactory
An interface for creating a session-aware TextClassifier.
Summary
Public methods |
abstract TextClassifier |
Creates and returns a session-aware TextClassifier.
|
Public methods
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TextClassificationSessionFactory\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nTextClassificationSessionFactory\n================================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/textclassifier/TextClassificationSessionFactory \"View this page in Java\") \n\n```\ninterface TextClassificationSessionFactory\n```\n\n|-------------------------------------------------------------------|\n| [android.view.textclassifier.TextClassificationSessionFactory](#) |\n\nAn interface for creating a session-aware TextClassifier.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [TextClassifier](/reference/kotlin/android/view/textclassifier/TextClassifier) | [createTextClassificationSession](#createTextClassificationSession(android.view.textclassifier.TextClassificationContext))`(`classificationContext:` `[TextClassificationContext](/reference/kotlin/android/view/textclassifier/TextClassificationContext)`)` Creates and returns a session-aware TextClassifier. |\n\nPublic methods\n--------------\n\n### createTextClassificationSession\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun createTextClassificationSession(classificationContext: TextClassificationContext): TextClassifier\n```\n\nCreates and returns a session-aware TextClassifier.\n\n| Parameters ||\n|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `classificationContext` | [TextClassificationContext](/reference/kotlin/android/view/textclassifier/TextClassificationContext): the classification context This value cannot be `null`. |\n\n| Return ||\n|--------------------------------------------------------------------------------|------------------------------|\n| [TextClassifier](/reference/kotlin/android/view/textclassifier/TextClassifier) | This value cannot be `null`. |"]]