Skip to content

it return same vectors of "苹果" and "钢笔" #382

Description

@damon-x

I use nomic-embed-text:v1.5 in ollama ,I found that using the nomic-embed-text:v1.5 vector model, the word embeddings for '苹果' and '钢笔' turned out to be exactly the same.
'苹果' means apple in chinese
'钢笔' means pen in chinese
Embeddings for 'apple' and 'pen' are not same

the code is

def getEmbed(data):
    url = "http://127.0.0.1:11434/api/embed"
    rdata = {
       "model": "nomic-embed-text:v1.5",
       "input": data
    }
    payload = json.dumps(rdata)
    headers = {
       'Content-Type': 'application/json'
    }
    response = requests.request("POST", url, headers=headers, data=payload)
    resObj = json.loads(response.text)
    # print(resObj)
    return resObj['embeddings']


vecs = getEmbed(["苹果","钢笔"])
vec1 = vecs[0]
vec2 = vecs[1]
for i in range(0,len(vec1)):
    print(vec1[i] , vec2[i])
Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions