Skip to contents

write_vectors_to_feather_file lets you write vector data to a feather file

Usage

write_vectors_to_feather_file(vector_data, file_name)

Arguments

vector_data

vector data (embeddings) already generated by another function.

file_name

a file name to save the embeddings into a feather file

Value

nothing.

Details

This function provides a simple way to save vector data (embeddings) to a binary feather file, instead of using regular databases.

Examples

conn <- get_ollama_connection()

document <- "Standing proudly on the Île de la Cité in the heart of Paris, 
France's capital city, lies one of the world's most beloved and historic 
landmarks: the magnificent Notre Dame Cathedral. This Gothic masterpiece 
has been welcoming pilgrims and tourists alike for over 850 years, since its 
construction began in 1163 under King Louis VII. With its towering spires, 
stunning stained glass windows, and intricate stone carvings, this beautiful 
church is a testament to medieval architecture and engineering skill. 
Unfortunately, a devastating fire ravaged the cathedral on April 15, 2019, 
but thanks to swift action from firefighters and restoration efforts 
underway, Notre Dame continues to inspire awe in those who visit her."

writeLines(document, con = "doc1.txt")

write_vectors_to_feather_file(file_name = "doc1.feather",
vector_data = generate_document_embeddings(conn, 
document_path = "doc1.txt",
splitter = "paragraph"))