ONNXEmbeddings Example: OutputFormat VARCHAR (30000) - Teradata Vantage

Teradata Vantageā„¢ - Bring Your Own Model User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Vantage
Release Number
6.0
Published
March 2025
ft:locale
en-US
ft:lastEdition
2025-03-21
dita:mapPath
fee1607120608274.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
fee1607120608274
select
    *
from mldb.ONNXEmbeddings(
    on (SELECT CAST(rev_id AS VARCHAR(21)) AS rev_id, rev_text AS txt FROM amazon_reviews_25)
    on (select model_id, model from onnx_models where model_id = 'bge-small-en-v1.5') DIMENSION
    on (select tokenizer from embeddings_tokenizers where model_id = 'bge-small-en-v1.5') DIMENSION
USING
    Accumulate('rev_id')
    ModelOutputTensor('sentence_embedding')
    OutputFormat('VARCHAR(30000)')
) a
;
 
 *** Query completed. 25 rows found. 2 columns returned.
 *** Total elapsed time was 1 second.
The following example is a snippet of the total output:
rev_id	sentence_embedding
-----------------------------------------------------------------------------------------------------------------------------
A3V1MKC2BVWY48	0.010341135	0.039603148	0.02032054	0.017130554	7.526378E-4	-0.0029828206	0.08408154	-0.06986211	0.0011597961	-0.067057185	-0.042081792	0.0044557634 0.051
A26GKZPS079GFF	-0.033367846	0.013266026	0.039863694	0.03130837	-0.0101601565	0.0021604085	0.035781875	-0.0029493966	0.038836565	-0.02592681	0.020648086	-0.010395628 0.0
AUTNO7VDY4H4A	-0.011844048	0.022235172	-0.005435251	0.023775024	-0.011273234	-0.0017255824	0.017376512	0.020886978	-0.011113251	-0.07543064	0.010284837	0.052515816 -0.
A2S166WSCFIFP5	0.002855719	-0.014396132	-0.016711127	-0.008662777	-0.010505226	0.05228832	0.036535893	-0.0014042043	0.048945963 	-0.037907925	-0.007915686	-0.014041564 0
A5E9TSD20U9PR	-0.025540393	0.042433415	0.0038648746	0.024865156	0.008279116	0.010526418	0.056619547	0.021985738	-0.025672358	-0.062182724	-0.05664199	0.03468444	0.0134
A27ZH1AQORJ1L	-0.0040720943	0.031230347	0.054846305	0.02475443	-0.025144236	-0.024486065	0.042867593	-0.014755931	-0.006141968	-0.022795495	-0.005213292	3.0384486E-4 0
....