Skip to content

Commit

Permalink
Merge pull request #557 from vespa-engine/kkraune/colab
Browse files Browse the repository at this point in the history
Kkraune/colab
  • Loading branch information
kkraune authored Aug 31, 2023
2 parents 91fddcb + 4284f9d commit eab0e4b
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 116 deletions.
22 changes: 18 additions & 4 deletions docs/sphinx/source/application-packages.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,24 @@
" **_To configure setting an unsupported indexing option (or any other unsupported option),_**\n",
" **_export the application package like above, modify the schema or other files_**\n",
" **_and deploy the application package from the directory, or as a zipped file._**\n",
" **_Find more details at the end of this notebook._**\n",
"\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/vespa-engine/pyvespa/blob/master/docs/sphinx/source/application-packages.ipynb)\n",
"\n",
" **_Find more details at the end of this notebook._**"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e51d0086",
"metadata": {},
"outputs": [],
"source": [
"!pip3 install pyvespa"
]
},
{
"cell_type": "markdown",
"id": "b593d6e2",
"metadata": {},
"source": [
"By exporting to disk, one can see the generated files:"
]
},
Expand Down
20 changes: 18 additions & 2 deletions docs/sphinx/source/examples/multi-vector-indexing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,24 @@
"* How to control text search result highlighting.\n",
"\n",
"This notebook requires [pyvespa >= 0.37.1](https://pyvespa.readthedocs.io/en/latest/index.html#requirements)\n",
"and the [Vespa CLI](https://pyvespa.readthedocs.io/en/latest/reads-writes.html#Feed-using-Vespa-CLI).\n",
"\n",
"and the [Vespa CLI](https://pyvespa.readthedocs.io/en/latest/reads-writes.html#Feed-using-Vespa-CLI)."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bf5137e2",
"metadata": {},
"outputs": [],
"source": [
"!pip3 install pyvespa"
]
},
{
"cell_type": "markdown",
"id": "0d35f3da",
"metadata": {},
"source": [
"## Create the application"
]
},
Expand Down
10 changes: 10 additions & 0 deletions docs/sphinx/source/examples/pyvespa-examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
"Refer to [troubleshooting](https://pyvespa.readthedocs.io/en/latest/troubleshooting.html), which also has utilies for debugging."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8fb6db5b",
"metadata": {},
"outputs": [],
"source": [
"!pip3 install pyvespa"
]
},
{
"cell_type": "markdown",
"id": "c77bfca9",
Expand Down
15 changes: 14 additions & 1 deletion docs/sphinx/source/getting-started-pyvespa.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
}
],
"source": [
"!pip3 install pyvespa\n",
"!docker info | grep \"Total Memory\""
]
},
Expand Down Expand Up @@ -451,9 +452,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "python3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
143 changes: 34 additions & 109 deletions docs/sphinx/source/query.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,22 @@
"and https://cord19.vespa.ai/ app as an example.\n",
"You can run this tutorial in Google Colab:\n",
"\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/vespa-engine/pyvespa/blob/master/docs/sphinx/source/query.ipynb)\n",
"\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/vespa-engine/pyvespa/blob/master/docs/sphinx/source/query.ipynb)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip3 install pyvespa"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Set the query endpoint:"
]
},
Expand Down Expand Up @@ -46,18 +60,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"10977"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"body = {\n",
" 'yql': 'select cord_uid, title, abstract from sources * where userQuery()',\n",
Expand All @@ -81,18 +84,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"5"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"len(results.hits)"
]
Expand All @@ -108,18 +100,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['ysml5abq', 'zpcuwvn4', '8art2tyj', 'xej338lo', 'npoje09j']"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"[hit[\"fields\"][\"cord_uid\"] for hit in results.hits]"
]
Expand All @@ -135,23 +116,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'id': 'index:content/1/848ca5db53648911e0a58c78',\n",
" 'relevance': 30.531354743471304,\n",
" 'source': 'content',\n",
" 'fields': {'title': 'Cost utility analysis of <hi>Remdesivir</hi> and Dexamethasone <hi>treatment</hi> for hospitalised <hi>COVID</hi>-<hi>19</hi> patients - a hypothetical study',\n",
" 'abstract': '<sep />: Sars-Cov-2 is a novel corona virus associated with significant morbidity and mortality. <hi>Remdesivir</hi> and Dexamethasone are two <hi>treatments</hi> that have shown to be <hi>effective</hi> against the Sars-Cov-2 associated disease. However, a cost-effectiveness analysis of the two <hi>treatments</hi> is still lacking. OBJECTIVE: The cost-utility of <hi>Remdesivir</hi>, Dexamethasone and a simultaneous use of the two drugs with respect to standard of care for <hi>treatment</hi> <hi>Covid</hi>-<hi>19</hi> hospitalized patients is evaluated, together with the effect<sep />',\n",
" 'cord_uid': 'ysml5abq'}}"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"results.hits[0]"
]
Expand All @@ -168,59 +133,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'timing': {'querytime': 0.019,\n",
" 'summaryfetchtime': 0.001,\n",
" 'searchtime': 0.021},\n",
" 'root': {'id': 'toplevel',\n",
" 'relevance': 1.0,\n",
" 'fields': {'totalCount': 10977},\n",
" 'coverage': {'coverage': 100,\n",
" 'documents': 976355,\n",
" 'full': True,\n",
" 'nodes': 2,\n",
" 'results': 1,\n",
" 'resultsFull': 1},\n",
" 'children': [{'id': 'index:content/1/848ca5db53648911e0a58c78',\n",
" 'relevance': 30.531354743471304,\n",
" 'source': 'content',\n",
" 'fields': {'title': 'Cost utility analysis of <hi>Remdesivir</hi> and Dexamethasone <hi>treatment</hi> for hospitalised <hi>COVID</hi>-<hi>19</hi> patients - a hypothetical study',\n",
" 'abstract': '<sep />: Sars-Cov-2 is a novel corona virus associated with significant morbidity and mortality. <hi>Remdesivir</hi> and Dexamethasone are two <hi>treatments</hi> that have shown to be <hi>effective</hi> against the Sars-Cov-2 associated disease. However, a cost-effectiveness analysis of the two <hi>treatments</hi> is still lacking. OBJECTIVE: The cost-utility of <hi>Remdesivir</hi>, Dexamethasone and a simultaneous use of the two drugs with respect to standard of care for <hi>treatment</hi> <hi>Covid</hi>-<hi>19</hi> hospitalized patients is evaluated, together with the effect<sep />',\n",
" 'cord_uid': 'ysml5abq'}},\n",
" {'id': 'index:content/1/afade29b15d5f83d8dd4d16a',\n",
" 'relevance': 30.124913401931195,\n",
" 'source': 'content',\n",
" 'fields': {'title': '<hi>Remdesivir</hi> is <hi>effective</hi> for moderately severe patients: A re-analysis of the first double-blind, placebo-controlled, randomized trial on <hi>remdesivir</hi> for <hi>treatment</hi> of severe <hi>covid</hi>-<hi>19</hi> patients conducted in wuhan city',\n",
" 'abstract': '<sep /> with baseline score, day of assessment, <hi>treatment</hi> group, baseline by <hi>treatment</hi> interaction, and day by <hi>treatment</hi> interaction as covariates. The binary endpoint was supported by the recent FDA<sep />oxygen (but not NIV/HFNC)) – the moderately severe category. The response rate was 85% for <hi>remdesivir</hi>-treated patients with baseline disease point=3 versus 70% response rate for likewise placebo-treated<sep />opinions. This result supports the preliminary findings of ACTT that <hi>remdesivir</hi> is <hi>effective</hi> for patients who were not critically severe. This result also suggests that<sep />',\n",
" 'cord_uid': 'zpcuwvn4'}},\n",
" {'id': 'index:content/1/4678cba4fd31160fd163d063',\n",
" 'relevance': 29.876569304341285,\n",
" 'source': 'content',\n",
" 'fields': {'title': 'A Review on <hi>Remdesivir</hi>: A Possible Promising Agent for the <hi>Treatment</hi> of <hi>COVID</hi>-<hi>19</hi>',\n",
" 'abstract': '<sep />manufacturing of specific therapeutics and vaccines to treat <hi>COVID</hi>-<hi>19</hi> are time-consuming processes. At this time, using available conventional therapeutics along with other <hi>treatment</hi> options may be useful to fight <hi>COVID</hi>-<hi>19</hi>. In different clinical trials, efficacy of <hi>remdesivir</hi> (GS-5734) against Ebola virus has been demonstrated. Moreover, <hi>remdesivir</hi> may be an <hi>effective</hi> therapy in vitro and in animal models infected by SARS and MERS coronaviruses. Hence, the drug may be theoretically <hi>effective</hi> against SARS-CoV-2. <hi>Remdesivir</hi><sep />',\n",
" 'cord_uid': '8art2tyj'}},\n",
" {'id': 'index:content/0/eec37c88ff9aa825c5c79d81',\n",
" 'relevance': 29.874123437446798,\n",
" 'source': 'content',\n",
" 'fields': {'title': 'A Review on <hi>Remdesivir</hi>: A Possible Promising Agent for the <hi>Treatment</hi> of <hi>COVID</hi>-<hi>19</hi>',\n",
" 'abstract': '<sep />manufacturing of specific therapeutics and vaccines to treat <hi>COVID</hi>-<hi>19</hi> are time-consuming processes. At this time, using available conventional therapeutics along with other <hi>treatment</hi> options may be useful to fight <hi>COVID</hi>-<hi>19</hi>. In different clinical trials, efficacy of <hi>remdesivir</hi> (GS-5734) against Ebola virus has been demonstrated. Moreover, <hi>remdesivir</hi> may be an <hi>effective</hi> therapy in vitro and in animal models infected by SARS and MERS coronaviruses. Hence, the drug may be theoretically <hi>effective</hi> against SARS-CoV-2. <hi>Remdesivir</hi><sep />',\n",
" 'cord_uid': 'xej338lo'}},\n",
" {'id': 'index:content/0/a41b357fc6aa38c6b55a4685',\n",
" 'relevance': 29.481438680496694,\n",
" 'source': 'content',\n",
" 'fields': {'title': '<hi>Remdesivir</hi> for the <hi>Treatment</hi> of <hi>COVID</hi>-<hi>19</hi>: A Systematic Review of the Literature',\n",
" 'abstract': '<sep />CoV-2 a global pandemic. To date, coronavirus disease-2019 (<hi>COVID</hi>-<hi>19</hi>) has spread to over 200 countries, leading to over 1.6 million cases and over 99,000 deaths. Given that there is neither a vaccine nor proven <hi>treatment</hi> for <hi>COVID</hi>-<hi>19</hi>, there is currently an urgent need for <hi>effective</hi> pharmacotherapy. To address the need for an <hi>effective</hi> <hi>treatment</hi> of SARS-CoV-2 during the worldwide pandemic, this systematic review of intravenous (IV) <hi>remdesivir</hi> was performed. <hi>Remdesivir</hi>, an anti-viral prodrug originally developed to treat Ebola virus disease, has shown broad spectrum activity against the Coronavirus family. A recent case report reported improvement of clinical symptoms with <hi>remdesivir</hi> in a patient with <hi>COVID</hi>-<hi>19</hi>. After<sep />',\n",
" 'cord_uid': 'npoje09j'}}]}}"
]
},
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"results.json"
]
Expand All @@ -239,9 +152,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "python3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit eab0e4b

Please sign in to comment.