Which fields are used for embedding
#2
by
pjwang
- opened
Which fields are used for embedding. and Which model is used for embedding?
Hey, we used our mxbai-embed-v3 model. Embeddings were created with this format title + " " + text.
Hope it helps.
aamirshakir
changed discussion status to
closed
Thank you, the published embeddings are NOT normalized, while the API is doing it by default. You can find an example code below to reproduce the results. Please note that the embeddings from the API will be close to the one posted here in the dataset but not exactly the same due to some optimization and hardware for inference. I hope it helps.
from mixedbread_ai.client import MixedbreadAI
mxbai = MixedbreadAI(api_key="YOUR_API_KEY")
res = mxbai.embeddings(
model='mixedbread-ai/mxbai-embed-large-v1',
input=[
'British Arab Commercial Bank The British Arab Commercial Bank PLC (BACB) is an international wholesale bank incorporated in the United Kingdom that is authorised by the Prudential Regulation Authority (PRA) and regulated by the PRA and the Financial Conduct Authority (FCA). It was founded in 1972 as UBAF Limited, adopted its current name in 1996, and registered as a public limited company in 2009. The bank has clients trading in and out of developing markets in the Middle East and Africa.'
],
normalized=False,
encoding_format='float',
truncation_strategy='end'
)
print(res.data[0].embedding)
Output:
[ -0.055023193, -0.16418457, 0.30297852, -0.11273193, 0.71533203, 0.1529541, 0.012435913, 0.002527237, -0.057128906, -0.1104126, ...].
Thanks. That's right.