Spaces:
Runtime error
Runtime error
git ignore
Browse files- .gitignore +1 -0
- src/FAISS.ipynb +15 -3
- src/Speeches/querry.ipynb +5 -5
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__pycache__
|
src/FAISS.ipynb
CHANGED
|
@@ -2,9 +2,21 @@
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
-
"execution_count":
|
| 6 |
"metadata": {},
|
| 7 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
"source": [
|
| 9 |
"# Create vectorstore\n",
|
| 10 |
"import pandas as pd\n",
|
|
@@ -13,7 +25,7 @@
|
|
| 13 |
"from langchain_community.vectorstores import FAISS\n",
|
| 14 |
"\n",
|
| 15 |
"\n",
|
| 16 |
-
"df = pd.read_pickle(\"C:\\\\Users\\Tom\\SynologyDrive\\Programming\\\\NLP\\PoliticsToYou\\
|
| 17 |
"# Split speeches into documents\n",
|
| 18 |
"documents = load_documents(df)\n",
|
| 19 |
"embeddings = HuggingFaceEmbeddings(model_name=\"paraphrase-multilingual-MiniLM-L12-v2\")\n",
|
|
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
+
"execution_count": 3,
|
| 6 |
"metadata": {},
|
| 7 |
+
"outputs": [
|
| 8 |
+
{
|
| 9 |
+
"ename": "",
|
| 10 |
+
"evalue": "",
|
| 11 |
+
"output_type": "error",
|
| 12 |
+
"traceback": [
|
| 13 |
+
"\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n",
|
| 14 |
+
"\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n",
|
| 15 |
+
"\u001b[1;31mClick <a href='https://aka.ms/vscodeJupyterKernelCrash'>here</a> for more info. \n",
|
| 16 |
+
"\u001b[1;31mView Jupyter <a href='command:jupyter.viewOutput'>log</a> for further details."
|
| 17 |
+
]
|
| 18 |
+
}
|
| 19 |
+
],
|
| 20 |
"source": [
|
| 21 |
"# Create vectorstore\n",
|
| 22 |
"import pandas as pd\n",
|
|
|
|
| 25 |
"from langchain_community.vectorstores import FAISS\n",
|
| 26 |
"\n",
|
| 27 |
"\n",
|
| 28 |
+
"df = pd.read_pickle(\"C:\\\\Users\\Tom\\SynologyDrive\\Tom\\Programming\\\\NLP\\Spaces\\PoliticsToYou\\src\\Speeches\\speeches_1949_09_12\")\n",
|
| 29 |
"# Split speeches into documents\n",
|
| 30 |
"documents = load_documents(df)\n",
|
| 31 |
"embeddings = HuggingFaceEmbeddings(model_name=\"paraphrase-multilingual-MiniLM-L12-v2\")\n",
|
src/Speeches/querry.ipynb
CHANGED
|
@@ -19,14 +19,14 @@
|
|
| 19 |
},
|
| 20 |
{
|
| 21 |
"cell_type": "code",
|
| 22 |
-
"execution_count":
|
| 23 |
"metadata": {},
|
| 24 |
"outputs": [
|
| 25 |
{
|
| 26 |
"name": "stderr",
|
| 27 |
"output_type": "stream",
|
| 28 |
"text": [
|
| 29 |
-
"C:\\Users\\Tom\\AppData\\Local\\Temp\\
|
| 30 |
" df = pd.read_sql_query(\"\"\"SELECT s.id,s.speech_content,s.date,f.abbreviation AS party\n"
|
| 31 |
]
|
| 32 |
}
|
|
@@ -60,7 +60,7 @@
|
|
| 60 |
},
|
| 61 |
{
|
| 62 |
"cell_type": "code",
|
| 63 |
-
"execution_count":
|
| 64 |
"metadata": {},
|
| 65 |
"outputs": [
|
| 66 |
{
|
|
@@ -203,7 +203,7 @@
|
|
| 203 |
"[930960 rows x 4 columns]"
|
| 204 |
]
|
| 205 |
},
|
| 206 |
-
"execution_count":
|
| 207 |
"metadata": {},
|
| 208 |
"output_type": "execute_result"
|
| 209 |
}
|
|
@@ -215,7 +215,7 @@
|
|
| 215 |
},
|
| 216 |
{
|
| 217 |
"cell_type": "code",
|
| 218 |
-
"execution_count":
|
| 219 |
"metadata": {},
|
| 220 |
"outputs": [],
|
| 221 |
"source": [
|
|
|
|
| 19 |
},
|
| 20 |
{
|
| 21 |
"cell_type": "code",
|
| 22 |
+
"execution_count": 3,
|
| 23 |
"metadata": {},
|
| 24 |
"outputs": [
|
| 25 |
{
|
| 26 |
"name": "stderr",
|
| 27 |
"output_type": "stream",
|
| 28 |
"text": [
|
| 29 |
+
"C:\\Users\\Tom\\AppData\\Local\\Temp\\ipykernel_32\\2374447718.py:12: UserWarning: pandas only supports SQLAlchemy connectable (engine/connection) or database string URI or sqlite3 DBAPI2 connection. Other DBAPI2 objects are not tested. Please consider using SQLAlchemy.\n",
|
| 30 |
" df = pd.read_sql_query(\"\"\"SELECT s.id,s.speech_content,s.date,f.abbreviation AS party\n"
|
| 31 |
]
|
| 32 |
}
|
|
|
|
| 60 |
},
|
| 61 |
{
|
| 62 |
"cell_type": "code",
|
| 63 |
+
"execution_count": 4,
|
| 64 |
"metadata": {},
|
| 65 |
"outputs": [
|
| 66 |
{
|
|
|
|
| 203 |
"[930960 rows x 4 columns]"
|
| 204 |
]
|
| 205 |
},
|
| 206 |
+
"execution_count": 4,
|
| 207 |
"metadata": {},
|
| 208 |
"output_type": "execute_result"
|
| 209 |
}
|
|
|
|
| 215 |
},
|
| 216 |
{
|
| 217 |
"cell_type": "code",
|
| 218 |
+
"execution_count": 5,
|
| 219 |
"metadata": {},
|
| 220 |
"outputs": [],
|
| 221 |
"source": [
|