embedding

Having one vector column for multiple text columns on Qdrant

Having one vector column for multiple text columns on Qdrant Question: I have a products table that has a lot of columns, which from these, the following ones are important for our search: Title 1 to Title 6 (title in 6 different languages) Brand name (in 6 different languages) Category name (in 6 different languages) …

Total answers: 2

AttributeError: module 'openai' has no attribute 'Embedding'

AttributeError: module 'openai' has no attribute 'Embedding' Question: According to OpenAi’s documentation and a large number of demonstrations I found online, the following code should run without a problem in Python: import openai response = openai.Embedding.create( input="porcine pals say", model="text-embedding-ada-002" ) However, when I run this code on my local Jupyter instance, I receive the …

Total answers: 1

Scatterplot with hollow and filled points with matplotlib

Scatterplot with hollow and filled points with matplotlib Question: I would like to reproduce the scatterplot below. Here is the code I have so far, but I cannot seem to get the points similar to the seed terms to be the same color as the filled points (seed terms). Any help is appreciated. Also, I …

Total answers: 2

Calculating embedding overload problems with BERT

Calculating embedding overload problems with BERT Question: I’m trying to calculate the embedding of a sentence using BERT. After I input the sentence into BERT, I calculate the Mean-pooling, which is used as the embedding of the sentence. Problem My code can calculate the embedding of sentences, but the computational cost is very high. I …

Total answers: 2

Calculate Distance Metric between Homomorphic Encrypted Vectors

Calculate Distance Metric between Homomorphic Encrypted Vectors Question: Is there a way to calculate a distance metric (euclidean or cosine similarity or manhattan) between two homomorphically encrypted vectors? Specifically, I’m looking to generate embeddings of documents (using a transformer), homomorphically encrypting those embeddings, and wanting to calculate a distance metric between embeddings to obtain document …

Total answers: 1

How to save/load a model checkpoint with several losses in Pytorch?

How to save/load a model checkpoint with several losses in Pytorch? Question: Using Ubuntu 20.04, Pytorch 1.10.1. I am trying to solve a music generation task with a transformer architecture and multi-embeddings, for processing tokens with several characteristics. In each training iteration, I have to calculate the loss of each token characteristic and store it …

Total answers: 2

Dimensions between embedding layer and lstm encoder layer don't match

Dimensions between embedding layer and lstm encoder layer don't match Question: I am trying to build an encoder-decoder model for text generation. I am using LSTM layers with an embedding layer. I have somehow a problem with the output of the embedding layer to the LSTM encoder layer. The error I get is: ValueError: Input …

Total answers: 1

How do I implement Poincaré Embeddings using tfa.layers.PoincareNormalize?

How do I implement Poincaré Embeddings using tfa.layers.PoincareNormalize? Question: I am trying to implement PoincarĂ© embeddings as discussed in a paper by Facebook (Link) for my hierarchical data. You may find a more accessible explanation of PoincarĂ© embeddings here. Based on the paper I have found some implementations for Tensorflow here and here as well …

Total answers: 1

How to embed Sequence of Sentences in RNN?

How to embed Sequence of Sentences in RNN? Question: I am trying to make a RNN model (in Pytorch), that takes couple of sentences and then classifies it to be either Class 0 or Class 1. For the sake of this question let’s assume that the max_len of the sentence is 4 and max_amount of …

Total answers: 1

PyTorch / Gensim – How do I load pre-trained word embeddings?

PyTorch / Gensim – How do I load pre-trained word embeddings? Question: I want to load a pre-trained word2vec embedding with gensim into a PyTorch embedding layer. How do I get the embedding weights loaded by gensim into the PyTorch embedding layer? Asked By: MBT || Source Answers: I think it is easy. Just copy …

Total answers: 6