Skip to content

Instantly share code, notes, and snippets.

@thigm85
Created July 15, 2022 15:26
Show Gist options
  • Save thigm85/ec3171ed3be63f272b760d2406627b5e to your computer and use it in GitHub Desktop.
Save thigm85/ec3171ed3be63f272b760d2406627b5e to your computer and use it in GitHub Desktop.
def compute_vespa_relevance(id_value, query_value):
hits = app.query(
body={
"yql": "select * from sources * where id = {}".format(str(id_value)),
"ranking": "classify",
"ranking.features.query(value)": features.loc[id_value, "query(value)"],
"hits": 1
}
).hits
return hits[0]["relevance"]
compute_vespa_relevance(id_value=0, query_value = 0.655225)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment