Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Updated file path for articles.sqlite in example notebooks, fixes #15

davidmezzettic85256f53eea
diff --git a/examples/03_Build_an_Embeddings_index_from_a_data_source.ipynb b/examples/03_Build_an_Embeddings_index_from_a_data_source.ipynb
index a4052700..c6651e13 100644
--- a/examples/03_Build_an_Embeddings_index_from_a_data_source.ipynb
+++ b/examples/03_Build_an_Embeddings_index_from_a_data_source.ipynb
@@ -76,28 +76,35 @@
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
- "height": 228
+ "height": 315
},
- "outputId": "0f1999f6-33e7-4aa7-a7bf-864f677e50f6"
+ "outputId": "55f85ebf-946e-44aa-e27e-026436be909e"
},
"source": [
- "!wget https://www.kaggleusercontent.com/kf/40510829/eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..i594VxIvDFKijTSDVIfvfw.4rZ0qT2s7KPZGWRQUt5NVETt_SiaIlq0VPV4O9qqmYD3MRAJ2D0nZDWSdSNwlW9aOZPJNsJNOSMnWdhGGmI9tSAYtRdaBoach-i0zFhVCUNYp1Y04dqB_YLtcx1whx6s0_jxl0TnIlenaJqpZvaSizpuOZjRrmiO4nb4hctJTftbV0AJJNKWeKYMex-1dxK0FFaT_d4lbh3p_ArVZguQIbOKbBRrJcrA589PylYl_2oqlowgb2OazsTZpe4JQFXekWmr5IP4Yem5llN-j3CTFp9M4AAKtbIS908FoRia9bLc6JyP8mEaVt4PNF_ayHNnmarovnK8DOTueK1Ld8OCyFlbGxerPClihQ0HuosiQH5GeX8MAEsZV8Ot8dvU8fR_Pp2xJ0Td_OB8FcL5jMO1yVOB6_P1GtPq2OSriaSN731QlvK5WbXfkYhUSREWOyTmXC0G1dlsdJzgXaw7U5VeLRH5yfA4n9HZWq5s_hisJdAoxiLtRjSmKg8Dw3t5uNlig1QPLq_VcyLtCiO4sZh5xe4qRCL-tQ1PfTVOe7z8QMM06UsRaX0686PgSOFTarKYuB6t44sjc7YcddiCNK33hPWbDR2vAtcjHoxmj-xeM-zgV1S89OVD971eUpsLz5jF.ihLqVQjVU5xZtKKDCu8MwA/articles.sqlite"
+ "!wget https://github.com/neuml/txtai/releases/download/v1.1.0/tests.gz\n",
+ "!gunzip tests.gz\n",
+ "!mv tests articles.sqlite"
],
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"text": [
- "--2020-08-24 12:12:07-- https://www.kaggleusercontent.com/kf/40510829/eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..i594VxIvDFKijTSDVIfvfw.4rZ0qT2s7KPZGWRQUt5NVETt_SiaIlq0VPV4O9qqmYD3MRAJ2D0nZDWSdSNwlW9aOZPJNsJNOSMnWdhGGmI9tSAYtRdaBoach-i0zFhVCUNYp1Y04dqB_YLtcx1whx6s0_jxl0TnIlenaJqpZvaSizpuOZjRrmiO4nb4hctJTftbV0AJJNKWeKYMex-1dxK0FFaT_d4lbh3p_ArVZguQIbOKbBRrJcrA589PylYl_2oqlowgb2OazsTZpe4JQFXekWmr5IP4Yem5llN-j3CTFp9M4AAKtbIS908FoRia9bLc6JyP8mEaVt4PNF_ayHNnmarovnK8DOTueK1Ld8OCyFlbGxerPClihQ0HuosiQH5GeX8MAEsZV8Ot8dvU8fR_Pp2xJ0Td_OB8FcL5jMO1yVOB6_P1GtPq2OSriaSN731QlvK5WbXfkYhUSREWOyTmXC0G1dlsdJzgXaw7U5VeLRH5yfA4n9HZWq5s_hisJdAoxiLtRjSmKg8Dw3t5uNlig1QPLq_VcyLtCiO4sZh5xe4qRCL-tQ1PfTVOe7z8QMM06UsRaX0686PgSOFTarKYuB6t44sjc7YcddiCNK33hPWbDR2vAtcjHoxmj-xeM-zgV1S89OVD971eUpsLz5jF.ihLqVQjVU5xZtKKDCu8MwA/articles.sqlite\n",
- "Resolving www.kaggleusercontent.com (www.kaggleusercontent.com)... 35.190.26.106\n",
- "Connecting to www.kaggleusercontent.com (www.kaggleusercontent.com)|35.190.26.106|:443... connected.\n",
+ "--2020-08-25 01:56:04-- https://github.com/neuml/txtai/releases/download/v1.1.0/tests.gz\n",
+ "Resolving github.com (github.com)... 140.82.112.4\n",
+ "Connecting to github.com (github.com)|140.82.112.4|:443... connected.\n",
+ "HTTP request sent, awaiting response... 302 Found\n",
+ "Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/286301447/080d8800-e653-11ea-8d02-c0c858a09e7a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200825%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200825T015604Z&X-Amz-Expires=300&X-Amz-Signature=e135dc0b8f0d7774019d6525aad528b99160aff4007b2a539330c090c29ef9b5&X-Amz-SignedHeaders=host&actor_id=0&repo_id=286301447&response-content-disposition=attachment%3B%20filename%3Dtests.gz&response-content-type=application%2Foctet-stream [following]\n",
+ "--2020-08-25 01:56:04-- https://github-production-release-asset-2e65be.s3.amazonaws.com/286301447/080d8800-e653-11ea-8d02-c0c858a09e7a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200825%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200825T015604Z&X-Amz-Expires=300&X-Amz-Signature=e135dc0b8f0d7774019d6525aad528b99160aff4007b2a539330c090c29ef9b5&X-Amz-SignedHeaders=host&actor_id=0&repo_id=286301447&response-content-disposition=attachment%3B%20filename%3Dtests.gz&response-content-type=application%2Foctet-stream\n",
+ "Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.110.243\n",
+ "Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.110.243|:443... connected.\n",
"HTTP request sent, awaiting response... 200 OK\n",
- "Length: 8065024 (7.7M) [application/octet-stream]\n",
- "Saving to: ‘articles.sqlite’\n",
+ "Length: 2456199 (2.3M) [application/octet-stream]\n",
+ "Saving to: ‘tests.gz’\n",
"\n",
- "articles.sqlite 100%[===================>] 7.69M 27.0MB/s in 0.3s \n",
+ "tests.gz 100%[===================>] 2.34M --.-KB/s in 0.09s \n",
"\n",
- "2020-08-24 12:12:08 (27.0 MB/s) - ‘articles.sqlite’ saved [8065024/8065024]\n",
+ "2020-08-25 01:56:05 (24.7 MB/s) - ‘tests.gz’ saved [2456199/2456199]\n",
"\n"
],
"name": "stdout"
@@ -130,7 +137,7 @@
"base_uri": "https://localhost:8080/",
"height": 156
},
- "outputId": "8145a4e4-9ffd-404b-b01f-efb8cb84559b"
+ "outputId": "8ad62b92-55b7-4f2e-af55-f313402574a8"
},
"source": [
"import os\n",
@@ -175,9 +182,9 @@
"Building 300 dimension model\n",
"Converting vectors to magnitude format\n",
"total 9024\n",
- "-rw-r--r-- 1 root root 8065024 Aug 24 12:12 articles.sqlite\n",
- "-rw-r--r-- 1 root root 360448 Aug 24 12:13 cord19-300d.magnitude\n",
- "-rw-r--r-- 1 root root 807886 Aug 24 12:13 cord19-300d.txt\n",
+ "-rw-r--r-- 1 root root 8065024 Aug 25 01:44 articles.sqlite\n",
+ "-rw-r--r-- 1 root root 360448 Aug 25 01:57 cord19-300d.magnitude\n",
+ "-rw-r--r-- 1 root root 807886 Aug 25 01:57 cord19-300d.txt\n",
"drwxr-xr-x 1 root root 4096 Jul 30 16:30 sample_data\n"
],
"name": "stdout"
@@ -205,7 +212,7 @@
"base_uri": "https://localhost:8080/",
"height": 52
},
- "outputId": "9e5d37fa-d449-46fa-cf57-8c4c009b9cda"
+ "outputId": "36c78d6a-1f01-4e66-d0a8-7d27d3698ab3"
},
"source": [
"import sqlite3\n",
@@ -293,7 +300,7 @@
"base_uri": "https://localhost:8080/",
"height": 293
},
- "outputId": "d0a71abb-aaa0-4bdc-cdeb-6cc275096f11"
+ "outputId": "3f52b2b9-5307-47af-8dee-fdd9e694250b"
},
"source": [
"import pandas as pd\n",
@@ -417,7 +424,7 @@
"base_uri": "https://localhost:8080/",
"height": 293
},
- "outputId": "a5a73487-9799-4f62-e244-dcdbd46db300"
+ "outputId": "e5c24448-97b4-444f-d47e-d268ef18aec5"
},
"source": [
"db = sqlite3.connect(\"articles.sqlite\")\n",
diff --git a/examples/04_Extractive_QA_with_Elasticsearch.ipynb b/examples/04_Extractive_QA_with_Elasticsearch.ipynb
index 79567816..7a17dd37 100644
--- a/examples/04_Extractive_QA_with_Elasticsearch.ipynb
+++ b/examples/04_Extractive_QA_with_Elasticsearch.ipynb
@@ -96,28 +96,35 @@
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
- "height": 228
+ "height": 315
},
- "outputId": "8a68dda7-3d9d-43ef-fc7e-b4639a010896"
+ "outputId": "d4b8b54d-1ede-45c1-adef-94bfa9a104cf"
},
"source": [
- "!wget https://www.kaggleusercontent.com/kf/40510829/eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..i594VxIvDFKijTSDVIfvfw.4rZ0qT2s7KPZGWRQUt5NVETt_SiaIlq0VPV4O9qqmYD3MRAJ2D0nZDWSdSNwlW9aOZPJNsJNOSMnWdhGGmI9tSAYtRdaBoach-i0zFhVCUNYp1Y04dqB_YLtcx1whx6s0_jxl0TnIlenaJqpZvaSizpuOZjRrmiO4nb4hctJTftbV0AJJNKWeKYMex-1dxK0FFaT_d4lbh3p_ArVZguQIbOKbBRrJcrA589PylYl_2oqlowgb2OazsTZpe4JQFXekWmr5IP4Yem5llN-j3CTFp9M4AAKtbIS908FoRia9bLc6JyP8mEaVt4PNF_ayHNnmarovnK8DOTueK1Ld8OCyFlbGxerPClihQ0HuosiQH5GeX8MAEsZV8Ot8dvU8fR_Pp2xJ0Td_OB8FcL5jMO1yVOB6_P1GtPq2OSriaSN731QlvK5WbXfkYhUSREWOyTmXC0G1dlsdJzgXaw7U5VeLRH5yfA4n9HZWq5s_hisJdAoxiLtRjSmKg8Dw3t5uNlig1QPLq_VcyLtCiO4sZh5xe4qRCL-tQ1PfTVOe7z8QMM06UsRaX0686PgSOFTarKYuB6t44sjc7YcddiCNK33hPWbDR2vAtcjHoxmj-xeM-zgV1S89OVD971eUpsLz5jF.ihLqVQjVU5xZtKKDCu8MwA/articles.sqlite"
+ "!wget https://github.com/neuml/txtai/releases/download/v1.1.0/tests.gz\n",
+ "!gunzip tests.gz\n",
+ "!mv tests articles.sqlite"
],
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"text": [
- "--2020-08-24 12:14:58-- https://www.kaggleusercontent.com/kf/40510829/eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..i594VxIvDFKijTSDVIfvfw.4rZ0qT2s7KPZGWRQUt5NVETt_SiaIlq0VPV4O9qqmYD3MRAJ2D0nZDWSdSNwlW9aOZPJNsJNOSMnWdhGGmI9tSAYtRdaBoach-i0zFhVCUNYp1Y04dqB_YLtcx1whx6s0_jxl0TnIlenaJqpZvaSizpuOZjRrmiO4nb4hctJTftbV0AJJNKWeKYMex-1dxK0FFaT_d4lbh3p_ArVZguQIbOKbBRrJcrA589PylYl_2oqlowgb2OazsTZpe4JQFXekWmr5IP4Yem5llN-j3CTFp9M4AAKtbIS908FoRia9bLc6JyP8mEaVt4PNF_ayHNnmarovnK8DOTueK1Ld8OCyFlbGxerPClihQ0HuosiQH5GeX8MAEsZV8Ot8dvU8fR_Pp2xJ0Td_OB8FcL5jMO1yVOB6_P1GtPq2OSriaSN731QlvK5WbXfkYhUSREWOyTmXC0G1dlsdJzgXaw7U5VeLRH5yfA4n9HZWq5s_hisJdAoxiLtRjSmKg8Dw3t5uNlig1QPLq_VcyLtCiO4sZh5xe4qRCL-tQ1PfTVOe7z8QMM06UsRaX0686PgSOFTarKYuB6t44sjc7YcddiCNK33hPWbDR2vAtcjHoxmj-xeM-zgV1S89OVD971eUpsLz5jF.ihLqVQjVU5xZtKKDCu8MwA/articles.sqlite\n",
- "Resolving www.kaggleusercontent.com (www.kaggleusercontent.com)... 35.190.26.106\n",
- "Connecting to www.kaggleusercontent.com (www.kaggleusercontent.com)|35.190.26.106|:443... connected.\n",
+ "--2020-08-25 01:56:54-- https://github.com/neuml/txtai/releases/download/v1.1.0/tests.gz\n",
+ "Resolving github.com (github.com)... 140.82.112.4\n",
+ "Connecting to github.com (github.com)|140.82.112.4|:443... connected.\n",
+ "HTTP request sent, awaiting response... 302 Found\n",
+ "Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/286301447/080d8800-e653-11ea-8d02-c0c858a09e7a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200825%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200825T015604Z&X-Amz-Expires=300&X-Amz-Signature=e135dc0b8f0d7774019d6525aad528b99160aff4007b2a539330c090c29ef9b5&X-Amz-SignedHeaders=host&actor_id=0&repo_id=286301447&response-content-disposition=attachment%3B%20filename%3Dtests.gz&response-content-type=application%2Foctet-stream [following]\n",
+ "--2020-08-25 01:56:54-- https://github-production-release-asset-2e65be.s3.amazonaws.com/286301447/080d8800-e653-11ea-8d02-c0c858a09e7a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200825%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200825T015604Z&X-Amz-Expires=300&X-Amz-Signature=e135dc0b8f0d7774019d6525aad528b99160aff4007b2a539330c090c29ef9b5&X-Amz-SignedHeaders=host&actor_id=0&repo_id=286301447&response-content-disposition=attachment%3B%20filename%3Dtests.gz&response-content-type=application%2Foctet-stream\n",
+ "Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.140.68\n",
+ "Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.140.68|:443... connected.\n",
"HTTP request sent, awaiting response... 200 OK\n",
- "Length: 8065024 (7.7M) [application/octet-stream]\n",
- "Saving to: ‘articles.sqlite’\n",
+ "Length: 2456199 (2.3M) [application/octet-stream]\n",
+ "Saving to: ‘tests.gz’\n",
"\n",
- "\rarticles.sqlite 0%[ ] 0 --.-KB/s \rarticles.sqlite 100%[===================>] 7.69M --.-KB/s in 0.08s \n",
+ "tests.gz 100%[===================>] 2.34M 11.2MB/s in 0.2s \n",
"\n",
- "2020-08-24 12:14:58 (99.3 MB/s) - ‘articles.sqlite’ saved [8065024/8065024]\n",
+ "2020-08-25 01:56:55 (11.2 MB/s) - ‘tests.gz’ saved [2456199/2456199]\n",
"\n"
],
"name": "stdout"
@@ -145,7 +152,7 @@
"base_uri": "https://localhost:8080/",
"height": 34
},
- "outputId": "75c62ce3-90fd-407b-c207-b0f74c744459"
+ "outputId": "c4d447fd-4103-4cb6-d16e-83c84fc1b689"
},
"source": [
"import sqlite3\n",
@@ -229,7 +236,7 @@
"base_uri": "https://localhost:8080/",
"height": 293
},
- "outputId": "229c7e3f-b58b-40eb-e2a0-3c911810729a"
+ "outputId": "582b3aa1-9eeb-431b-b7d1-509b7c3c28f2"
},
"source": [
"import pandas as pd\n",
@@ -344,7 +351,7 @@
"base_uri": "https://localhost:8080/",
"height": 328
},
- "outputId": "8f6a14f8-513a-4d63-88e1-b5ece32b74b0"
+ "outputId": "6d1c81fc-2da4-480c-9799-061297fca8a8"
},
"source": [
"document = {\n",