Skip to content

Instantly share code, notes, and snippets.

@Norod
Last active January 4, 2022 20:08
Show Gist options
  • Select an option

  • Save Norod/f064ca503d6cba49eec503c4378fe898 to your computer and use it in GitHub Desktop.

Select an option

Save Norod/f064ca503d6cba49eec503c4378fe898 to your computer and use it in GitHub Desktop.
Output token scores for Norod78/distilgpt2-base-pretrained-he (hebrew)
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "output-token-scores-hebrew.ipynb",
"provenance": [],
"collapsed_sections": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"4b9137310f824ea19c8746349004de3d": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HBoxView",
"_dom_classes": [],
"_model_name": "HBoxModel",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.5.0",
"box_style": "",
"layout": "IPY_MODEL_698b49fd59eb4da0870fb8fa1eb0be88",
"_model_module": "@jupyter-widgets/controls",
"children": [
"IPY_MODEL_05c6ee4b1534451e8ba30cd1943f395d",
"IPY_MODEL_b30447e6af4d44c493fb7f08ef2f7943",
"IPY_MODEL_5bc8eaf75a3e4a6b93105557d306d55d"
]
}
},
"698b49fd59eb4da0870fb8fa1eb0be88": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"05c6ee4b1534451e8ba30cd1943f395d": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_bade25dada154a5faa9aa45e243109c9",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": "Downloading: 100%",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_f9797aa8a8d846d48bf0b4a9973c3ecc"
}
},
"b30447e6af4d44c493fb7f08ef2f7943": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_6c0be22629364bff9ded4ba58f4f551e",
"_dom_classes": [],
"description": "",
"_model_name": "FloatProgressModel",
"bar_style": "success",
"max": 1003,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 1003,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_feb27a7a9d3348d4a214a26c10acead7"
}
},
"5bc8eaf75a3e4a6b93105557d306d55d": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_c0198496579446649b7172930c1a75aa",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": " 0.98k/0.98k [00:00<00:00, 16.4kB/s]",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_df174a11462f4b4a90fdd93b7041daf3"
}
},
"bade25dada154a5faa9aa45e243109c9": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"f9797aa8a8d846d48bf0b4a9973c3ecc": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"6c0be22629364bff9ded4ba58f4f551e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"feb27a7a9d3348d4a214a26c10acead7": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"c0198496579446649b7172930c1a75aa": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"df174a11462f4b4a90fdd93b7041daf3": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"d5d92d8ee40f46598644492e37c13634": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HBoxView",
"_dom_classes": [],
"_model_name": "HBoxModel",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.5.0",
"box_style": "",
"layout": "IPY_MODEL_041f323b2af04d269eedf2297fe12508",
"_model_module": "@jupyter-widgets/controls",
"children": [
"IPY_MODEL_295ca7a61f3e461a8cf8967cd2526d66",
"IPY_MODEL_1d51c136f5c544e499620ae865147050",
"IPY_MODEL_2d479f7b6eb0444a97b238970e12372a"
]
}
},
"041f323b2af04d269eedf2297fe12508": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"295ca7a61f3e461a8cf8967cd2526d66": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_729ea894efed40c1b63219f68e6d3f52",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": "Downloading: 100%",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_2c359e1f303647ff8d5a90fd759e2962"
}
},
"1d51c136f5c544e499620ae865147050": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_f414546db9fd4796b3eb2ea021c2652c",
"_dom_classes": [],
"description": "",
"_model_name": "FloatProgressModel",
"bar_style": "success",
"max": 2538770,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 2538770,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_972fb43c77db44288134dbfb051bca67"
}
},
"2d479f7b6eb0444a97b238970e12372a": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_950c52dc4eaf4886a97c34393b42e25e",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": " 2.42M/2.42M [00:00<00:00, 16.2MB/s]",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_85d37d3e27514c4a88644ffffed79807"
}
},
"729ea894efed40c1b63219f68e6d3f52": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"2c359e1f303647ff8d5a90fd759e2962": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"f414546db9fd4796b3eb2ea021c2652c": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"972fb43c77db44288134dbfb051bca67": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"950c52dc4eaf4886a97c34393b42e25e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"85d37d3e27514c4a88644ffffed79807": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"9ec1e0dbd0fb4058ba9a89a6865f7033": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HBoxView",
"_dom_classes": [],
"_model_name": "HBoxModel",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.5.0",
"box_style": "",
"layout": "IPY_MODEL_d0f8304abc64442f887a8a01c9f805c9",
"_model_module": "@jupyter-widgets/controls",
"children": [
"IPY_MODEL_6a2e76ec79fa4216a05af1604963302a",
"IPY_MODEL_d0866ab3810b489ea366a8bdb5570cef",
"IPY_MODEL_4d6bace16505434d90ffe5648b5b984c"
]
}
},
"d0f8304abc64442f887a8a01c9f805c9": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"6a2e76ec79fa4216a05af1604963302a": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_6080d720344448669d6ca128cf6bb041",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": "Downloading: 100%",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_e39968e1d55d42d2896d8b163a40a060"
}
},
"d0866ab3810b489ea366a8bdb5570cef": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "ProgressView",
"style": "IPY_MODEL_38c0dc19e54347de9eadaac3a3c08e60",
"_dom_classes": [],
"description": "",
"_model_name": "FloatProgressModel",
"bar_style": "success",
"max": 333973519,
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": 333973519,
"_view_count": null,
"_view_module_version": "1.5.0",
"orientation": "horizontal",
"min": 0,
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_aad84692ce8746c0abee3655cab74f9c"
}
},
"4d6bace16505434d90ffe5648b5b984c": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "HTMLView",
"style": "IPY_MODEL_38394f8f23474d4095312f51f975a5d9",
"_dom_classes": [],
"description": "",
"_model_name": "HTMLModel",
"placeholder": "​",
"_view_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"value": " 319M/319M [00:07<00:00, 45.8MB/s]",
"_view_count": null,
"_view_module_version": "1.5.0",
"description_tooltip": null,
"_model_module": "@jupyter-widgets/controls",
"layout": "IPY_MODEL_b38daa0353cf45ffa8bd49606588a9b8"
}
},
"6080d720344448669d6ca128cf6bb041": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"e39968e1d55d42d2896d8b163a40a060": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"38c0dc19e54347de9eadaac3a3c08e60": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "ProgressStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"bar_color": null,
"_model_module": "@jupyter-widgets/controls"
}
},
"aad84692ce8746c0abee3655cab74f9c": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
},
"38394f8f23474d4095312f51f975a5d9": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_view_name": "StyleView",
"_model_name": "DescriptionStyleModel",
"description_width": "",
"_view_module": "@jupyter-widgets/base",
"_model_module_version": "1.5.0",
"_view_count": null,
"_view_module_version": "1.2.0",
"_model_module": "@jupyter-widgets/controls"
}
},
"b38daa0353cf45ffa8bd49606588a9b8": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_view_name": "LayoutView",
"grid_template_rows": null,
"right": null,
"justify_content": null,
"_view_module": "@jupyter-widgets/base",
"overflow": null,
"_model_module_version": "1.2.0",
"_view_count": null,
"flex_flow": null,
"width": null,
"min_width": null,
"border": null,
"align_items": null,
"bottom": null,
"_model_module": "@jupyter-widgets/base",
"top": null,
"grid_column": null,
"overflow_y": null,
"overflow_x": null,
"grid_auto_flow": null,
"grid_area": null,
"grid_template_columns": null,
"flex": null,
"_model_name": "LayoutModel",
"justify_items": null,
"grid_row": null,
"max_height": null,
"align_content": null,
"visibility": null,
"align_self": null,
"height": null,
"min_height": null,
"padding": null,
"grid_auto_rows": null,
"grid_gap": null,
"max_width": null,
"order": null,
"_view_module_version": "1.2.0",
"grid_template_areas": null,
"object_position": null,
"object_fit": null,
"grid_auto_columns": null,
"margin": null,
"display": null,
"left": null
}
}
}
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/Norod/f064ca503d6cba49eec503c4378fe898/output-token-scores-hebrew.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "jVUTEvBOJMuu",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "69f34140-3fdb-4351-e7fa-5b4814dc4d2b"
},
"source": [
"!pip install ecco\n",
"!pip install --upgrade transformers tokenizers"
],
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Collecting ecco\n",
" Downloading ecco-0.1.1-py2.py3-none-any.whl (70 kB)\n",
"\u001b[K |████████████████████████████████| 70 kB 3.7 MB/s \n",
"\u001b[?25hCollecting PyYAML~=5.4\n",
" Downloading PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl (636 kB)\n",
"\u001b[K |████████████████████████████████| 636 kB 26.5 MB/s \n",
"\u001b[?25hCollecting captum~=0.4\n",
" Downloading captum-0.4.1-py3-none-any.whl (1.4 MB)\n",
"\u001b[K |████████████████████████████████| 1.4 MB 33.4 MB/s \n",
"\u001b[?25hCollecting scikit-learn~=0.23\n",
" Downloading scikit_learn-0.24.2-cp37-cp37m-manylinux2010_x86_64.whl (22.3 MB)\n",
"\u001b[K |████████████████████████████████| 22.3 MB 1.5 MB/s \n",
"\u001b[?25hCollecting transformers~=4.2\n",
" Downloading transformers-4.15.0-py3-none-any.whl (3.4 MB)\n",
"\u001b[K |████████████████████████████████| 3.4 MB 46.7 MB/s \n",
"\u001b[?25hRequirement already satisfied: seaborn~=0.11 in /usr/local/lib/python3.7/dist-packages (from ecco) (0.11.2)\n",
"Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from captum~=0.4->ecco) (3.2.2)\n",
"Requirement already satisfied: torch>=1.2 in /usr/local/lib/python3.7/dist-packages (from captum~=0.4->ecco) (1.10.0+cu111)\n",
"Requirement already satisfied: numpy in /usr/local/lib/python3.7/dist-packages (from captum~=0.4->ecco) (1.19.5)\n",
"Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.7/dist-packages (from scikit-learn~=0.23->ecco) (1.1.0)\n",
"Requirement already satisfied: scipy>=0.19.1 in /usr/local/lib/python3.7/dist-packages (from scikit-learn~=0.23->ecco) (1.4.1)\n",
"Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from scikit-learn~=0.23->ecco) (3.0.0)\n",
"Requirement already satisfied: pandas>=0.23 in /usr/local/lib/python3.7/dist-packages (from seaborn~=0.11->ecco) (1.1.5)\n",
"Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->captum~=0.4->ecco) (2.8.2)\n",
"Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->captum~=0.4->ecco) (3.0.6)\n",
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->captum~=0.4->ecco) (0.11.0)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->captum~=0.4->ecco) (1.3.2)\n",
"Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.7/dist-packages (from pandas>=0.23->seaborn~=0.11->ecco) (2018.9)\n",
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.1->matplotlib->captum~=0.4->ecco) (1.15.0)\n",
"Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from torch>=1.2->captum~=0.4->ecco) (3.10.0.2)\n",
"Requirement already satisfied: filelock in /usr/local/lib/python3.7/dist-packages (from transformers~=4.2->ecco) (3.4.0)\n",
"Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.7/dist-packages (from transformers~=4.2->ecco) (2019.12.20)\n",
"Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from transformers~=4.2->ecco) (2.23.0)\n",
"Collecting sacremoses\n",
" Downloading sacremoses-0.0.46-py3-none-any.whl (895 kB)\n",
"\u001b[K |████████████████████████████████| 895 kB 48.8 MB/s \n",
"\u001b[?25hRequirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.7/dist-packages (from transformers~=4.2->ecco) (4.62.3)\n",
"Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from transformers~=4.2->ecco) (4.8.2)\n",
"Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from transformers~=4.2->ecco) (21.3)\n",
"Collecting huggingface-hub<1.0,>=0.1.0\n",
" Downloading huggingface_hub-0.2.1-py3-none-any.whl (61 kB)\n",
"\u001b[K |████████████████████████████████| 61 kB 460 kB/s \n",
"\u001b[?25hCollecting tokenizers<0.11,>=0.10.1\n",
" Downloading tokenizers-0.10.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (3.3 MB)\n",
"\u001b[K |████████████████████████████████| 3.3 MB 41.6 MB/s \n",
"\u001b[?25hRequirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->transformers~=4.2->ecco) (3.6.0)\n",
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->transformers~=4.2->ecco) (2.10)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->transformers~=4.2->ecco) (2021.10.8)\n",
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->transformers~=4.2->ecco) (1.24.3)\n",
"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->transformers~=4.2->ecco) (3.0.4)\n",
"Requirement already satisfied: click in /usr/local/lib/python3.7/dist-packages (from sacremoses->transformers~=4.2->ecco) (7.1.2)\n",
"Installing collected packages: PyYAML, tokenizers, sacremoses, huggingface-hub, transformers, scikit-learn, captum, ecco\n",
" Attempting uninstall: PyYAML\n",
" Found existing installation: PyYAML 3.13\n",
" Uninstalling PyYAML-3.13:\n",
" Successfully uninstalled PyYAML-3.13\n",
" Attempting uninstall: scikit-learn\n",
" Found existing installation: scikit-learn 1.0.1\n",
" Uninstalling scikit-learn-1.0.1:\n",
" Successfully uninstalled scikit-learn-1.0.1\n",
"Successfully installed PyYAML-5.4.1 captum-0.4.1 ecco-0.1.1 huggingface-hub-0.2.1 sacremoses-0.0.46 scikit-learn-0.24.2 tokenizers-0.10.3 transformers-4.15.0\n",
"Requirement already satisfied: transformers in /usr/local/lib/python3.7/dist-packages (4.15.0)\n",
"Requirement already satisfied: tokenizers in /usr/local/lib/python3.7/dist-packages (0.10.3)\n",
"Collecting tokenizers\n",
" Downloading tokenizers-0.11.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (6.8 MB)\n",
"\u001b[K |████████████████████████████████| 6.8 MB 22.6 MB/s \n",
"\u001b[?25hRequirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.7/dist-packages (from transformers) (5.4.1)\n",
"Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.7/dist-packages (from transformers) (1.19.5)\n",
"Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from transformers) (2.23.0)\n",
"Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.7/dist-packages (from transformers) (2019.12.20)\n",
"Requirement already satisfied: filelock in /usr/local/lib/python3.7/dist-packages (from transformers) (3.4.0)\n",
"Requirement already satisfied: sacremoses in /usr/local/lib/python3.7/dist-packages (from transformers) (0.0.46)\n",
"Requirement already satisfied: huggingface-hub<1.0,>=0.1.0 in /usr/local/lib/python3.7/dist-packages (from transformers) (0.2.1)\n",
"Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.7/dist-packages (from transformers) (4.62.3)\n",
"Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from transformers) (4.8.2)\n",
"Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.7/dist-packages (from transformers) (21.3)\n",
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.7/dist-packages (from huggingface-hub<1.0,>=0.1.0->transformers) (3.10.0.2)\n",
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/dist-packages (from packaging>=20.0->transformers) (3.0.6)\n",
"Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/dist-packages (from importlib-metadata->transformers) (3.6.0)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (2021.10.8)\n",
"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (3.0.4)\n",
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (2.10)\n",
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->transformers) (1.24.3)\n",
"Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from sacremoses->transformers) (1.15.0)\n",
"Requirement already satisfied: joblib in /usr/local/lib/python3.7/dist-packages (from sacremoses->transformers) (1.1.0)\n",
"Requirement already satisfied: click in /usr/local/lib/python3.7/dist-packages (from sacremoses->transformers) (7.1.2)\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"import ecco\n",
"from transformers import AutoTokenizer, AutoModelForCausalLM, AutoModel, AutoModelForSeq2SeqLM, GPT2Model, GPT2LMHeadModel\n",
"hf_model_id = 'Norod78/distilgpt2-base-pretrained-he'\n",
"\n",
"\n",
"# 1- load the model the tokenizer\n",
"tokenizer = AutoTokenizer.from_pretrained(hf_model_id)\n",
"model = AutoModel.from_pretrained(hf_model_id)"
],
"metadata": {
"id": "icRHWaMfeAUc",
"outputId": "07ed5b33-94a8-4ce8-9c59-98f2b7d161e8",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 207,
"referenced_widgets": [
"4b9137310f824ea19c8746349004de3d",
"698b49fd59eb4da0870fb8fa1eb0be88",
"05c6ee4b1534451e8ba30cd1943f395d",
"b30447e6af4d44c493fb7f08ef2f7943",
"5bc8eaf75a3e4a6b93105557d306d55d",
"bade25dada154a5faa9aa45e243109c9",
"f9797aa8a8d846d48bf0b4a9973c3ecc",
"6c0be22629364bff9ded4ba58f4f551e",
"feb27a7a9d3348d4a214a26c10acead7",
"c0198496579446649b7172930c1a75aa",
"df174a11462f4b4a90fdd93b7041daf3",
"d5d92d8ee40f46598644492e37c13634",
"041f323b2af04d269eedf2297fe12508",
"295ca7a61f3e461a8cf8967cd2526d66",
"1d51c136f5c544e499620ae865147050",
"2d479f7b6eb0444a97b238970e12372a",
"729ea894efed40c1b63219f68e6d3f52",
"2c359e1f303647ff8d5a90fd759e2962",
"f414546db9fd4796b3eb2ea021c2652c",
"972fb43c77db44288134dbfb051bca67",
"950c52dc4eaf4886a97c34393b42e25e",
"85d37d3e27514c4a88644ffffed79807",
"9ec1e0dbd0fb4058ba9a89a6865f7033",
"d0f8304abc64442f887a8a01c9f805c9",
"6a2e76ec79fa4216a05af1604963302a",
"d0866ab3810b489ea366a8bdb5570cef",
"4d6bace16505434d90ffe5648b5b984c",
"6080d720344448669d6ca128cf6bb041",
"e39968e1d55d42d2896d8b163a40a060",
"38c0dc19e54347de9eadaac3a3c08e60",
"aad84692ce8746c0abee3655cab74f9c",
"38394f8f23474d4095312f51f975a5d9",
"b38daa0353cf45ffa8bd49606588a9b8"
]
}
},
"execution_count": 2,
"outputs": [
{
"output_type": "display_data",
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4b9137310f824ea19c8746349004de3d",
"version_minor": 0,
"version_major": 2
},
"text/plain": [
"Downloading: 0%| | 0.00/0.98k [00:00<?, ?B/s]"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d5d92d8ee40f46598644492e37c13634",
"version_minor": 0,
"version_major": 2
},
"text/plain": [
"Downloading: 0%| | 0.00/2.42M [00:00<?, ?B/s]"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stderr",
"text": [
"Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"
]
},
{
"output_type": "display_data",
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9ec1e0dbd0fb4058ba9a89a6865f7033",
"version_minor": 0,
"version_major": 2
},
"text/plain": [
"Downloading: 0%| | 0.00/319M [00:00<?, ?B/s]"
]
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stderr",
"text": [
"Some weights of the model checkpoint at Norod78/distilgpt2-base-pretrained-he were not used when initializing GPT2Model: ['lm_head.weight']\n",
"- This IS expected if you are initializing GPT2Model from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n",
"- This IS NOT expected if you are initializing GPT2Model from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"model_config = {\n",
" 'embedding': \"transformer.wte.weight\",\n",
" 'type': 'causal',\n",
" 'activations': ['mlp\\.c_proj'], #This is a regex\n",
" 'token_prefix': 'Ġ',\n",
" 'partial_token_prefix': ''\n",
"}"
],
"metadata": {
"id": "4LBHntPMnMCr"
},
"execution_count": 3,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "wv3l86vBJNpY",
"outputId": "56043baf-deb3-4b18-fd1c-c3821d592ef2",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
"source": [
"lm = ecco.from_pretrained(hf_model_id, \n",
" activations=True,\n",
" model_config=model_config)"
],
"execution_count": 4,
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": [
"Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n"
]
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "J9LbZ76mWhUs"
},
"source": [
"## Fill in the blank: \"1, 2, ____\"\n",
"\n",
"> Indented block\n",
"\n"
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 50
},
"id": "CYbyc2uMWXcE",
"outputId": "818e428c-8c85-4394-c12e-834eba5f434f"
},
"source": [
"# Generate one token to fill in the blank\n",
"output_0 = lm.generate(\"אחת, שתיים,\", generate=1, do_sample=False)"
],
"execution_count": 5,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/html": [
"<html lang=\"en\">\n",
"<script src=\"https://requirejs.org/docs/release/2.3.6/minified/require.js\"></script>\n",
"<script>\n",
" var ecco_url = 'https://storage.googleapis.com/ml-intro/ecco/'\n",
" //var ecco_url = 'http://localhost:8000/'\n",
"\n",
" if (window.ecco === undefined) window.ecco = {}\n",
"\n",
" // Setup the paths of the script we'll be using\n",
" requirejs.config({\n",
" urlArgs: \"bust=\" + (new Date()).getTime(),\n",
" nodeRequire: require,\n",
" paths: {\n",
" d3: \"https://d3js.org/d3.v6.min\", // This is only for use in setup.html and basic.html\n",
" \"d3-array\": \"https://d3js.org/d3-array.v2.min\",\n",
" jquery: \"https://code.jquery.com/jquery-3.5.1.min\",\n",
" ecco: ecco_url + 'js/0.0.6/ecco-bundle.min',\n",
" xregexp: 'https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min'\n",
" }\n",
" });\n",
"\n",
" // Add the css file\n",
" //requirejs(['d3'],\n",
" // function (d3) {\n",
" // d3.select('#css').attr('href', ecco_url + 'html/styles.css')\n",
" // })\n",
"\n",
" console.log('Ecco initialize!!')\n",
"\n",
" // returns a 'basic' object. basic.init() selects the html div we'll be\n",
" // rendering the html into, adds styles.css to the document.\n",
" define('basic', ['d3'],\n",
" function (d3) {\n",
" return {\n",
" init: function (viz_id = null) {\n",
" if (viz_id == null) {\n",
" viz_id = \"viz_\" + Math.round(Math.random() * 10000000)\n",
" }\n",
" // Select the div rendered below, change its id\n",
" const div = d3.select('#basic').attr('id', viz_id),\n",
" div_parent = d3.select('#' + viz_id).node().parentNode\n",
"\n",
" // Link to CSS file\n",
" d3.select(div_parent).insert('link')\n",
" .attr('rel', 'stylesheet')\n",
" .attr('type', 'text/css')\n",
" .attr('href', ecco_url + 'html/0.0.2/styles.css')\n",
"\n",
" return viz_id\n",
" }\n",
" }\n",
" }, function (err) {\n",
" console.log(err);\n",
" }\n",
" )\n",
"</script>\n",
"\n",
"<head>\n",
" <link id='css' rel=\"stylesheet\" type=\"text/css\">\n",
"</head>\n",
"<div id=\"basic\"></div>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"application/javascript": [
"\n",
" requirejs( ['basic', 'ecco'], function(basic, ecco){\n",
" basic.init('viz_504470') // Python needs to know the viz id. Used for each output token.\n",
" window.ecco['viz_504470'] = new ecco.renderOutputSequence({\n",
" parentDiv: 'viz_504470',\n",
" data: {\"tokens\": [{\"token\": \"\\u05d0\\u05d7\\u05ea\", \"is_partial\": true, \"position\": 0, \"token_id\": 10519, \"type\": \"input\"}, {\"token\": \",\", \"is_partial\": true, \"position\": 1, \"token_id\": 16, \"type\": \"input\"}, {\"token\": \"\\u05e9\\u05ea\\u05d9\\u05d9\\u05dd\", \"is_partial\": false, \"position\": 2, \"token_id\": 9341, \"type\": \"input\"}, {\"token\": \",\", \"is_partial\": true, \"position\": 3, \"token_id\": 16, \"type\": \"input\"}]},\n",
" tokenization_config: {\"token_prefix\": \"\\u0120\", \"partial_token_prefix\": \"\"}\n",
" \n",
" })\n",
" }, function (err) {\n",
" console.log(err);\n",
" })\n",
" "
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"application/javascript": [
"\n",
" // We don't really need these require scripts. But this is to avert\n",
" //this code from running before display_input_sequence which DOES require external files\n",
" requirejs(['basic', 'ecco'], function(basic, ecco){\n",
" console.log('addToken viz_id', 'viz_504470');\n",
" window.ecco['viz_504470'].addToken({\"token\": \"\\u05e9\\u05dc\\u05d5\\u05e9\", \"is_partial\": false, \"token_id\": 4134, \"position\": 4, \"type\": \"output\"})\n",
" window.ecco['viz_504470'].redraw()\n",
" })\n",
" "
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 210
},
"id": "gqBY9Y0HWcgD",
"outputId": "bc48172b-1033-4cd4-c6ee-aa050d169d0f"
},
"source": [
"# Visualize\n",
"output_0.layer_predictions(position=4, layer=5)"
],
"execution_count": 6,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/html": [
"<html lang=\"en\">\n",
"<script src=\"https://requirejs.org/docs/release/2.3.6/minified/require.js\"></script>\n",
"<script>\n",
" var ecco_url = 'https://storage.googleapis.com/ml-intro/ecco/'\n",
" //var ecco_url = 'http://localhost:8000/'\n",
"\n",
" if (window.ecco === undefined) window.ecco = {}\n",
"\n",
" // Setup the paths of the script we'll be using\n",
" requirejs.config({\n",
" urlArgs: \"bust=\" + (new Date()).getTime(),\n",
" nodeRequire: require,\n",
" paths: {\n",
" d3: \"https://d3js.org/d3.v6.min\", // This is only for use in setup.html and basic.html\n",
" \"d3-array\": \"https://d3js.org/d3-array.v2.min\",\n",
" jquery: \"https://code.jquery.com/jquery-3.5.1.min\",\n",
" ecco: ecco_url + 'js/0.0.6/ecco-bundle.min',\n",
" xregexp: 'https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min'\n",
" }\n",
" });\n",
"\n",
" // Add the css file\n",
" //requirejs(['d3'],\n",
" // function (d3) {\n",
" // d3.select('#css').attr('href', ecco_url + 'html/styles.css')\n",
" // })\n",
"\n",
" console.log('Ecco initialize!!')\n",
"\n",
" // returns a 'basic' object. basic.init() selects the html div we'll be\n",
" // rendering the html into, adds styles.css to the document.\n",
" define('basic', ['d3'],\n",
" function (d3) {\n",
" return {\n",
" init: function (viz_id = null) {\n",
" if (viz_id == null) {\n",
" viz_id = \"viz_\" + Math.round(Math.random() * 10000000)\n",
" }\n",
" // Select the div rendered below, change its id\n",
" const div = d3.select('#basic').attr('id', viz_id),\n",
" div_parent = d3.select('#' + viz_id).node().parentNode\n",
"\n",
" // Link to CSS file\n",
" d3.select(div_parent).insert('link')\n",
" .attr('rel', 'stylesheet')\n",
" .attr('type', 'text/css')\n",
" .attr('href', ecco_url + 'html/0.0.2/styles.css')\n",
"\n",
" return viz_id\n",
" }\n",
" }\n",
" }, function (err) {\n",
" console.log(err);\n",
" }\n",
" )\n",
"</script>\n",
"\n",
"<head>\n",
" <link id='css' rel=\"stylesheet\" type=\"text/css\">\n",
"</head>\n",
"<div id=\"basic\"></div>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"application/javascript": [
"\n",
" requirejs(['basic', 'ecco'], function(basic, ecco){\n",
" const viz_id = basic.init()\n",
"\n",
"\n",
" let pred = new ecco.LayerPredictions({\n",
" parentDiv: viz_id,\n",
" data:[[{\"token\": \" \\u05e9\\u05dc\\u05d5\\u05e9\", \"prob\": \"0.14951321\", \"ranking\": 1, \"layer\": 5}, {\"token\": \" \\u05d0\\u05e8\\u05d1\\u05e2\", \"prob\": \"0.06760427\", \"ranking\": 2, \"layer\": 5}, {\"token\": \" \\u05d0\\u05d7\\u05ea\", \"prob\": \"0.030091796\", \"ranking\": 3, \"layer\": 5}, {\"token\": \" \\u05d7\\u05de\\u05e9\", \"prob\": \"0.026008524\", \"ranking\": 4, \"layer\": 5}, {\"token\": \" \\u05e9\\u05ea\\u05d9\\u05d9\\u05dd\", \"prob\": \"0.025451118\", \"ranking\": 5, \"layer\": 5}, {\"token\": \" \\u05e9\\u05ea\\u05d9\", \"prob\": \"0.019003097\", \"ranking\": 6, \"layer\": 5}, {\"token\": \" \\u05e9\\u05e9\", \"prob\": \"0.011010679\", \"ranking\": 7, \"layer\": 5}, {\"token\": \" \\u05e9\\u05dc\\u05d5\\u05e9\\u05d4\", \"prob\": \"0.010212517\", \"ranking\": 8, \"layer\": 5}, {\"token\": \" \\u05e2\\u05e9\\u05e8\", \"prob\": \"0.009632629\", \"ranking\": 9, \"layer\": 5}, {\"token\": \" \\u05d5\\u05d0\\u05d7\\u05ea\", \"prob\": \"0.009528104\", \"ranking\": 10, \"layer\": 5}]]\n",
" })\n",
" pred.init()\n",
" }, function (err) {\n",
" console.log(viz_id, err);\n",
" })"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "t_-xqYY7Wqab"
},
"source": [
"## Fill in the blank: \"____ הכותל המערבי נמצא בעיר\""
]
},
{
"cell_type": "code",
"metadata": {
"id": "tQp2xgISJPMu",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 50
},
"outputId": "8e87a908-9a52-4837-88e3-b07283c84edf"
},
"source": [
"text= \" הכותל המערבי נמצא בעיר\"\n",
"\n",
"output = lm.generate(text, generate=1, do_sample=False)"
],
"execution_count": 7,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/html": [
"<html lang=\"en\">\n",
"<script src=\"https://requirejs.org/docs/release/2.3.6/minified/require.js\"></script>\n",
"<script>\n",
" var ecco_url = 'https://storage.googleapis.com/ml-intro/ecco/'\n",
" //var ecco_url = 'http://localhost:8000/'\n",
"\n",
" if (window.ecco === undefined) window.ecco = {}\n",
"\n",
" // Setup the paths of the script we'll be using\n",
" requirejs.config({\n",
" urlArgs: \"bust=\" + (new Date()).getTime(),\n",
" nodeRequire: require,\n",
" paths: {\n",
" d3: \"https://d3js.org/d3.v6.min\", // This is only for use in setup.html and basic.html\n",
" \"d3-array\": \"https://d3js.org/d3-array.v2.min\",\n",
" jquery: \"https://code.jquery.com/jquery-3.5.1.min\",\n",
" ecco: ecco_url + 'js/0.0.6/ecco-bundle.min',\n",
" xregexp: 'https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min'\n",
" }\n",
" });\n",
"\n",
" // Add the css file\n",
" //requirejs(['d3'],\n",
" // function (d3) {\n",
" // d3.select('#css').attr('href', ecco_url + 'html/styles.css')\n",
" // })\n",
"\n",
" console.log('Ecco initialize!!')\n",
"\n",
" // returns a 'basic' object. basic.init() selects the html div we'll be\n",
" // rendering the html into, adds styles.css to the document.\n",
" define('basic', ['d3'],\n",
" function (d3) {\n",
" return {\n",
" init: function (viz_id = null) {\n",
" if (viz_id == null) {\n",
" viz_id = \"viz_\" + Math.round(Math.random() * 10000000)\n",
" }\n",
" // Select the div rendered below, change its id\n",
" const div = d3.select('#basic').attr('id', viz_id),\n",
" div_parent = d3.select('#' + viz_id).node().parentNode\n",
"\n",
" // Link to CSS file\n",
" d3.select(div_parent).insert('link')\n",
" .attr('rel', 'stylesheet')\n",
" .attr('type', 'text/css')\n",
" .attr('href', ecco_url + 'html/0.0.2/styles.css')\n",
"\n",
" return viz_id\n",
" }\n",
" }\n",
" }, function (err) {\n",
" console.log(err);\n",
" }\n",
" )\n",
"</script>\n",
"\n",
"<head>\n",
" <link id='css' rel=\"stylesheet\" type=\"text/css\">\n",
"</head>\n",
"<div id=\"basic\"></div>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"application/javascript": [
"\n",
" requirejs( ['basic', 'ecco'], function(basic, ecco){\n",
" basic.init('viz_364214') // Python needs to know the viz id. Used for each output token.\n",
" window.ecco['viz_364214'] = new ecco.renderOutputSequence({\n",
" parentDiv: 'viz_364214',\n",
" data: {\"tokens\": [{\"token\": \"\\u05d4\\u05db\\u05d5\\u05ea\\u05dc\", \"is_partial\": false, \"position\": 0, \"token_id\": 13838, \"type\": \"input\"}, {\"token\": \"\\u05d4\\u05de\\u05e2\\u05e8\\u05d1\\u05d9\", \"is_partial\": false, \"position\": 1, \"token_id\": 5525, \"type\": \"input\"}, {\"token\": \"\\u05e0\\u05de\\u05e6\\u05d0\", \"is_partial\": false, \"position\": 2, \"token_id\": 2285, \"type\": \"input\"}, {\"token\": \"\\u05d1\\u05e2\\u05d9\\u05e8\", \"is_partial\": false, \"position\": 3, \"token_id\": 1681, \"type\": \"input\"}]},\n",
" tokenization_config: {\"token_prefix\": \"\\u0120\", \"partial_token_prefix\": \"\"}\n",
" \n",
" })\n",
" }, function (err) {\n",
" console.log(err);\n",
" })\n",
" "
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"application/javascript": [
"\n",
" // We don't really need these require scripts. But this is to avert\n",
" //this code from running before display_input_sequence which DOES require external files\n",
" requirejs(['basic', 'ecco'], function(basic, ecco){\n",
" console.log('addToken viz_id', 'viz_364214');\n",
" window.ecco['viz_364214'].addToken({\"token\": \"\\u05d4\\u05e2\\u05ea\\u05d9\\u05e7\\u05d4\", \"is_partial\": false, \"token_id\": 5889, \"position\": 4, \"type\": \"output\"})\n",
" window.ecco['viz_364214'].redraw()\n",
" })\n",
" "
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "czxFXc8kJb-d",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 210
},
"outputId": "d77bd3a7-4ab2-4200-92da-7fdf1d82ed58"
},
"source": [
"# Visualize the candidate tokens at the last layer of the model (layer 5)\n",
"output.layer_predictions(position=4, layer=5) \n"
],
"execution_count": 8,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/html": [
"<html lang=\"en\">\n",
"<script src=\"https://requirejs.org/docs/release/2.3.6/minified/require.js\"></script>\n",
"<script>\n",
" var ecco_url = 'https://storage.googleapis.com/ml-intro/ecco/'\n",
" //var ecco_url = 'http://localhost:8000/'\n",
"\n",
" if (window.ecco === undefined) window.ecco = {}\n",
"\n",
" // Setup the paths of the script we'll be using\n",
" requirejs.config({\n",
" urlArgs: \"bust=\" + (new Date()).getTime(),\n",
" nodeRequire: require,\n",
" paths: {\n",
" d3: \"https://d3js.org/d3.v6.min\", // This is only for use in setup.html and basic.html\n",
" \"d3-array\": \"https://d3js.org/d3-array.v2.min\",\n",
" jquery: \"https://code.jquery.com/jquery-3.5.1.min\",\n",
" ecco: ecco_url + 'js/0.0.6/ecco-bundle.min',\n",
" xregexp: 'https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min'\n",
" }\n",
" });\n",
"\n",
" // Add the css file\n",
" //requirejs(['d3'],\n",
" // function (d3) {\n",
" // d3.select('#css').attr('href', ecco_url + 'html/styles.css')\n",
" // })\n",
"\n",
" console.log('Ecco initialize!!')\n",
"\n",
" // returns a 'basic' object. basic.init() selects the html div we'll be\n",
" // rendering the html into, adds styles.css to the document.\n",
" define('basic', ['d3'],\n",
" function (d3) {\n",
" return {\n",
" init: function (viz_id = null) {\n",
" if (viz_id == null) {\n",
" viz_id = \"viz_\" + Math.round(Math.random() * 10000000)\n",
" }\n",
" // Select the div rendered below, change its id\n",
" const div = d3.select('#basic').attr('id', viz_id),\n",
" div_parent = d3.select('#' + viz_id).node().parentNode\n",
"\n",
" // Link to CSS file\n",
" d3.select(div_parent).insert('link')\n",
" .attr('rel', 'stylesheet')\n",
" .attr('type', 'text/css')\n",
" .attr('href', ecco_url + 'html/0.0.2/styles.css')\n",
"\n",
" return viz_id\n",
" }\n",
" }\n",
" }, function (err) {\n",
" console.log(err);\n",
" }\n",
" )\n",
"</script>\n",
"\n",
"<head>\n",
" <link id='css' rel=\"stylesheet\" type=\"text/css\">\n",
"</head>\n",
"<div id=\"basic\"></div>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"application/javascript": [
"\n",
" requirejs(['basic', 'ecco'], function(basic, ecco){\n",
" const viz_id = basic.init()\n",
"\n",
"\n",
" let pred = new ecco.LayerPredictions({\n",
" parentDiv: viz_id,\n",
" data:[[{\"token\": \" \\u05d4\\u05e2\\u05ea\\u05d9\\u05e7\\u05d4\", \"prob\": \"0.32119083\", \"ranking\": 1, \"layer\": 5}, {\"token\": \",\", \"prob\": \"0.06963285\", \"ranking\": 2, \"layer\": 5}, {\"token\": \".\", \"prob\": \"0.054799292\", \"ranking\": 3, \"layer\": 5}, {\"token\": \" \\u05d1\\u05d9\\u05ea\", \"prob\": \"0.022746645\", \"ranking\": 4, \"layer\": 5}, {\"token\": \" \\u05d9\\u05e8\\u05d5\\u05e9\\u05dc\\u05d9\\u05dd\", \"prob\": \"0.01488143\", \"ranking\": 5, \"layer\": 5}, {\"token\": \" \\u05d7\\u05d1\\u05e8\\u05d5\\u05df\", \"prob\": \"0.011863763\", \"ranking\": 6, \"layer\": 5}, {\"token\": \" \\u05d4\\u05e7\\u05d5\\u05d3\\u05e9\", \"prob\": \"0.009314213\", \"ranking\": 7, \"layer\": 5}, {\"token\": \" \\u05e6\\u05e4\\u05ea\", \"prob\": \"0.0087441495\", \"ranking\": 8, \"layer\": 5}, {\"token\": \" \\u05d4\\u05e1\\u05de\\u05d5\\u05db\\u05d4\", \"prob\": \"0.0076924413\", \"ranking\": 9, \"layer\": 5}, {\"token\": \" \\u05de\\u05d5\\u05d3\\u05d9\\u05e2\\u05d9\\u05df\", \"prob\": \"0.006461452\", \"ranking\": 10, \"layer\": 5}]]\n",
" })\n",
" pred.init()\n",
" }, function (err) {\n",
" console.log(viz_id, err);\n",
" })"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "GIS5Kw_GJiAv",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"outputId": "210f8454-567f-4dfa-82d0-7c3b8f6be856"
},
"source": [
"# Visualize the candidate tokens at every layer\n",
"output.layer_predictions(position=4) "
],
"execution_count": 9,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/html": [
"<html lang=\"en\">\n",
"<script src=\"https://requirejs.org/docs/release/2.3.6/minified/require.js\"></script>\n",
"<script>\n",
" var ecco_url = 'https://storage.googleapis.com/ml-intro/ecco/'\n",
" //var ecco_url = 'http://localhost:8000/'\n",
"\n",
" if (window.ecco === undefined) window.ecco = {}\n",
"\n",
" // Setup the paths of the script we'll be using\n",
" requirejs.config({\n",
" urlArgs: \"bust=\" + (new Date()).getTime(),\n",
" nodeRequire: require,\n",
" paths: {\n",
" d3: \"https://d3js.org/d3.v6.min\", // This is only for use in setup.html and basic.html\n",
" \"d3-array\": \"https://d3js.org/d3-array.v2.min\",\n",
" jquery: \"https://code.jquery.com/jquery-3.5.1.min\",\n",
" ecco: ecco_url + 'js/0.0.6/ecco-bundle.min',\n",
" xregexp: 'https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min'\n",
" }\n",
" });\n",
"\n",
" // Add the css file\n",
" //requirejs(['d3'],\n",
" // function (d3) {\n",
" // d3.select('#css').attr('href', ecco_url + 'html/styles.css')\n",
" // })\n",
"\n",
" console.log('Ecco initialize!!')\n",
"\n",
" // returns a 'basic' object. basic.init() selects the html div we'll be\n",
" // rendering the html into, adds styles.css to the document.\n",
" define('basic', ['d3'],\n",
" function (d3) {\n",
" return {\n",
" init: function (viz_id = null) {\n",
" if (viz_id == null) {\n",
" viz_id = \"viz_\" + Math.round(Math.random() * 10000000)\n",
" }\n",
" // Select the div rendered below, change its id\n",
" const div = d3.select('#basic').attr('id', viz_id),\n",
" div_parent = d3.select('#' + viz_id).node().parentNode\n",
"\n",
" // Link to CSS file\n",
" d3.select(div_parent).insert('link')\n",
" .attr('rel', 'stylesheet')\n",
" .attr('type', 'text/css')\n",
" .attr('href', ecco_url + 'html/0.0.2/styles.css')\n",
"\n",
" return viz_id\n",
" }\n",
" }\n",
" }, function (err) {\n",
" console.log(err);\n",
" }\n",
" )\n",
"</script>\n",
"\n",
"<head>\n",
" <link id='css' rel=\"stylesheet\" type=\"text/css\">\n",
"</head>\n",
"<div id=\"basic\"></div>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"application/javascript": [
"\n",
" requirejs(['basic', 'ecco'], function(basic, ecco){\n",
" const viz_id = basic.init()\n",
"\n",
"\n",
" let pred = new ecco.LayerPredictions({\n",
" parentDiv: viz_id,\n",
" data:[[{\"token\": \" \\u05d9\\u05d5\\u05ea\\u05e8\", \"prob\": \"1.0\", \"ranking\": 1, \"layer\": 0}, {\"token\": \" \\u05e2\\u05d5\\u05d3\", \"prob\": \"1.3880409e-13\", \"ranking\": 2, \"layer\": 0}, {\"token\": \" \\u05db\\u05d3\\u05d9\", \"prob\": \"8.45e-43\", \"ranking\": 3, \"layer\": 0}, {\"token\": \"\\ufffd\\u05d9\\u05de\\u05d9\\u05d6\\u05dd\", \"prob\": \"0.0\", \"ranking\": 4, \"layer\": 0}, {\"token\": \"\\ufffd\\u05d9\\u05d7\\u05d5\\u05ea\", \"prob\": \"0.0\", \"ranking\": 5, \"layer\": 0}, {\"token\": \" \\u05d1\\u05d9\\u05e0\\u05d5\\u05e0\\u05d9\", \"prob\": \"0.0\", \"ranking\": 6, \"layer\": 0}, {\"token\": \" \\u05d1\\u05d9\\u05d3\\u05d9\\u05d4\\u05dd\", \"prob\": \"0.0\", \"ranking\": 7, \"layer\": 0}, {\"token\": \" \\u05d1\\u05d9\\u05e6\\u05d9\\u05e8\\u05d5\\u05ea\", \"prob\": \"0.0\", \"ranking\": 8, \"layer\": 0}, {\"token\": \" \\u05d1\\u05d9\\u05e6\\u05d9\\u05e8\\u05ea\", \"prob\": \"0.0\", \"ranking\": 9, \"layer\": 0}, {\"token\": \" \\u05d1\\u05d9\\u05ea\\u05e8\", \"prob\": \"0.0\", \"ranking\": 10, \"layer\": 0}], [{\"token\": \" \\u05e2\\u05d5\\u05d3\", \"prob\": \"0.6593503\", \"ranking\": 1, \"layer\": 1}, {\"token\": \" \\u05d1\\u05d4\\u05d9\\u05e7\\u05e3\", \"prob\": \"0.34064963\", \"ranking\": 2, \"layer\": 1}, {\"token\": \" \\u05d9\\u05d5\\u05ea\\u05e8\", \"prob\": \"3.05e-43\", \"ranking\": 3, \"layer\": 1}, {\"token\": \"\\ufffd\\u05d9\\u05de\\u05d9\\u05d6\\u05dd\", \"prob\": \"0.0\", \"ranking\": 4, \"layer\": 1}, {\"token\": \"\\ufffd\\u05d9\\u05d7\\u05d5\\u05ea\", \"prob\": \"0.0\", \"ranking\": 5, \"layer\": 1}, {\"token\": \" \\u05d1\\u05d9\\u05e0\\u05d5\\u05e0\\u05d9\", \"prob\": \"0.0\", \"ranking\": 6, \"layer\": 1}, {\"token\": \" \\u05d1\\u05d9\\u05d3\\u05d9\\u05d4\\u05dd\", \"prob\": \"0.0\", \"ranking\": 7, \"layer\": 1}, {\"token\": \" \\u05d1\\u05d9\\u05e6\\u05d9\\u05e8\\u05d5\\u05ea\", \"prob\": \"0.0\", \"ranking\": 8, \"layer\": 1}, {\"token\": \" \\u05d1\\u05d9\\u05e6\\u05d9\\u05e8\\u05ea\", \"prob\": \"0.0\", \"ranking\": 9, \"layer\": 1}, {\"token\": \" \\u05d1\\u05d9\\u05ea\\u05e8\", \"prob\": \"0.0\", \"ranking\": 10, \"layer\": 1}], [{\"token\": \" \\u05d0\\u05d7\\u05e8\\u05ea\", \"prob\": \"1.0\", \"ranking\": 1, \"layer\": 2}, {\"token\": \" \\u05d1\\u05d4\\u05d9\\u05e7\\u05e3\", \"prob\": \"1.06e-43\", \"ranking\": 2, \"layer\": 2}, {\"token\": \"\\ufffd\\u05d9\\u05d7\\u05d5\\u05ea\", \"prob\": \"0.0\", \"ranking\": 3, \"layer\": 2}, {\"token\": \" \\u05d1\\u05d9\\u05e0\\u05d5\\u05e0\\u05d9\", \"prob\": \"0.0\", \"ranking\": 4, \"layer\": 2}, {\"token\": \" \\u05d1\\u05d9\\u05d3\\u05d9\\u05d4\\u05dd\", \"prob\": \"0.0\", \"ranking\": 5, \"layer\": 2}, {\"token\": \" \\u05d1\\u05d9\\u05e6\\u05d9\\u05e8\\u05d5\\u05ea\", \"prob\": \"0.0\", \"ranking\": 6, \"layer\": 2}, {\"token\": \" \\u05d1\\u05d9\\u05e6\\u05d9\\u05e8\\u05ea\", \"prob\": \"0.0\", \"ranking\": 7, \"layer\": 2}, {\"token\": \" \\u05d1\\u05d9\\u05ea\\u05e8\", \"prob\": \"0.0\", \"ranking\": 8, \"layer\": 2}, {\"token\": \" \\u05d1\\u05d9\\u05e7\\u05e8\", \"prob\": \"0.0\", \"ranking\": 9, \"layer\": 2}, {\"token\": \" \\u05d1\\u05d9\\u05e8\\u05da\", \"prob\": \"0.0\", \"ranking\": 10, \"layer\": 2}], [{\"token\": \" \\u05d0\\u05d7\\u05e8\\u05ea\", \"prob\": \"1.0\", \"ranking\": 1, \"layer\": 3}, {\"token\": \"\\ufffd\\u05d9\\u05d7\\u05d5\\u05ea\", \"prob\": \"0.0\", \"ranking\": 2, \"layer\": 3}, {\"token\": \" \\u05d1\\u05d9\\u05e0\\u05d5\\u05e0\\u05d9\", \"prob\": \"0.0\", \"ranking\": 3, \"layer\": 3}, {\"token\": \" \\u05d1\\u05d9\\u05d3\\u05d9\\u05d4\\u05dd\", \"prob\": \"0.0\", \"ranking\": 4, \"layer\": 3}, {\"token\": \" \\u05d1\\u05d9\\u05e6\\u05d9\\u05e8\\u05d5\\u05ea\", \"prob\": \"0.0\", \"ranking\": 5, \"layer\": 3}, {\"token\": \" \\u05d1\\u05d9\\u05e6\\u05d9\\u05e8\\u05ea\", \"prob\": \"0.0\", \"ranking\": 6, \"layer\": 3}, {\"token\": \" \\u05d1\\u05d9\\u05ea\\u05e8\", \"prob\": \"0.0\", \"ranking\": 7, \"layer\": 3}, {\"token\": \" \\u05d1\\u05d9\\u05e7\\u05e8\", \"prob\": \"0.0\", \"ranking\": 8, \"layer\": 3}, {\"token\": \" \\u05d1\\u05d9\\u05e8\\u05da\", \"prob\": \"0.0\", \"ranking\": 9, \"layer\": 3}, {\"token\": \" \\u05d1\\u05d9\\u05d1\\u05d9\", \"prob\": \"0.0\", \"ranking\": 10, \"layer\": 3}], [{\"token\": \" \\u05d0\\u05d7\\u05e8\\u05ea\", \"prob\": \"1.0\", \"ranking\": 1, \"layer\": 4}, {\"token\": \"\\ufffd\\u05d9\\u05d7\\u05d5\\u05ea\", \"prob\": \"0.0\", \"ranking\": 2, \"layer\": 4}, {\"token\": \" \\u05d1\\u05d9\\u05e0\\u05d5\\u05e0\\u05d9\", \"prob\": \"0.0\", \"ranking\": 3, \"layer\": 4}, {\"token\": \" \\u05d1\\u05d9\\u05d3\\u05d9\\u05d4\\u05dd\", \"prob\": \"0.0\", \"ranking\": 4, \"layer\": 4}, {\"token\": \" \\u05d1\\u05d9\\u05e6\\u05d9\\u05e8\\u05d5\\u05ea\", \"prob\": \"0.0\", \"ranking\": 5, \"layer\": 4}, {\"token\": \" \\u05d1\\u05d9\\u05e6\\u05d9\\u05e8\\u05ea\", \"prob\": \"0.0\", \"ranking\": 6, \"layer\": 4}, {\"token\": \" \\u05d1\\u05d9\\u05ea\\u05e8\", \"prob\": \"0.0\", \"ranking\": 7, \"layer\": 4}, {\"token\": \" \\u05d1\\u05d9\\u05e7\\u05e8\", \"prob\": \"0.0\", \"ranking\": 8, \"layer\": 4}, {\"token\": \" \\u05d1\\u05d9\\u05e8\\u05da\", \"prob\": \"0.0\", \"ranking\": 9, \"layer\": 4}, {\"token\": \" \\u05d1\\u05d9\\u05d1\\u05d9\", \"prob\": \"0.0\", \"ranking\": 10, \"layer\": 4}], [{\"token\": \" \\u05d4\\u05e2\\u05ea\\u05d9\\u05e7\\u05d4\", \"prob\": \"0.32119083\", \"ranking\": 1, \"layer\": 5}, {\"token\": \",\", \"prob\": \"0.06963285\", \"ranking\": 2, \"layer\": 5}, {\"token\": \".\", \"prob\": \"0.054799292\", \"ranking\": 3, \"layer\": 5}, {\"token\": \" \\u05d1\\u05d9\\u05ea\", \"prob\": \"0.022746645\", \"ranking\": 4, \"layer\": 5}, {\"token\": \" \\u05d9\\u05e8\\u05d5\\u05e9\\u05dc\\u05d9\\u05dd\", \"prob\": \"0.01488143\", \"ranking\": 5, \"layer\": 5}, {\"token\": \" \\u05d7\\u05d1\\u05e8\\u05d5\\u05df\", \"prob\": \"0.011863763\", \"ranking\": 6, \"layer\": 5}, {\"token\": \" \\u05d4\\u05e7\\u05d5\\u05d3\\u05e9\", \"prob\": \"0.009314213\", \"ranking\": 7, \"layer\": 5}, {\"token\": \" \\u05e6\\u05e4\\u05ea\", \"prob\": \"0.0087441495\", \"ranking\": 8, \"layer\": 5}, {\"token\": \" \\u05d4\\u05e1\\u05de\\u05d5\\u05db\\u05d4\", \"prob\": \"0.0076924413\", \"ranking\": 9, \"layer\": 5}, {\"token\": \" \\u05de\\u05d5\\u05d3\\u05d9\\u05e2\\u05d9\\u05df\", \"prob\": \"0.006461452\", \"ranking\": 10, \"layer\": 5}]]\n",
" })\n",
" pred.init()\n",
" }, function (err) {\n",
" console.log(viz_id, err);\n",
" })"
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
},
"metadata": {}
}
]
}
]
}
@Norod

Norod commented Jan 4, 2022

Copy link
Copy Markdown
Author

Screenshot 2022-01-04 220118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment