Upload sd_token_similarity_calculator.ipynb
Browse files
sd_token_similarity_calculator.ipynb
CHANGED
@@ -147,13 +147,23 @@
|
|
147 |
{
|
148 |
"cell_type": "code",
|
149 |
"source": [
|
150 |
-
"list_size =
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
"for index in range(list_size):\n",
|
152 |
" id = indices[index].item()\n",
|
153 |
-
"
|
154 |
-
"
|
155 |
-
"
|
156 |
-
"
|
|
|
|
|
|
|
|
|
157 |
],
|
158 |
"metadata": {
|
159 |
"id": "YIEmLAzbHeuo"
|
|
|
147 |
{
|
148 |
"cell_type": "code",
|
149 |
"source": [
|
150 |
+
"list_size = 100 # @param {type:'number'}\n",
|
151 |
+
"\n",
|
152 |
+
"print_ID = False # @param {type:\"boolean\"}\n",
|
153 |
+
"print_Similarity = True # @param {type:\"boolean\"}\n",
|
154 |
+
"print_Name = True # @param {type:\"boolean\"}\n",
|
155 |
+
"print_Divider = False # @param {type:\"boolean\"}\n",
|
156 |
+
"\n",
|
157 |
"for index in range(list_size):\n",
|
158 |
" id = indices[index].item()\n",
|
159 |
+
" if (print_Name):\n",
|
160 |
+
" print(f'{vocab[id]}') # vocab item\n",
|
161 |
+
" if (print_ID):\n",
|
162 |
+
" print(f'ID = {id}') # IDs\n",
|
163 |
+
" if (print_Similarity):\n",
|
164 |
+
" print(f'similiarity = {round(sorted[index].item()*100,2)} %') # % value\n",
|
165 |
+
" if (print_Divider):\n",
|
166 |
+
" print('--------')"
|
167 |
],
|
168 |
"metadata": {
|
169 |
"id": "YIEmLAzbHeuo"
|