Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding threshold to the Elasticsearch Query #26

Closed
dexception opened this issue Jul 18, 2022 · 2 comments
Closed

Adding threshold to the Elasticsearch Query #26

dexception opened this issue Jul 18, 2022 · 2 comments
Labels

Comments

@dexception
Copy link

Hi,

I am little confused about how the l2norm function is executing for face recognition as we haven't given our less than threshold in the query. Can you please explain where it is being done ?

query = {
    "size": 5,
    "query": {
    "script_score": {
        "query": {
            "match_all": {}
        },
        "script": {
            #"source": "cosineSimilarity(params.queryVector, 'title_vector') + 1.0",
            "source": "1 / (1 + l2norm(params.queryVector, 'title_vector'))", #euclidean distance
            "params": {
                "queryVector": list(target_embedding)
            }
        }
    }
}}
@serengil
Copy link
Owner

it just retrieves the most 5 shortest distance vectors. no thresholds used.

@dexception
Copy link
Author

Thanks bro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants