Skip to content

Instantly share code, notes, and snippets.

View jobergum's full-sized avatar
👋

Jo Kristian Bergum jobergum

👋
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jobergum
jobergum / explore.ipynb
Last active January 31, 2020 12:58
Exploring the Kaggle Home Depot Product Relevance Competition Data https://www.kaggle.com/c/home-depot-product-search-relevance
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
bm25(attributes)
bm25(brand)
bm25(description)
bm25(queries)
bm25(title)
elementCompleteness(attributes).completeness
elementCompleteness(attributes).elementWeight
elementCompleteness(attributes).fieldCompleteness
elementCompleteness(attributes).queryCompleteness
elementCompleteness(queries).completeness
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def get_features_from_vespa(row):
id = row['product_uid']
query = row['search_term']
query_tensor = row['query_embedding']
query_body = {
'hits': 1,
'ranking.profile': 'dump',
'rankfeatures': 'true',
'type': 'any',
'recall': '+id:%i' % id,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jobergum
jobergum / gist:e55a0e9b4d4b2dc19d0373301706ead6
Created March 13, 2020 12:27
Elastic versus Vespa for NN search
Elastic NNS
Starting clients...
[dummydate]: PROGRESS: vespa-fbench: Seconds left 180
[dummydate]: PROGRESS: vespa-fbench: Seconds left 120
[dummydate]: PROGRESS: vespa-fbench: Seconds left 60
Stopping clients
Clients stopped.
.
Clients Joined.
*** HTTP keep-alive statistics ***
sudo sh bin/do-benchmark.sh
Elastic NNS
Starting clients...
[dummydate]: PROGRESS: vespa-fbench: Seconds left 180
[dummydate]: PROGRESS: vespa-fbench: Seconds left 120
[dummydate]: PROGRESS: vespa-fbench: Seconds left 60
Stopping clients
Clients stopped.
.
Clients Joined.
-bash-4.2$ sudo sh bin/do-benchmark.sh
Touch YubiKey:
Elastic NNS
Starting clients...
[dummydate]: PROGRESS: vespa-fbench: Seconds left 180
[dummydate]: PROGRESS: vespa-fbench: Seconds left 120
[dummydate]: PROGRESS: vespa-fbench: Seconds left 60
Stopping clients
Clients stopped.
.