Skip to content

Commit

Permalink
Lemmatizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoron86 committed Jun 24, 2024
1 parent 635b1fd commit c6dfdcf
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 73 deletions.
117 changes: 88 additions & 29 deletions Group-8-Retrieval-System/lemmatizer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,76 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 50,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: tira in /usr/local/lib/python3.10/dist-packages (0.0.132)\n",
"Requirement already satisfied: ir-datasets in /usr/local/lib/python3.10/dist-packages (0.5.5)\n",
"Requirement already satisfied: python-terrier in /usr/local/lib/python3.10/dist-packages (0.10.0)\n",
"Requirement already satisfied: nltk in /usr/local/lib/python3.10/dist-packages (3.8.1)\n",
"Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from tira) (4.66.1)\n",
"Requirement already satisfied: pandas in /usr/local/lib/python3.10/dist-packages (from tira) (2.1.3)\n",
"Requirement already satisfied: requests==2.*,>=2.26 in /usr/local/lib/python3.10/dist-packages (from tira) (2.31.0)\n",
"Requirement already satisfied: docker==6.*,>=6.0.0 in /usr/local/lib/python3.10/dist-packages (from tira) (6.1.3)\n",
"Requirement already satisfied: urllib3>=1.26.0 in /usr/local/lib/python3.10/dist-packages (from docker==6.*,>=6.0.0->tira) (2.1.0)\n",
"Requirement already satisfied: websocket-client>=0.32.0 in /usr/local/lib/python3.10/dist-packages (from docker==6.*,>=6.0.0->tira) (1.7.0)\n",
"Requirement already satisfied: packaging>=14.0 in /usr/local/lib/python3.10/dist-packages (from docker==6.*,>=6.0.0->tira) (23.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests==2.*,>=2.26->tira) (3.6)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests==2.*,>=2.26->tira) (3.3.2)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests==2.*,>=2.26->tira) (2023.11.17)\n",
"Requirement already satisfied: zlib-state>=0.1.3 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (0.1.6)\n",
"Requirement already satisfied: numpy>=1.18.1 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (1.26.2)\n",
"Requirement already satisfied: lz4>=3.1.10 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (4.3.2)\n",
"Requirement already satisfied: ijson>=3.1.3 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (3.2.3)\n",
"Requirement already satisfied: warc3-wet>=0.2.3 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (0.2.3)\n",
"Requirement already satisfied: pyautocorpus>=0.1.1 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (0.1.12)\n",
"Requirement already satisfied: trec-car-tools>=2.5.4 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (2.6)\n",
"Requirement already satisfied: unlzw3>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (0.2.2)\n",
"Requirement already satisfied: warc3-wet-clueweb09>=0.2.5 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (0.2.5)\n",
"Requirement already satisfied: inscriptis>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (2.3.2)\n",
"Requirement already satisfied: lxml>=4.5.2 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (4.9.3)\n",
"Requirement already satisfied: pyyaml>=5.3.1 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (6.0.1)\n",
"Requirement already satisfied: beautifulsoup4>=4.4.1 in /usr/local/lib/python3.10/dist-packages (from ir-datasets) (4.12.2)\n",
"Requirement already satisfied: pytrec-eval-terrier>=0.5.3 in /usr/local/lib/python3.10/dist-packages (from python-terrier) (0.5.6)\n",
"Requirement already satisfied: dill in /usr/local/lib/python3.10/dist-packages (from python-terrier) (0.3.7)\n",
"Requirement already satisfied: chest in /usr/local/lib/python3.10/dist-packages (from python-terrier) (0.2.3)\n",
"Requirement already satisfied: scikit-learn in /usr/local/lib/python3.10/dist-packages (from python-terrier) (1.3.2)\n",
"Requirement already satisfied: deprecated in /usr/local/lib/python3.10/dist-packages (from python-terrier) (1.2.14)\n",
"Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from python-terrier) (3.1.2)\n",
"Requirement already satisfied: scipy in /usr/local/lib/python3.10/dist-packages (from python-terrier) (1.11.4)\n",
"Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (from python-terrier) (1.3.2)\n",
"Requirement already satisfied: more-itertools in /usr/local/lib/python3.10/dist-packages (from python-terrier) (10.1.0)\n",
"Requirement already satisfied: statsmodels in /usr/local/lib/python3.10/dist-packages (from python-terrier) (0.14.0)\n",
"Requirement already satisfied: pyjnius>=1.4.2 in /usr/local/lib/python3.10/dist-packages (from python-terrier) (1.6.1)\n",
"Requirement already satisfied: nptyping==1.4.4 in /usr/local/lib/python3.10/dist-packages (from python-terrier) (1.4.4)\n",
"Requirement already satisfied: matchpy in /usr/local/lib/python3.10/dist-packages (from python-terrier) (0.5.5)\n",
"Requirement already satisfied: wget in /usr/local/lib/python3.10/dist-packages (from python-terrier) (3.2)\n",
"Requirement already satisfied: ir-measures>=0.3.1 in /usr/local/lib/python3.10/dist-packages (from python-terrier) (0.3.3)\n",
"Requirement already satisfied: typish>=1.7.0 in /usr/local/lib/python3.10/dist-packages (from nptyping==1.4.4->python-terrier) (1.9.3)\n",
"Requirement already satisfied: regex>=2021.8.3 in /usr/local/lib/python3.10/dist-packages (from nltk) (2024.5.15)\n",
"Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from nltk) (8.1.7)\n",
"Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.10/dist-packages (from beautifulsoup4>=4.4.1->ir-datasets) (2.5)\n",
"Requirement already satisfied: cwl-eval>=1.0.10 in /usr/local/lib/python3.10/dist-packages (from ir-measures>=0.3.1->python-terrier) (1.0.12)\n",
"Requirement already satisfied: cbor>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from trec-car-tools>=2.5.4->ir-datasets) (1.0.0)\n",
"Requirement already satisfied: heapdict in /usr/local/lib/python3.10/dist-packages (from chest->python-terrier) (1.0.1)\n",
"Requirement already satisfied: wrapt<2,>=1.10 in /usr/local/lib/python3.10/dist-packages (from deprecated->python-terrier) (1.16.0)\n",
"Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->python-terrier) (2.1.3)\n",
"Requirement already satisfied: multiset<3.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from matchpy->python-terrier) (2.1.1)\n",
"Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas->tira) (2023.3.post1)\n",
"Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas->tira) (2023.3)\n",
"Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas->tira) (2.8.2)\n",
"Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn->python-terrier) (3.2.0)\n",
"Requirement already satisfied: patsy>=0.5.2 in /usr/local/lib/python3.10/dist-packages (from statsmodels->python-terrier) (0.5.4)\n",
"Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from patsy>=0.5.2->statsmodels->python-terrier) (1.16.0)\n",
"\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n",
"\u001b[0m"
]
}
],
"source": [
"# You only need to execute this cell if you are using Google Golab.\n",
"# If you use GitHub Codespaces, everything is already installed.\n",
Expand All @@ -13,7 +80,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 51,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -30,7 +97,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 52,
"metadata": {},
"outputs": [
{
Expand All @@ -49,7 +116,7 @@
"True"
]
},
"execution_count": 37,
"execution_count": 52,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -62,7 +129,7 @@
},
{
"cell_type": "code",
"execution_count": 38,
"execution_count": 53,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -72,7 +139,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 54,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -82,7 +149,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 55,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -93,7 +160,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 56,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -103,7 +170,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 57,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -114,7 +181,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 58,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -126,17 +193,9 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 59,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using column for text: qid\n"
]
}
],
"outputs": [],
"source": [
"# text_column = topics.columns[0]\n",
"# print('Using column for text:', text_column)\n",
Expand All @@ -145,7 +204,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 60,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -155,7 +214,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 61,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -164,7 +223,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 62,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -173,7 +232,7 @@
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": 63,
"metadata": {},
"outputs": [
{
Expand All @@ -191,7 +250,7 @@
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": 64,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -259,7 +318,7 @@
"0 None None None None None "
]
},
"execution_count": 48,
"execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -278,7 +337,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": 65,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -442,7 +501,7 @@
"9 retrieval system improving effectiveness bm25-lemmatizer "
]
},
"execution_count": 49,
"execution_count": 65,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
Loading

0 comments on commit c6dfdcf

Please sign in to comment.