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

update search to include dataframe reordering #43

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading