Upload sd_token_similarity_calculator.ipynb
Browse files
sd_token_similarity_calculator.ipynb
CHANGED
|
@@ -62,12 +62,14 @@
|
|
| 62 |
"\n",
|
| 63 |
" similarity_pcnt_aprox = round(similarity_pcnt, 3)\n",
|
| 64 |
"\n",
|
| 65 |
-
"
|
|
|
|
|
|
|
| 66 |
],
|
| 67 |
"metadata": {
|
| 68 |
"id": "fxquCxFaUxAZ"
|
| 69 |
},
|
| 70 |
-
"execution_count":
|
| 71 |
"outputs": []
|
| 72 |
},
|
| 73 |
{
|
|
@@ -82,36 +84,15 @@
|
|
| 82 |
{
|
| 83 |
"cell_type": "code",
|
| 84 |
"source": [
|
| 85 |
-
"id_for_token_A =
|
| 86 |
"id_for_token_B = 4343 # @param {type:'number'}\n",
|
| 87 |
"\n",
|
| 88 |
-
"
|
| 89 |
"\n",
|
| 90 |
-
"print(
|
| 91 |
],
|
| 92 |
"metadata": {
|
| 93 |
-
"
|
| 94 |
-
"base_uri": "https://localhost:8080/"
|
| 95 |
-
},
|
| 96 |
-
"id": "MwmOdC9cNZty",
|
| 97 |
-
"outputId": "e75c4987-9d13-4ec7-ca36-775b8dbac707"
|
| 98 |
-
},
|
| 99 |
-
"execution_count": 36,
|
| 100 |
-
"outputs": [
|
| 101 |
-
{
|
| 102 |
-
"output_type": "stream",
|
| 103 |
-
"name": "stdout",
|
| 104 |
-
"text": [
|
| 105 |
-
"The similarity between tokens A and B is 4.001 %\n"
|
| 106 |
-
]
|
| 107 |
-
}
|
| 108 |
-
]
|
| 109 |
-
},
|
| 110 |
-
{
|
| 111 |
-
"cell_type": "code",
|
| 112 |
-
"source": [],
|
| 113 |
-
"metadata": {
|
| 114 |
-
"id": "oJC12JgJUPrB"
|
| 115 |
},
|
| 116 |
"execution_count": null,
|
| 117 |
"outputs": []
|
|
|
|
| 62 |
"\n",
|
| 63 |
" similarity_pcnt_aprox = round(similarity_pcnt, 3)\n",
|
| 64 |
"\n",
|
| 65 |
+
" result = f'{similarity_pcnt_aprox} %'\n",
|
| 66 |
+
"\n",
|
| 67 |
+
" return result"
|
| 68 |
],
|
| 69 |
"metadata": {
|
| 70 |
"id": "fxquCxFaUxAZ"
|
| 71 |
},
|
| 72 |
+
"execution_count": 16,
|
| 73 |
"outputs": []
|
| 74 |
},
|
| 75 |
{
|
|
|
|
| 84 |
{
|
| 85 |
"cell_type": "code",
|
| 86 |
"source": [
|
| 87 |
+
"id_for_token_A = 4567 # @param {type:'number'}\n",
|
| 88 |
"id_for_token_B = 4343 # @param {type:'number'}\n",
|
| 89 |
"\n",
|
| 90 |
+
"similarity_str = 'The similarity between tokens A and B is ' + similarity(id_for_token_A , id_for_token_B)\n",
|
| 91 |
"\n",
|
| 92 |
+
"print(similarity_str)"
|
| 93 |
],
|
| 94 |
"metadata": {
|
| 95 |
+
"id": "MwmOdC9cNZty"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
},
|
| 97 |
"execution_count": null,
|
| 98 |
"outputs": []
|