This class is deprecated.
The standalone ML Kit SDK replaces this API. For more information, refer to the migration guide.
Entry class for Firebase machine learning natural language services.
To use this class, get an instance via getInstance()
or getInstance(FirebaseApp)
, and then get an instance of a detector. The code below is an example of getting an instance of smart reply:
FirebaseSmartReply smartReply = FirebaseNaturalLanguage.getInstance().getSmartReply(); Task task = smartReply.suggestReplies("How are you?");
Public Method Summary
static FirebaseNaturalLanguage | getInstance() Gets an instance of FirebaseNaturalLanguage associated with the default FirebaseApp . |
static FirebaseNaturalLanguage | getInstance(FirebaseApp app) Gets an instance of FirebaseNaturalLanguage associated with the supplied FirebaseApp . |
FirebaseLanguageIdentification | getLanguageIdentification() Gets an instance of FirebaseLanguageIdentification , which identifies the language for a given text input. |
FirebaseLanguageIdentification | getLanguageIdentification(FirebaseLanguageIdentificationOptions options) Gets an instance of FirebaseLanguageIdentification , which identifies the language for a given text input, with the given options . |
FirebaseSmartReply | getSmartReply() Gets a FirebaseSmartReply that suggests replies for a given text input. |
FirebaseTranslator | getTranslator(FirebaseTranslatorOptions options) Gets an instance of FirebaseTranslator that can translate from the source language specified in options to the target language specified in options . |
Inherited Method Summary
Public Methods
public static FirebaseNaturalLanguage getInstance ()
Gets an instance of FirebaseNaturalLanguage
associated with the default FirebaseApp
.
public static FirebaseNaturalLanguage getInstance (FirebaseApp app)
Gets an instance of FirebaseNaturalLanguage
associated with the supplied FirebaseApp
.
Parameters
app | the FirebaseApp to associate this FirebaseNaturalLanguage with. |
---|
public FirebaseLanguageIdentification getLanguageIdentification ()
Gets an instance of FirebaseLanguageIdentification
, which identifies the language for a given text input.
public FirebaseLanguageIdentification getLanguageIdentification (FirebaseLanguageIdentificationOptions options)
Gets an instance of FirebaseLanguageIdentification
, which identifies the language for a given text input, with the given options
.
public FirebaseSmartReply getSmartReply ()
Gets a FirebaseSmartReply
that suggests replies for a given text input.
Returns
- an instance of
FirebaseSmartReply
associated with the defaultFirebaseApp
. Note that multiple calls of this API always return the same instance and under the sameFirebaseNaturalLanguage
.
public FirebaseTranslator getTranslator (FirebaseTranslatorOptions options)
Gets an instance of FirebaseTranslator
that can translate from the source language specified in options
to the target language specified in options
.