struct OpenAI::Embedding

Overview

Embedding is a special format of data representation that can be easily utilized by machine learning models and algorithms. The embedding is an information dense representation of the semantic meaning of a piece of text. Each embedding is a vector of floating point numbers, such that the distance between two embeddings in the vector space is correlated with semantic similarity between two inputs in the original format. For example, if two texts are similar, then their vector representations should also be similar.

Included Modules

Extended Modules

Defined in:

openai/api/embeddings.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def embedding : Array(Float32) #

[View source]
def index : Int32 #

The index of the embedding in the list of embeddings.


[View source]
def object : String #

The object type, which is always "embedding".


[View source]