embed_text {sentiment.ai}R Documentation

Create Text Embedding Matrix

Description

turns character vector into ⁠length(text) x 512⁠ embedding matrix. For power users. Requires init_sentiment.ai() to have been called!

Usage

embed_text(text, batch_size = NULL, model = NULL)

Arguments

text

character vector to be embedded. Note that longer comments take longer.

batch_size

integer - how many to embed at once. Higher numbers are faster but use more memory.

model

character - the embedding model to use (same as sentiment_score()).

Value

numeric matrix of ⁠length(text) x 512⁠. Original text is stored in the row names attribute.


[Package sentiment.ai version 0.1.1 Index]