raphaelsty / cherche

Neural Search
MIT License
325 stars 14 forks source link

k param when creating sbert retriever not taken into account #18

Open fpservant opened 1 year ago

fpservant commented 1 year ago

Create a retriever based on a sentence bert, passing a value, eg. 10, to k param. It is not taken into account when calling the retriever (more values are returned)

    retriever = retrieve.Encoder(
        key='id',
        on=['content'],
        encoder=SentenceTransformer('sentence-transformers/all-MiniLM-L12-v2').encode,
        k = 10
    )
    retriever(documents=docs)

len(retriever(queries)[0]) > 10

fpservant commented 1 year ago

Hum, seems to be same kind of problem as https://github.com/raphaelsty/cherche/pull/16/commits/fe08cc8301ba2c62a251911883da55692727af29