diff --git a/demos/colab_demo.ipynb b/demos/colab_demo.ipynb index 6e5baed..25d4ae7 100644 --- a/demos/colab_demo.ipynb +++ b/demos/colab_demo.ipynb @@ -27,7 +27,7 @@ "accelerator": "GPU", "widgets": { "application/vnd.jupyter.widget-state+json": { - "9eac029aa8a34135b1e619837a0d501f": { + "9695e0e8562c4104b8e28a25bf05991e": { "model_module": "@jupyter-widgets/controls", "model_name": "HBoxModel", "state": { @@ -39,15 +39,15 @@ "_view_count": null, "_view_module_version": "1.5.0", "box_style": "", - "layout": "IPY_MODEL_1992924072de4a6d8db0fea6094274ae", + "layout": "IPY_MODEL_7e7d388cb3ea475098dcca168cba2635", "_model_module": "@jupyter-widgets/controls", "children": [ - "IPY_MODEL_cc7c647ebc3342eca5fcc1c027dd0a7d", - "IPY_MODEL_c75bc40d75c744e0b8518ebbe4f4cb00" + "IPY_MODEL_7424952a9ad34bc9a0094ed6df2881ab", + "IPY_MODEL_bd39d9cea7f949babdb9048b41f4055f" ] } }, - "1992924072de4a6d8db0fea6094274ae": { + "7e7d388cb3ea475098dcca168cba2635": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "state": { @@ -98,50 +98,50 @@ "left": null } }, - "cc7c647ebc3342eca5fcc1c027dd0a7d": { + "7424952a9ad34bc9a0094ed6df2881ab": { "model_module": "@jupyter-widgets/controls", "model_name": "FloatProgressModel", "state": { "_view_name": "ProgressView", - "style": "IPY_MODEL_817e672c133e484fa8a12fa0130b3336", + "style": "IPY_MODEL_fee217673faf4424883be8bf33574584", "_dom_classes": [], - "description": "100%", + "description": "Downloading: 100%", "_model_name": "FloatProgressModel", "bar_style": "success", - "max": 1, + "max": 3708092, "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", - "value": 1, + "value": 3708092, "_view_count": null, "_view_module_version": "1.5.0", "orientation": "horizontal", "min": 0, "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_b25f76f8822d4ae8965a3950a28e651e" + "layout": "IPY_MODEL_2ad1b48139f14387bac9b6046b0d8d60" } }, - "c75bc40d75c744e0b8518ebbe4f4cb00": { + "bd39d9cea7f949babdb9048b41f4055f": { "model_module": "@jupyter-widgets/controls", "model_name": "HTMLModel", "state": { "_view_name": "HTMLView", - "style": "IPY_MODEL_44bffa64c51b4752ac983d08ea8f00f3", + "style": "IPY_MODEL_79733c788f914b66a5803f1b71554c26", "_dom_classes": [], "description": "", "_model_name": "HTMLModel", "placeholder": "​", "_view_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", - "value": " 1/1 [00:03<00:00, 3.89s/it]", + "value": " 3.71M/3.71M [00:03<00:00, 1.22MB/s]", "_view_count": null, "_view_module_version": "1.5.0", "description_tooltip": null, "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_6d1c65c8195f4f26895bfb3a9092fba4" + "layout": "IPY_MODEL_cdc4f3fc6bf34edfa6ed14d1edc1c0da" } }, - "817e672c133e484fa8a12fa0130b3336": { + "fee217673faf4424883be8bf33574584": { "model_module": "@jupyter-widgets/controls", "model_name": "ProgressStyleModel", "state": { @@ -156,7 +156,7 @@ "_model_module": "@jupyter-widgets/controls" } }, - "b25f76f8822d4ae8965a3950a28e651e": { + "2ad1b48139f14387bac9b6046b0d8d60": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "state": { @@ -207,7 +207,7 @@ "left": null } }, - "44bffa64c51b4752ac983d08ea8f00f3": { + "79733c788f914b66a5803f1b71554c26": { "model_module": "@jupyter-widgets/controls", "model_name": "DescriptionStyleModel", "state": { @@ -221,7 +221,1232 @@ "_model_module": "@jupyter-widgets/controls" } }, - "6d1c65c8195f4f26895bfb3a9092fba4": { + "cdc4f3fc6bf34edfa6ed14d1edc1c0da": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "451f6d64f9d14cfe821ef82af4313223": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HBoxModel", + "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_d213c156b7f941de86f89704200898cc", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_d2ab70c5a6b24d3582e13bd7300e4b48", + "IPY_MODEL_d596d132f81a4577ab6eeff01c858f4a" + ] + } + }, + "d213c156b7f941de86f89704200898cc": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "d2ab70c5a6b24d3582e13bd7300e4b48": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_e4ef14da423a4e37b23815228dff047c", + "_dom_classes": [], + "description": "Downloading: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 2423393, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 2423393, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_f489df53fce4489c85248d0a0fc0347b" + } + }, + "d596d132f81a4577ab6eeff01c858f4a": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_347117e2b4084588af0120de4cba9992", + "_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, 5.19MB/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_f7dde0ddeb954feeb6334f91957b3b4f" + } + }, + "e4ef14da423a4e37b23815228dff047c": { + "model_module": "@jupyter-widgets/controls", + "model_name": "ProgressStyleModel", + "state": { + "_view_name": "StyleView", + "_model_name": "ProgressStyleModel", + "description_width": "initial", + "_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" + } + }, + "f489df53fce4489c85248d0a0fc0347b": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "347117e2b4084588af0120de4cba9992": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "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" + } + }, + "f7dde0ddeb954feeb6334f91957b3b4f": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "d85f7d324e534e7fb7665440581927af": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HBoxModel", + "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_36a4ac5796544fe5b50e802cd0b4b599", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_65782adbd1e943f39a3d282e4f217daf", + "IPY_MODEL_d78f6159d9fe4b0e840b2d1912a253d8" + ] + } + }, + "36a4ac5796544fe5b50e802cd0b4b599": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "65782adbd1e943f39a3d282e4f217daf": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_db2021d70d584ef987b1580962ad919c", + "_dom_classes": [], + "description": "Downloading: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 272, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 272, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_2cc9fc8c66aa4381ab3a6e742d0547dc" + } + }, + "d78f6159d9fe4b0e840b2d1912a253d8": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_256273b11d094044a36d0056498cc487", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 272/272 [00:01<00:00, 236B/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_361e88b5998d4df996113c7b6c55bd1e" + } + }, + "db2021d70d584ef987b1580962ad919c": { + "model_module": "@jupyter-widgets/controls", + "model_name": "ProgressStyleModel", + "state": { + "_view_name": "StyleView", + "_model_name": "ProgressStyleModel", + "description_width": "initial", + "_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" + } + }, + "2cc9fc8c66aa4381ab3a6e742d0547dc": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "256273b11d094044a36d0056498cc487": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "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" + } + }, + "361e88b5998d4df996113c7b6c55bd1e": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "0236fdbddbcc4049b48713bb17ba4b74": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HBoxModel", + "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_878fc2e400354baf84a8a134d9038174", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_e2a4fd0970f94aeb8b841870d95662a8", + "IPY_MODEL_bc263f4b7ac94cfeaa7609341d5394e2" + ] + } + }, + "878fc2e400354baf84a8a134d9038174": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "e2a4fd0970f94aeb8b841870d95662a8": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_266b8b8d1dda42afa1b5fdafb66af4ac", + "_dom_classes": [], + "description": "Downloading: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 1140, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 1140, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_dc8604c9207b4a8ca364a817c6516378" + } + }, + "bc263f4b7ac94cfeaa7609341d5394e2": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_f1958b44d65243a0b4ca5ba2803d3598", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 1.14k/1.14k [00:00<00:00, 2.38kB/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_d26580979feb41cdb423d151bd5ebd15" + } + }, + "266b8b8d1dda42afa1b5fdafb66af4ac": { + "model_module": "@jupyter-widgets/controls", + "model_name": "ProgressStyleModel", + "state": { + "_view_name": "StyleView", + "_model_name": "ProgressStyleModel", + "description_width": "initial", + "_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" + } + }, + "dc8604c9207b4a8ca364a817c6516378": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "f1958b44d65243a0b4ca5ba2803d3598": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "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" + } + }, + "d26580979feb41cdb423d151bd5ebd15": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "e7a58c85b79041eaaeeb9a9c3fa102aa": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HBoxModel", + "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_57b95194b9c0404d84ee4a73208e10b0", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_477c9d28d9624f448b75b8c38207fed5", + "IPY_MODEL_e2e7b8f3477c4fd486a0602377992efe" + ] + } + }, + "57b95194b9c0404d84ee4a73208e10b0": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "477c9d28d9624f448b75b8c38207fed5": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_72755dae20114e74a26fa5f556eed8c8", + "_dom_classes": [], + "description": "Downloading: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 908, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 908, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_c961071096794f7580d0d37db02e8ff0" + } + }, + "e2e7b8f3477c4fd486a0602377992efe": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_cf26e32a7c6b48caa2d7727365d33da3", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 908/908 [00:00<00:00, 25.8kB/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_2edbb013778f4cb2a05510875c8b1d66" + } + }, + "72755dae20114e74a26fa5f556eed8c8": { + "model_module": "@jupyter-widgets/controls", + "model_name": "ProgressStyleModel", + "state": { + "_view_name": "StyleView", + "_model_name": "ProgressStyleModel", + "description_width": "initial", + "_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" + } + }, + "c961071096794f7580d0d37db02e8ff0": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "cf26e32a7c6b48caa2d7727365d33da3": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "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" + } + }, + "2edbb013778f4cb2a05510875c8b1d66": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "b4bb0987873c46f9865e5308e2cd6cab": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HBoxModel", + "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_8fa51cc1231146d9be01452d4baedcab", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_5123c4c6e7524b4983ca0701394af3a0", + "IPY_MODEL_4d97b210440f431bb5440d5b3b49032b" + ] + } + }, + "8fa51cc1231146d9be01452d4baedcab": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "5123c4c6e7524b4983ca0701394af3a0": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_d5a94e8542ac48babbc228b80e8c5c91", + "_dom_classes": [], + "description": "Downloading: 63%", + "_model_name": "FloatProgressModel", + "bar_style": "", + "max": 1935796948, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 1223096320, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_47f2a197eb0b47d583ec331a89a7657f" + } + }, + "4d97b210440f431bb5440d5b3b49032b": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_c1998ef598ff4359b0de7961665dba6d", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 1.22G/1.94G [00:22<00:13, 52.5MB/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_ba0a677b24604277981595701dfc4574" + } + }, + "d5a94e8542ac48babbc228b80e8c5c91": { + "model_module": "@jupyter-widgets/controls", + "model_name": "ProgressStyleModel", + "state": { + "_view_name": "StyleView", + "_model_name": "ProgressStyleModel", + "description_width": "initial", + "_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" + } + }, + "47f2a197eb0b47d583ec331a89a7657f": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "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 + } + }, + "c1998ef598ff4359b0de7961665dba6d": { + "model_module": "@jupyter-widgets/controls", + "model_name": "DescriptionStyleModel", + "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" + } + }, + "ba0a677b24604277981595701dfc4574": { "model_module": "@jupyter-widgets/base", "model_name": "LayoutModel", "state": { @@ -310,13 +1535,29 @@ "trusted": true, "_kg_hide-input": false, "_kg_hide-output": true, - "id": "BI3mAoRnYIiF" + "id": "BI3mAoRnYIiF", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "c5674616-a545-4a8a-9813-b127c1777efa" }, "source": [ "!pip install -q dl-translate" ], - "execution_count": 4, - "outputs": [] + "execution_count": 1, + "outputs": [ + { + "output_type": "stream", + "text": [ + "\u001b[K |████████████████████████████████| 1.2MB 9.2MB/s \n", + "\u001b[K |████████████████████████████████| 2.2MB 29.2MB/s \n", + "\u001b[K |████████████████████████████████| 870kB 50.4MB/s \n", + "\u001b[K |████████████████████████████████| 3.3MB 51.1MB/s \n", + "\u001b[?25h Building wheel for sacremoses (setup.py) ... \u001b[?25l\u001b[?25hdone\n" + ], + "name": "stdout" + } + ] }, { "cell_type": "markdown", @@ -333,35 +1574,201 @@ "trusted": true, "colab": { "base_uri": "https://localhost:8080/", - "height": 36 + "height": 300, + "referenced_widgets": [ + "9695e0e8562c4104b8e28a25bf05991e", + "7e7d388cb3ea475098dcca168cba2635", + "7424952a9ad34bc9a0094ed6df2881ab", + "bd39d9cea7f949babdb9048b41f4055f", + "fee217673faf4424883be8bf33574584", + "2ad1b48139f14387bac9b6046b0d8d60", + "79733c788f914b66a5803f1b71554c26", + "cdc4f3fc6bf34edfa6ed14d1edc1c0da", + "451f6d64f9d14cfe821ef82af4313223", + "d213c156b7f941de86f89704200898cc", + "d2ab70c5a6b24d3582e13bd7300e4b48", + "d596d132f81a4577ab6eeff01c858f4a", + "e4ef14da423a4e37b23815228dff047c", + "f489df53fce4489c85248d0a0fc0347b", + "347117e2b4084588af0120de4cba9992", + "f7dde0ddeb954feeb6334f91957b3b4f", + "d85f7d324e534e7fb7665440581927af", + "36a4ac5796544fe5b50e802cd0b4b599", + "65782adbd1e943f39a3d282e4f217daf", + "d78f6159d9fe4b0e840b2d1912a253d8", + "db2021d70d584ef987b1580962ad919c", + "2cc9fc8c66aa4381ab3a6e742d0547dc", + "256273b11d094044a36d0056498cc487", + "361e88b5998d4df996113c7b6c55bd1e", + "0236fdbddbcc4049b48713bb17ba4b74", + "878fc2e400354baf84a8a134d9038174", + "e2a4fd0970f94aeb8b841870d95662a8", + "bc263f4b7ac94cfeaa7609341d5394e2", + "266b8b8d1dda42afa1b5fdafb66af4ac", + "dc8604c9207b4a8ca364a817c6516378", + "f1958b44d65243a0b4ca5ba2803d3598", + "d26580979feb41cdb423d151bd5ebd15", + "e7a58c85b79041eaaeeb9a9c3fa102aa", + "57b95194b9c0404d84ee4a73208e10b0", + "477c9d28d9624f448b75b8c38207fed5", + "e2e7b8f3477c4fd486a0602377992efe", + "72755dae20114e74a26fa5f556eed8c8", + "c961071096794f7580d0d37db02e8ff0", + "cf26e32a7c6b48caa2d7727365d33da3", + "2edbb013778f4cb2a05510875c8b1d66", + "b4bb0987873c46f9865e5308e2cd6cab", + "8fa51cc1231146d9be01452d4baedcab", + "5123c4c6e7524b4983ca0701394af3a0", + "4d97b210440f431bb5440d5b3b49032b", + "d5a94e8542ac48babbc228b80e8c5c91", + "47f2a197eb0b47d583ec331a89a7657f", + "c1998ef598ff4359b0de7961665dba6d", + "ba0a677b24604277981595701dfc4574" + ] + }, + "id": "qdefSjR_YIiG", + "outputId": "a1002eb7-cceb-45ee-dbb9-6a7329860af1" + }, + "source": [ + "import dl_translate as dlt\n", + "\n", + "mt = dlt.TranslationModel()\n", + "\n", + "text_hi = \"संयुक्त राष्ट्र के प्रमुख का कहना है कि सीरिया में कोई सैन्य समाधान नहीं है\"\n", + "mt.translate(text_hi, source=dlt.lang.HINDI, target=dlt.lang.ENGLISH)" + ], + "execution_count": null, + "outputs": [ + { + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "9695e0e8562c4104b8e28a25bf05991e", + "version_minor": 0, + "version_major": 2 + }, + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=3708092.0, style=ProgressStyle(descript…" + ] + }, + "metadata": { + "tags": [] + } + }, + { + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" + }, + { + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "451f6d64f9d14cfe821ef82af4313223", + "version_minor": 0, + "version_major": 2 + }, + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=2423393.0, style=ProgressStyle(descript…" + ] + }, + "metadata": { + "tags": [] + } + }, + { + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" + }, + { + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "d85f7d324e534e7fb7665440581927af", + "version_minor": 0, + "version_major": 2 + }, + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=272.0, style=ProgressStyle(description_…" + ] + }, + "metadata": { + "tags": [] + } + }, + { + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" + }, + { + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "0236fdbddbcc4049b48713bb17ba4b74", + "version_minor": 0, + "version_major": 2 + }, + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=1140.0, style=ProgressStyle(description…" + ] + }, + "metadata": { + "tags": [] + } + }, + { + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" }, - "id": "qdefSjR_YIiG", - "outputId": "b0c73f2a-2f83-4cd6-ab79-3b34606ad634" - }, - "source": [ - "import dl_translate as dlt\n", - "\n", - "mt = dlt.TranslationModel()\n", - "\n", - "text_hi = \"संयुक्त राष्ट्र के प्रमुख का कहना है कि सीरिया में कोई सैन्य समाधान नहीं है\"\n", - "mt.translate(text_hi, source=dlt.lang.HINDI, target=dlt.lang.ENGLISH)" - ], - "execution_count": 5, - "outputs": [ { - "output_type": "execute_result", + "output_type": "display_data", "data": { - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" + "application/vnd.jupyter.widget-view+json": { + "model_id": "e7a58c85b79041eaaeeb9a9c3fa102aa", + "version_minor": 0, + "version_major": 2 }, "text/plain": [ - "'The head of the United Nations says there is no military solution in Syria'" + "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=908.0, style=ProgressStyle(description_…" ] }, "metadata": { "tags": [] + } + }, + { + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" + }, + { + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "b4bb0987873c46f9865e5308e2cd6cab", + "version_minor": 0, + "version_major": 2 + }, + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=1935796948.0, style=ProgressStyle(descr…" + ] }, - "execution_count": 5 + "metadata": { + "tags": [] + } } ] }, @@ -371,42 +1778,21 @@ "id": "DDQGpznwYIiH" }, "source": [ - "Above, you can see that `dlt.lang` contains variables representing each of the 50 available languages with auto-complete support. Alternatively, you can specify the language (e.g. \"Arabic\") or the language code (e.g. \"fr_XX\" for French):" + "Above, you can see that `dlt.lang` contains variables representing each of the 50 available languages with auto-complete support. Alternatively, you can specify the language (e.g. \"Arabic\") or the language code (e.g. \"fr\" for French):" ] }, { "cell_type": "code", "metadata": { "trusted": true, - "colab": { - "base_uri": "https://localhost:8080/", - "height": 36 - }, - "id": "yC3LMjmNYIiI", - "outputId": "53f2172c-e7f9-44fb-f6da-702f7070310c" + "id": "yC3LMjmNYIiI" }, "source": [ "text_ar = \"الأمين العام للأمم المتحدة يقول إنه لا يوجد حل عسكري في سوريا.\"\n", - "mt.translate(text_ar, source=\"Arabic\", target=\"fr_XX\")" + "mt.translate(text_ar, source=\"Arabic\", target=\"fr\")" ], - "execution_count": 6, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" - }, - "text/plain": [ - "\"Le Secrétaire général de l'ONU dit qu'il n'y a pas de solution militaire en Syrie.\"" - ] - }, - "metadata": { - "tags": [] - }, - "execution_count": 6 - } - ] + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -422,29 +1808,15 @@ "metadata": { "trusted": true, "_kg_hide-output": false, - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "saHalYvsYIiJ", - "outputId": "3d675f9f-384b-43c0-e3a5-7cea7598eae7" + "id": "saHalYvsYIiJ" }, "source": [ "print(mt.available_languages()) # All languages that you can use\n", "print(mt.available_codes()) # Code corresponding to each language accepted\n", "print(mt.get_lang_code_map()) # Dictionary of lang -> code" ], - "execution_count": 7, - "outputs": [ - { - "output_type": "stream", - "text": [ - "('Arabic', 'Czech', 'German', 'English', 'Spanish', 'Estonian', 'Finnish', 'French', 'Gujarati', 'Hindi', 'Italian', 'Japanese', 'Kazakh', 'Korean', 'Lithuanian', 'Latvian', 'Burmese', 'Nepali', 'Dutch', 'Romanian', 'Russian', 'Sinhala', 'Turkish', 'Vietnamese', 'Chinese', 'Afrikaans', 'Azerbaijani', 'Bengali', 'Persian', 'Hebrew', 'Croatian', 'Indonesian', 'Georgian', 'Khmer', 'Macedonian', 'Malayalam', 'Mongolian', 'Marathi', 'Polish', 'Pashto', 'Portuguese', 'Swedish', 'Swahili', 'Tamil', 'Telugu', 'Thai', 'Tagalog', 'Ukrainian', 'Urdu', 'Xhosa', 'Galician', 'Slovene')\n", - "('Arabic', 'Czech', 'German', 'English', 'Spanish', 'Estonian', 'Finnish', 'French', 'Gujarati', 'Hindi', 'Italian', 'Japanese', 'Kazakh', 'Korean', 'Lithuanian', 'Latvian', 'Burmese', 'Nepali', 'Dutch', 'Romanian', 'Russian', 'Sinhala', 'Turkish', 'Vietnamese', 'Chinese', 'Afrikaans', 'Azerbaijani', 'Bengali', 'Persian', 'Hebrew', 'Croatian', 'Indonesian', 'Georgian', 'Khmer', 'Macedonian', 'Malayalam', 'Mongolian', 'Marathi', 'Polish', 'Pashto', 'Portuguese', 'Swedish', 'Swahili', 'Tamil', 'Telugu', 'Thai', 'Tagalog', 'Ukrainian', 'Urdu', 'Xhosa', 'Galician', 'Slovene')\n", - "{'Arabic': 'ar_AR', 'Czech': 'cs_CZ', 'German': 'de_DE', 'English': 'en_XX', 'Spanish': 'es_XX', 'Estonian': 'et_EE', 'Finnish': 'fi_FI', 'French': 'fr_XX', 'Gujarati': 'gu_IN', 'Hindi': 'hi_IN', 'Italian': 'it_IT', 'Japanese': 'ja_XX', 'Kazakh': 'kk_KZ', 'Korean': 'ko_KR', 'Lithuanian': 'lt_LT', 'Latvian': 'lv_LV', 'Burmese': 'my_MM', 'Nepali': 'ne_NP', 'Dutch': 'nl_XX', 'Romanian': 'ro_RO', 'Russian': 'ru_RU', 'Sinhala': 'si_LK', 'Turkish': 'tr_TR', 'Vietnamese': 'vi_VN', 'Chinese': 'zh_CN', 'Afrikaans': 'af_ZA', 'Azerbaijani': 'az_AZ', 'Bengali': 'bn_IN', 'Persian': 'fa_IR', 'Hebrew': 'he_IL', 'Croatian': 'hr_HR', 'Indonesian': 'id_ID', 'Georgian': 'ka_GE', 'Khmer': 'km_KH', 'Macedonian': 'mk_MK', 'Malayalam': 'ml_IN', 'Mongolian': 'mn_MN', 'Marathi': 'mr_IN', 'Polish': 'pl_PL', 'Pashto': 'ps_AF', 'Portuguese': 'pt_XX', 'Swedish': 'sv_SE', 'Swahili': 'sw_KE', 'Tamil': 'ta_IN', 'Telugu': 'te_IN', 'Thai': 'th_TH', 'Tagalog': 'tl_XX', 'Ukrainian': 'uk_UA', 'Urdu': 'ur_PK', 'Xhosa': 'xh_ZA', 'Galician': 'gl_ES', 'Slovene': 'sl_SI'}\n" - ], - "name": "stdout" - } - ] + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -471,30 +1843,13 @@ "cell_type": "code", "metadata": { "trusted": true, - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "fKAlEmzbYIiJ", - "outputId": "407d9e3e-fa36-4074-da67-a51f9533298a" + "id": "fKAlEmzbYIiJ" }, "source": [ "mt.device" ], - "execution_count": 8, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "device(type='cuda')" - ] - }, - "metadata": { - "tags": [] - }, - "execution_count": 8 - } - ] + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -506,16 +1861,17 @@ "\n", "By default, `dlt.TranslationModel` will download the model from the [huggingface repo](https://huggingface.co/facebook/mbart-large-50-one-to-many-mmt) and cache it. However, you are free to load from a path:\n", "```python\n", - "mt = dlt.TranslationModel(\"/path/to/your/model/directory/\")\n", + "mt = dlt.TranslationModel(\"/path/to/your/model/directory/\", model_family=\"mbart50\")\n", "```\n", "Make sure that your tokenizer is also stored in the same directory if you use this approach.\n", "\n", "\n", "### Using a different model\n", "\n", - "You can also choose another model that has [a similar format](https://huggingface.co/models?filter=mbart-50), e.g.\n", + "You can also choose another model that has [a similar format](https://huggingface.co/models?filter=mbart-50). In those cases, it's preferable to specify the model family:\n", "```python\n", "mt = dlt.TranslationModel(\"facebook/mbart-large-50-one-to-many-mmt\")\n", + "mt = dlt.TranslationModel(\"facebook/m2m100_1.2B\", model_family=\"m2m100\")\n", "```\n", "Note that the available languages will change if you do this, so you will not be able to leverage `dlt.lang` or `dlt.utils`.\n", "\n", @@ -543,36 +1899,15 @@ "cell_type": "code", "metadata": { "trusted": true, - "colab": { - "base_uri": "https://localhost:8080/", - "height": 36 - }, - "id": "j-cyjxQCYIiL", - "outputId": "9fbbff37-715a-435e-ffef-61e77bb8f859" + "id": "j-cyjxQCYIiL" }, "source": [ "text = \"Mr. Smith went to his favorite cafe. There, he met his friend Dr. Doe.\"\n", "sents = nltk.tokenize.sent_tokenize(text, \"english\") # don't use dlt.lang.ENGLISH\n", "\" \".join(mt.translate(sents, source=dlt.lang.ENGLISH, target=dlt.lang.FRENCH))" ], - "execution_count": 11, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "application/vnd.google.colaboratory.intrinsic+json": { - "type": "string" - }, - "text/plain": [ - "\"M. Smith s'est rendu dans son café préféré. Là, il a rencontré son ami, le Dr Doe.\"" - ] - }, - "metadata": { - "tags": [] - }, - "execution_count": 11 - } - ] + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -589,65 +1924,13 @@ "cell_type": "code", "metadata": { "trusted": true, - "colab": { - "base_uri": "https://localhost:8080/", - "height": 104, - "referenced_widgets": [ - "9eac029aa8a34135b1e619837a0d501f", - "1992924072de4a6d8db0fea6094274ae", - "cc7c647ebc3342eca5fcc1c027dd0a7d", - "c75bc40d75c744e0b8518ebbe4f4cb00", - "817e672c133e484fa8a12fa0130b3336", - "b25f76f8822d4ae8965a3950a28e651e", - "44bffa64c51b4752ac983d08ea8f00f3", - "6d1c65c8195f4f26895bfb3a9092fba4" - ] - }, - "id": "fcxUFmjAYIiM", - "outputId": "eae8301e-0d8c-431b-edd8-581b2f50ac0f" + "id": "fcxUFmjAYIiM" }, "source": [ "mt.translate(sents, source=dlt.lang.ENGLISH, target=dlt.lang.FRENCH, batch_size=32, verbose=True)" ], - "execution_count": 12, - "outputs": [ - { - "output_type": "display_data", - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "9eac029aa8a34135b1e619837a0d501f", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, max=1.0), HTML(value='')))" - ] - }, - "metadata": { - "tags": [] - } - }, - { - "output_type": "stream", - "text": [ - "\n" - ], - "name": "stdout" - }, - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "[\"M. Smith s'est rendu dans son café préféré.\",\n", - " 'Là, il a rencontré son ami, le Dr Doe.']" - ] - }, - "metadata": { - "tags": [] - }, - "execution_count": 12 - } - ] + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -667,29 +1950,15 @@ "cell_type": "code", "metadata": { "trusted": true, - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "U7iS_wKTYIiM", - "outputId": "123717b1-0661-4a5b-ed6e-01ef680fc7cf" + "id": "U7iS_wKTYIiM" }, "source": [ "print(dlt.utils.available_languages('mbart50')) # All languages that you can use\n", "print(dlt.utils.available_codes('mbart50')) # Code corresponding to each language accepted\n", "print(dlt.utils.get_lang_code_map('mbart50')) # Dictionary of lang -> code" ], - "execution_count": 13, - "outputs": [ - { - "output_type": "stream", - "text": [ - "('Arabic', 'Czech', 'German', 'English', 'Spanish', 'Estonian', 'Finnish', 'French', 'Gujarati', 'Hindi', 'Italian', 'Japanese', 'Kazakh', 'Korean', 'Lithuanian', 'Latvian', 'Burmese', 'Nepali', 'Dutch', 'Romanian', 'Russian', 'Sinhala', 'Turkish', 'Vietnamese', 'Chinese', 'Afrikaans', 'Azerbaijani', 'Bengali', 'Persian', 'Hebrew', 'Croatian', 'Indonesian', 'Georgian', 'Khmer', 'Macedonian', 'Malayalam', 'Mongolian', 'Marathi', 'Polish', 'Pashto', 'Portuguese', 'Swedish', 'Swahili', 'Tamil', 'Telugu', 'Thai', 'Tagalog', 'Ukrainian', 'Urdu', 'Xhosa', 'Galician', 'Slovene')\n", - "('ar_AR', 'cs_CZ', 'de_DE', 'en_XX', 'es_XX', 'et_EE', 'fi_FI', 'fr_XX', 'gu_IN', 'hi_IN', 'it_IT', 'ja_XX', 'kk_KZ', 'ko_KR', 'lt_LT', 'lv_LV', 'my_MM', 'ne_NP', 'nl_XX', 'ro_RO', 'ru_RU', 'si_LK', 'tr_TR', 'vi_VN', 'zh_CN', 'af_ZA', 'az_AZ', 'bn_IN', 'fa_IR', 'he_IL', 'hr_HR', 'id_ID', 'ka_GE', 'km_KH', 'mk_MK', 'ml_IN', 'mn_MN', 'mr_IN', 'pl_PL', 'ps_AF', 'pt_XX', 'sv_SE', 'sw_KE', 'ta_IN', 'te_IN', 'th_TH', 'tl_XX', 'uk_UA', 'ur_PK', 'xh_ZA', 'gl_ES', 'sl_SI')\n", - "{'Arabic': 'ar_AR', 'Czech': 'cs_CZ', 'German': 'de_DE', 'English': 'en_XX', 'Spanish': 'es_XX', 'Estonian': 'et_EE', 'Finnish': 'fi_FI', 'French': 'fr_XX', 'Gujarati': 'gu_IN', 'Hindi': 'hi_IN', 'Italian': 'it_IT', 'Japanese': 'ja_XX', 'Kazakh': 'kk_KZ', 'Korean': 'ko_KR', 'Lithuanian': 'lt_LT', 'Latvian': 'lv_LV', 'Burmese': 'my_MM', 'Nepali': 'ne_NP', 'Dutch': 'nl_XX', 'Romanian': 'ro_RO', 'Russian': 'ru_RU', 'Sinhala': 'si_LK', 'Turkish': 'tr_TR', 'Vietnamese': 'vi_VN', 'Chinese': 'zh_CN', 'Afrikaans': 'af_ZA', 'Azerbaijani': 'az_AZ', 'Bengali': 'bn_IN', 'Persian': 'fa_IR', 'Hebrew': 'he_IL', 'Croatian': 'hr_HR', 'Indonesian': 'id_ID', 'Georgian': 'ka_GE', 'Khmer': 'km_KH', 'Macedonian': 'mk_MK', 'Malayalam': 'ml_IN', 'Mongolian': 'mn_MN', 'Marathi': 'mr_IN', 'Polish': 'pl_PL', 'Pashto': 'ps_AF', 'Portuguese': 'pt_XX', 'Swedish': 'sv_SE', 'Swahili': 'sw_KE', 'Tamil': 'ta_IN', 'Telugu': 'te_IN', 'Thai': 'th_TH', 'Tagalog': 'tl_XX', 'Ukrainian': 'uk_UA', 'Urdu': 'ur_PK', 'Xhosa': 'xh_ZA', 'Galician': 'gl_ES', 'Slovene': 'sl_SI'}\n" - ], - "name": "stdout" - } - ] + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -715,7 +1984,7 @@ "source": [ "mt.save_obj(\"saved_model\")" ], - "execution_count": 14, + "execution_count": null, "outputs": [] }, { @@ -732,27 +2001,14 @@ "cell_type": "code", "metadata": { "trusted": true, - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "SEkmXUDaYIiN", - "outputId": "823d561c-c949-4734-8f50-dd308dc6b956" + "id": "SEkmXUDaYIiN" }, "source": [ "%%time\n", "mt = dlt.TranslationModel.load_obj('saved_model')" ], - "execution_count": 15, - "outputs": [ - { - "output_type": "stream", - "text": [ - "CPU times: user 1.96 s, sys: 1.94 s, total: 3.9 s\n", - "Wall time: 4.69 s\n" - ], - "name": "stdout" - } - ] + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -821,11 +2077,7 @@ "cell_type": "code", "metadata": { "trusted": true, - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "XuTbvJBWYIiP", - "outputId": "8f202ef9-d338-4630-9b58-04d1d957cc89" + "id": "XuTbvJBWYIiP" }, "source": [ "mt.translate(\n", @@ -835,22 +2087,8 @@ " generation_options=dict(num_beams=5, max_length=128)\n", ")" ], - "execution_count": 17, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - "['El Sr. Smith fue a su café favorito.',\n", - " 'En ese lugar, se reunió con su amigo Dr. Doe.']" - ] - }, - "metadata": { - "tags": [] - }, - "execution_count": 17 - } - ] + "execution_count": null, + "outputs": [] }, { "cell_type": "markdown", @@ -863,15 +2101,28 @@ "\n", "## Acknowledgement\n", "\n", - "`dl-translate` is built on top of Huggingface's implementation of multilingual BART finetuned on many-to-many translation of over 50 languages, which is [documented here](https://huggingface.co/transformers/master/model_doc/mbart.html). The original paper was written by Tang et. al from Facebook AI Research; you can [find it here](https://arxiv.org/pdf/2008.00401.pdf) and cite it using the following:\n", - "```\n", - "@article{tang2020multilingual,\n", - " title={Multilingual translation with extensible multilingual pretraining and finetuning},\n", - " author={Tang, Yuqing and Tran, Chau and Li, Xian and Chen, Peng-Jen and Goyal, Naman and Chaudhary, Vishrav and Gu, Jiatao and Fan, Angela},\n", - " journal={arXiv preprint arXiv:2008.00401},\n", - " year={2020}\n", - "}\n", - "```\n", + "`dl-translate` is built on top of Huggingface's implementation of two models created by Facebook AI Research.\n", + "\n", + "1. The multilingual BART finetuned on many-to-many translation of over 50 languages, which is [documented here](https://huggingface.co/transformers/master/model_doc/mbart.html) The original paper was written by Tang et. al from Facebook AI Research; you can [find it here](https://arxiv.org/pdf/2008.00401.pdf) and cite it using the following:\n", + " ```\n", + " @article{tang2020multilingual,\n", + " title={Multilingual translation with extensible multilingual pretraining and finetuning},\n", + " author={Tang, Yuqing and Tran, Chau and Li, Xian and Chen, Peng-Jen and Goyal, Naman and Chaudhary, Vishrav and Gu, Jiatao and Fan, Angela},\n", + " journal={arXiv preprint arXiv:2008.00401},\n", + " year={2020}\n", + " }\n", + " ```\n", + "2. The transformer model published in [Beyond English-Centric Multilingual Machine Translation](https://arxiv.org/abs/2010.11125) by Fan et. al, which supports over 100 languages. You can cite it here:\n", + " ```\n", + " @misc{fan2020englishcentric,\n", + " title={Beyond English-Centric Multilingual Machine Translation}, \n", + " author={Angela Fan and Shruti Bhosale and Holger Schwenk and Zhiyi Ma and Ahmed El-Kishky and Siddharth Goyal and Mandeep Baines and Onur Celebi and Guillaume Wenzek and Vishrav Chaudhary and Naman Goyal and Tom Birch and Vitaliy Liptchinsky and Sergey Edunov and Edouard Grave and Michael Auli and Armand Joulin},\n", + " year={2020},\n", + " eprint={2010.11125},\n", + " archivePrefix={arXiv},\n", + " primaryClass={cs.CL}\n", + " }\n", + " ```\n", "\n", "`dlt` is a wrapper with useful `utils` to save you time. For huggingface's `transformers`, the following snippet is shown as an example:\n", "```python\n",