Skip to content

Commit

Permalink
Merge pull request #43 from sensein/enh/openhouse
Browse files Browse the repository at this point in the history
update search to include dataframe reordering
  • Loading branch information
alistairewj authored Apr 23, 2024
2 parents 9dc8419 + 44c42d3 commit ad9e296
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions docs/semantic-search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
},
"outputs": [],
"source": [
"search_string = 'symptoms of depression and anxiety'\n",
"search_string = 'terms related to smoking and respiration'\n",
"search_embedding = embed_sentences([search_string,])"
]
},
Expand Down Expand Up @@ -253,20 +253,38 @@
"sentences_sorted[sims > cutoff].tolist()"
]
},
{
"cell_type": "markdown",
"id": "cc540e55-606d-48d3-8407-6f79d979e0cc",
"metadata": {},
"source": [
"Reorder the dataframe according to the sorted index to retrieve variable names"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1d2992a6-4597-4147-8096-378364c7e406",
"metadata": {},
"outputs": [],
"source": [
"rcdict.loc[sorted_index[sims > cutoff], :]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5f3973e5-b0f0-4084-9e31-e6119d299e87",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python (voice)",
"language": "python",
"name": "python3"
"name": "voice"
},
"language_info": {
"codemirror_mode": {
Expand Down

0 comments on commit ad9e296

Please sign in to comment.