TextEmbed is a high-throughput, low-latency REST API designed for serving vector embeddings. It supports a wide range of sentence-transformer models and frameworks, making it suitable for various applications in natural language processing.
# Define a list of documentsdocuments = [ "Data science involves extracting insights from data.", "Artificial intelligence is transforming various industries.", "Cloud computing provides scalable computing resources over the internet.", "Big data analytics helps in understanding large datasets.", "India has a diverse cultural heritage.",]# Define a queryquery = "What is the cultural heritage of India?"
Copy
Ask AI
# Embed all documentsdocument_embeddings = embeddings.embed_documents(documents)# Embed the queryquery_embedding = embeddings.embed_query(query)
{'Data science involves extracting insights from data.': 0.05121298956322118, 'Artificial intelligence is transforming various industries.': -0.0060612142358469345, 'Cloud computing provides scalable computing resources over the internet.': -0.04877402795301714, 'Big data analytics helps in understanding large datasets.': 0.016582168576929422, 'India has a diverse cultural heritage.': 0.7408992963028144}
Assistant
Responses are generated using AI and may contain mistakes.