This commit is contained in:
Krystian Osiński 2024-04-21 12:32:38 +02:00
parent 8c25ab8484
commit 7d98005446

View File

@ -1,20 +1,5 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "continued-dinner",
"metadata": {},
"source": [
"![Logo 1](https://git.wmi.amu.edu.pl/AITech/Szablon/raw/branch/master/Logotyp_AITech1.jpg)\n",
"<div class=\"alert alert-block alert-info\">\n",
"<h1> Komputerowe wspomaganie tłumaczenia </h1>\n",
"<h2> 2. <i>Zaawansowane użycie pamięci tłumaczeń</i> [laboratoria]</h2> \n",
"<h3>Rafał Jaworski (2021)</h3>\n",
"</div>\n",
"\n",
"![Logo 2](https://git.wmi.amu.edu.pl/AITech/Szablon/raw/branch/master/Logotyp_AITech2.jpg)"
]
},
{
"cell_type": "markdown",
"id": "aggregate-listing",
@ -57,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"id": "confident-prison",
"metadata": {},
"outputs": [],
@ -80,7 +65,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 2,
"id": "continental-submission",
"metadata": {},
"outputs": [
@ -90,7 +75,7 @@
"['Wciśnij przycisk Enter']"
]
},
"execution_count": 21,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
@ -117,7 +102,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 3,
"id": "ecb19925-7467-4e8a-bfdf-9adee52a5894",
"metadata": {},
"outputs": [
@ -127,7 +112,7 @@
"'no context'"
]
},
"execution_count": 18,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
@ -138,7 +123,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 4,
"id": "cf60a398-ae06-4ca8-b658-e011632cdb33",
"metadata": {},
"outputs": [
@ -148,7 +133,7 @@
"'enter your sentence'"
]
},
"execution_count": 19,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
@ -159,7 +144,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 5,
"id": "d34415a4-d853-435e-b093-fabc4629ff26",
"metadata": {},
"outputs": [
@ -169,7 +154,7 @@
"'no context'"
]
},
"execution_count": 20,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
@ -208,7 +193,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"id": "fourth-pillow",
"metadata": {},
"outputs": [],
@ -249,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 7,
"id": "continued-christopher",
"metadata": {},
"outputs": [],
@ -327,28 +312,16 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 8,
"id": "727b188d-eedd-4d19-9cbf-efcce71e145c",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Defaulting to user installation because normal site-packages is not writeable\n",
"Collecting python-Levenshtein\n",
" Downloading python_Levenshtein-0.25.1-py3-none-any.whl.metadata (3.7 kB)\n",
"Collecting Levenshtein==0.25.1 (from python-Levenshtein)\n",
" Downloading Levenshtein-0.25.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.3 kB)\n",
"Collecting rapidfuzz<4.0.0,>=3.8.0 (from Levenshtein==0.25.1->python-Levenshtein)\n",
" Downloading rapidfuzz-3.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)\n",
"Downloading python_Levenshtein-0.25.1-py3-none-any.whl (9.4 kB)\n",
"Downloading Levenshtein-0.25.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (177 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m177.4/177.4 kB\u001b[0m \u001b[31m3.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m\n",
"\u001b[?25hDownloading rapidfuzz-3.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.4 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.4/3.4 MB\u001b[0m \u001b[31m40.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
"\u001b[?25hInstalling collected packages: rapidfuzz, Levenshtein, python-Levenshtein\n",
"Successfully installed Levenshtein-0.25.1 python-Levenshtein-0.25.1 rapidfuzz-3.8.1\n"
"ename": "SyntaxError",
"evalue": "invalid syntax (2143622881.py, line 1)",
"output_type": "error",
"traceback": [
"\u001b[0;36m Cell \u001b[0;32mIn [8], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m pip3 install python-Levenshtein\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
}
],
@ -358,21 +331,10 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"id": "secondary-wrist",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"from Levenshtein import distance as levenshtein_distance\n",
"\n",
@ -389,7 +351,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": null,
"id": "associate-tuner",
"metadata": {},
"outputs": [],
@ -408,63 +370,30 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "focal-pathology",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.9166666666666666"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"levenshtein_similarity('Program jest uruchomiony', 'Program jest uruchamiany')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "roman-ceiling",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.9428571428571428"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"levenshtein_similarity('Spróbuj wyłączyć i włączyć komputer', 'Spróbuj włączyć i wyłączyć komputer')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "invisible-cambodia",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.631578947368421"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"levenshtein_similarity('Spróbuj wyłączyć i włączyć komputer', 'Nie próbuj wyłączać i włączać drukarki')"
]
@ -479,7 +408,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": null,
"id": "genetic-cradle",
"metadata": {},
"outputs": [],
@ -497,21 +426,10 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": null,
"id": "cc0544a4-a515-4515-a116-f13b96e92812",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['Press the ENTER button']"
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"#'Wciśnij przycisk Enter'\n",
"fuzzy_lookup('KlikNiJ przycisK EnTeR', 0.86)"
@ -519,21 +437,10 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": null,
"id": "e2b8ff91-a103-45a4-a746-8ce3e9470c4c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['Check the network settings']"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"#'Sprawdź ustawienia sieciowe'\n",
"fuzzy_lookup('Sprawdź ustawienia sieci', 0.885)"