Back to Postgresml

Translation

pgml-cms/docs/open-source/pgml/guides/llms/translation.md

2.10.0534 B
Original Source

Translation

Translation is the task of converting text written in one language into another language. You have the option to select from over 2000 models available on the Hugging Face hub for translation.

postgresql
select pgml.transform(
    inputs => array[
        'How are you?'
    ],
	task => '{
        "task": "translation", 
        "model": "google-t5/t5-base"
    }'::JSONB	
);

Result

json
[
    {"translation_text": "Comment allez-vous ?"}
]