hf_ez_translation | R Documentation |
This task is well known to translate text from one language to another
hf_ez_translation(model_id = "Helsinki-NLP/opus-mt-en-es", use_api = FALSE)
model_id |
A model_id. Run hf_search_models(...) for model_ids. Defaults to 'Helsinki-NLP/opus-mt-en-es'. |
use_api |
Whether to use the Inference API to run the model (TRUE) or download and run the model locally (FALSE). Defaults to FALSE |
A translation object
https://huggingface.co/docs/api-inference/detailed_parameters#translation-task
## Not run: # Load the default translation model ez <- hf_ez_translation() # Translate from English to Spanish. ez$infer(string = "My name is Sarah and I live in London") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.