diff --git a/examples/notebooks/jiant_Basic_Example.ipynb b/examples/notebooks/jiant_Basic_Example.ipynb index 5bcd74584..8571efb6a 100644 --- a/examples/notebooks/jiant_Basic_Example.ipynb +++ b/examples/notebooks/jiant_Basic_Example.ipynb @@ -85,6 +85,7 @@ "outputs": [], "source": [ "%%capture\n", + "%cd /content\n", "# Download MRPC data\n", "!PYTHONPATH=/content/jiant python jiant/jiant/scripts/download_data/runscript.py \\\n", " download \\\n", @@ -309,8 +310,8 @@ " jiant_task_container_config_path=\"./run_configs/mrpc_run_config.json\",\n", " output_dir=\"./runs/mrpc\",\n", " hf_pretrained_model_name_or_path=\"roberta-base\",\n", - " model_path=\"./models/roberta-base/model/roberta-base.p\",\n", - " model_config_path=\"./models/roberta-base/model/roberta-base.json\",\n", + " model_path=\"./models/roberta-base/model/roberta.p\",\n", + " model_config_path=\"./models/roberta-base/model/roberta.json\",\n", " learning_rate=1e-5,\n", " eval_every_steps=500,\n", " do_train=True,\n", diff --git a/examples/notebooks/jiant_EdgeProbing_Example.ipynb b/examples/notebooks/jiant_EdgeProbing_Example.ipynb index e3ffd5986..d04a370ec 100644 --- a/examples/notebooks/jiant_EdgeProbing_Example.ipynb +++ b/examples/notebooks/jiant_EdgeProbing_Example.ipynb @@ -1,3496 +1,3496 @@ { - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "accelerator": "GPU", - "colab": { - "name": "jiant STILTs Example", - "provenance": [], - "collapsed_sections": [], - "toc_visible": true - }, - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.2" - }, - "widgets": { - "application/vnd.jupyter.widget-state+json": { - "0ad0c4ef8cc64749b6bd2ccb2ba41563": { - "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_d0fb730b54044b8583fdf3ee0476cb52", - "_model_module": "@jupyter-widgets/controls", - "children": [ - "IPY_MODEL_4d260f0aaa1d4e1498c8895bf3c418b2", - "IPY_MODEL_bf55400872a34cbcb3527870b2191c8f" - ] - } - }, - "d0fb730b54044b8583fdf3ee0476cb52": { - "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 - } - }, - "4d260f0aaa1d4e1498c8895bf3c418b2": { - "model_module": "@jupyter-widgets/controls", - "model_name": "FloatProgressModel", - "state": { - "_view_name": "ProgressView", - "style": "IPY_MODEL_1a0f2e4658744f6abfbfd1a3c8ae0d81", - "_dom_classes": [], - "description": "Downloading: 100%", - "_model_name": "FloatProgressModel", - "bar_style": "success", - "max": 481, - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": 481, - "_view_count": null, - "_view_module_version": "1.5.0", - "orientation": "horizontal", - "min": 0, - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_448fafdecf8c46588f95cc4383942e59" - } - }, - "bf55400872a34cbcb3527870b2191c8f": { - "model_module": "@jupyter-widgets/controls", - "model_name": "HTMLModel", - "state": { - "_view_name": "HTMLView", - "style": "IPY_MODEL_a233d58461ad4ab98181153139d76571", - "_dom_classes": [], - "description": "", - "_model_name": "HTMLModel", - "placeholder": "​", - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": " 481/481 [00:15<00:00, 31.4B/s]", - "_view_count": null, - "_view_module_version": "1.5.0", - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_660a5872700947a4b20a7eb2d3eb80ac" - } - }, - "1a0f2e4658744f6abfbfd1a3c8ae0d81": { - "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" - } - }, - "448fafdecf8c46588f95cc4383942e59": { - "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 - } - }, - "a233d58461ad4ab98181153139d76571": { - "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" - } - }, - "660a5872700947a4b20a7eb2d3eb80ac": { - "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 - } - }, - "273d939ae19a47ae976c3a7afe9403b8": { - "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_e99430b62eb141798053b07ea119a1ad", - "_model_module": "@jupyter-widgets/controls", - "children": [ - "IPY_MODEL_cb0bcb188961445b96feec69f0477eea", - "IPY_MODEL_40a3f4a2ac2240469a787a06e4a6a361" - ] - } - }, - "e99430b62eb141798053b07ea119a1ad": { - "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 - } - }, - "cb0bcb188961445b96feec69f0477eea": { - "model_module": "@jupyter-widgets/controls", - "model_name": "FloatProgressModel", - "state": { - "_view_name": "ProgressView", - "style": "IPY_MODEL_ca9f84de217a46acaf4906bad6851c7b", - "_dom_classes": [], - "description": "Downloading: 100%", - "_model_name": "FloatProgressModel", - "bar_style": "success", - "max": 501200538, - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": 501200538, - "_view_count": null, - "_view_module_version": "1.5.0", - "orientation": "horizontal", - "min": 0, - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_a27515c619da49e187318ae10c3afb46" - } - }, - "40a3f4a2ac2240469a787a06e4a6a361": { - "model_module": "@jupyter-widgets/controls", - "model_name": "HTMLModel", - "state": { - "_view_name": "HTMLView", - "style": "IPY_MODEL_e8f2532f90134a07b1e2727a7b83471c", - "_dom_classes": [], - "description": "", - "_model_name": "HTMLModel", - "placeholder": "​", - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": " 501M/501M [00:07<00:00, 68.8MB/s]", - "_view_count": null, - "_view_module_version": "1.5.0", - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_fe65d5ec01ea4f95a19808d8894d1e2c" - } - }, - "ca9f84de217a46acaf4906bad6851c7b": { - "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" - } - }, - "a27515c619da49e187318ae10c3afb46": { - "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 - } - }, - "e8f2532f90134a07b1e2727a7b83471c": { - "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" - } - }, - "fe65d5ec01ea4f95a19808d8894d1e2c": { - "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 - } - }, - "cba1747a59364cab89af52f64d7d2be4": { - "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_04c29dbb9a154153a86eb7e35d7a374e", - "_model_module": "@jupyter-widgets/controls", - "children": [ - "IPY_MODEL_78f0337d61ff43b3ba17719c4f9e05fa", - "IPY_MODEL_49fcb769f4e34e2d870b8aff33267cb9" - ] - } - }, - "04c29dbb9a154153a86eb7e35d7a374e": { - "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 - } - }, - "78f0337d61ff43b3ba17719c4f9e05fa": { - "model_module": "@jupyter-widgets/controls", - "model_name": "FloatProgressModel", - "state": { - "_view_name": "ProgressView", - "style": "IPY_MODEL_f9770a94eb4044dd90fe74991c56d1c5", - "_dom_classes": [], - "description": "Downloading: 100%", - "_model_name": "FloatProgressModel", - "bar_style": "success", - "max": 898823, - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": 898823, - "_view_count": null, - "_view_module_version": "1.5.0", - "orientation": "horizontal", - "min": 0, - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_afe39f56bc4c40f8967a6e5b358d9476" - } - }, - "49fcb769f4e34e2d870b8aff33267cb9": { - "model_module": "@jupyter-widgets/controls", - "model_name": "HTMLModel", - "state": { - "_view_name": "HTMLView", - "style": "IPY_MODEL_e1c00cf74ea94eb9b61afd46bb042025", - "_dom_classes": [], - "description": "", - "_model_name": "HTMLModel", - "placeholder": "​", - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": " 899k/899k [00:00<00:00, 3.43MB/s]", - "_view_count": null, - "_view_module_version": "1.5.0", - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_0aee9253d3a14716a0a67dfda31f7a0f" - } - }, - "f9770a94eb4044dd90fe74991c56d1c5": { - "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" - } - }, - "afe39f56bc4c40f8967a6e5b358d9476": { - "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 - } - }, - "e1c00cf74ea94eb9b61afd46bb042025": { - "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" - } - }, - "0aee9253d3a14716a0a67dfda31f7a0f": { - "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 - } - }, - "c795cd64b082451f9876de86ea6353ea": { - "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_089916ffd2064364acae7fbb0f77113e", - "_model_module": "@jupyter-widgets/controls", - "children": [ - "IPY_MODEL_74b9301d8a3a4bd7a6fb4c15cd6f26a0", - "IPY_MODEL_aa6beffff7f34d59a6552f45725f1c77" - ] - } - }, - "089916ffd2064364acae7fbb0f77113e": { - "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 - } - }, - "74b9301d8a3a4bd7a6fb4c15cd6f26a0": { - "model_module": "@jupyter-widgets/controls", - "model_name": "FloatProgressModel", - "state": { - "_view_name": "ProgressView", - "style": "IPY_MODEL_908f97b966be42d0a995df0dbb3ebd2b", - "_dom_classes": [], - "description": "Downloading: 100%", - "_model_name": "FloatProgressModel", - "bar_style": "success", - "max": 456318, - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": 456318, - "_view_count": null, - "_view_module_version": "1.5.0", - "orientation": "horizontal", - "min": 0, - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_a4067515d3e34605a03e21fe7e4b1957" - } - }, - "aa6beffff7f34d59a6552f45725f1c77": { - "model_module": "@jupyter-widgets/controls", - "model_name": "HTMLModel", - "state": { - "_view_name": "HTMLView", - "style": "IPY_MODEL_9783cdbe47fd4177ba89e447bf843a25", - "_dom_classes": [], - "description": "", - "_model_name": "HTMLModel", - "placeholder": "​", - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": " 456k/456k [00:00<00:00, 3.95MB/s]", - "_view_count": null, - "_view_module_version": "1.5.0", - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_4fb3f4ea5d9c4705b3e9b0dd0408fe07" - } - }, - "908f97b966be42d0a995df0dbb3ebd2b": { - "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" - } - }, - "a4067515d3e34605a03e21fe7e4b1957": { - "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 - } - }, - "9783cdbe47fd4177ba89e447bf843a25": { - "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" - } - }, - "4fb3f4ea5d9c4705b3e9b0dd0408fe07": { - "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 - } - }, - "558652d65c9c42e5b2487711ea8c5183": { - "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_b59db489de7a410fb16ac4c64554c2db", - "_model_module": "@jupyter-widgets/controls", - "children": [ - "IPY_MODEL_648bd87cbe344ce786e78d902456be01", - "IPY_MODEL_763685078bfa425a84652935a1d49965" - ] - } - }, - "b59db489de7a410fb16ac4c64554c2db": { - "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 - } - }, - "648bd87cbe344ce786e78d902456be01": { - "model_module": "@jupyter-widgets/controls", - "model_name": "FloatProgressModel", - "state": { - "_view_name": "ProgressView", - "style": "IPY_MODEL_5cada33c5612410482ab58422f866621", - "_dom_classes": [], - "description": "Tokenizing: 100%", - "_model_name": "FloatProgressModel", - "bar_style": "success", - "max": 1000, - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": 1000, - "_view_count": null, - "_view_module_version": "1.5.0", - "orientation": "horizontal", - "min": 0, - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_635bed807450413797ec7d1c8a16444d" - } - }, - "763685078bfa425a84652935a1d49965": { - "model_module": "@jupyter-widgets/controls", - "model_name": "HTMLModel", - "state": { - "_view_name": "HTMLView", - "style": "IPY_MODEL_9878a78abe8e41c585f63ed1e77309ea", - "_dom_classes": [], - "description": "", - "_model_name": "HTMLModel", - "placeholder": "​", - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": " 1000/1000 [00:13<00:00, 72.72it/s]", - "_view_count": null, - "_view_module_version": "1.5.0", - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_2b0ee8fa0e614926b8ea2befa8d93893" - } - }, - "5cada33c5612410482ab58422f866621": { - "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" - } - }, - "635bed807450413797ec7d1c8a16444d": { - "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 - } - }, - "9878a78abe8e41c585f63ed1e77309ea": { - "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" - } - }, - "2b0ee8fa0e614926b8ea2befa8d93893": { - "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 - } - }, - "6bfcf6f5ebc144e88f55e1501c398ab3": { - "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_0fe088ff545b4642993a0395bc0351af", - "_model_module": "@jupyter-widgets/controls", - "children": [ - "IPY_MODEL_6644d495d3ab4198962cc3e4fd130fe0", - "IPY_MODEL_95e0eeb66af842fc9a5ea7072e665045" - ] - } - }, - "0fe088ff545b4642993a0395bc0351af": { - "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 - } - }, - "6644d495d3ab4198962cc3e4fd130fe0": { - "model_module": "@jupyter-widgets/controls", - "model_name": "FloatProgressModel", - "state": { - "_view_name": "ProgressView", - "style": "IPY_MODEL_13039f3a86204fdea19dd335aaa66519", - "_dom_classes": [], - "description": "Tokenizing: 100%", - "_model_name": "FloatProgressModel", - "bar_style": "success", - "max": 100, - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": 100, - "_view_count": null, - "_view_module_version": "1.5.0", - "orientation": "horizontal", - "min": 0, - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_effe903b59b24573b1c3e406b986dfac" - } - }, - "95e0eeb66af842fc9a5ea7072e665045": { - "model_module": "@jupyter-widgets/controls", - "model_name": "HTMLModel", - "state": { - "_view_name": "HTMLView", - "style": "IPY_MODEL_b6aeddb44c3147e2ab912d84759bc139", - "_dom_classes": [], - "description": "", - "_model_name": "HTMLModel", - "placeholder": "​", - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": " 100/100 [00:02<00:00, 38.47it/s]", - "_view_count": null, - "_view_module_version": "1.5.0", - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_1b51de8cdcbd4c01af4de5865e9c575d" - } - }, - "13039f3a86204fdea19dd335aaa66519": { - "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" - } - }, - "effe903b59b24573b1c3e406b986dfac": { - "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 - } - }, - "b6aeddb44c3147e2ab912d84759bc139": { - "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" - } - }, - "1b51de8cdcbd4c01af4de5865e9c575d": { - "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 - } - }, - "f081100984b44e45a77fff620f998508": { - "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_69d9699a4d7147b5bf9ada54c4839488", - "_model_module": "@jupyter-widgets/controls", - "children": [ - "IPY_MODEL_e8e3b6cf03e04df99ac9799dbbe997cf", - "IPY_MODEL_0ca001e7315c41359a48a37579ad7ac6" - ] - } - }, - "69d9699a4d7147b5bf9ada54c4839488": { - "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 - } - }, - "e8e3b6cf03e04df99ac9799dbbe997cf": { - "model_module": "@jupyter-widgets/controls", - "model_name": "FloatProgressModel", - "state": { - "_view_name": "ProgressView", - "style": "IPY_MODEL_d4f840d6919047c795fbe22cc096ae39", - "_dom_classes": [], - "description": "Training: 100%", - "_model_name": "FloatProgressModel", - "bar_style": "danger", - "max": 375, - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": 374, - "_view_count": null, - "_view_module_version": "1.5.0", - "orientation": "horizontal", - "min": 0, - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_db4132b9258440179d76382ed537257c" - } - }, - "0ca001e7315c41359a48a37579ad7ac6": { - "model_module": "@jupyter-widgets/controls", - "model_name": "HTMLModel", - "state": { - "_view_name": "HTMLView", - "style": "IPY_MODEL_9ae696b3d7bd470787c4de833990a614", - "_dom_classes": [], - "description": "", - "_model_name": "HTMLModel", - "placeholder": "​", - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": " 374/375 [01:19<00:00, 4.69it/s]", - "_view_count": null, - "_view_module_version": "1.5.0", - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_17a6d908da41486995c53d7436990b8b" - } - }, - "d4f840d6919047c795fbe22cc096ae39": { - "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" - } - }, - "db4132b9258440179d76382ed537257c": { - "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 - } - }, - "9ae696b3d7bd470787c4de833990a614": { - "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" - } - }, - "17a6d908da41486995c53d7436990b8b": { - "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 - } - }, - "7b6147ac6008406c932bb5c5fbf9c8ad": { - "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_d41d7ce333404ac8b12feed2031f1cd2", - "_model_module": "@jupyter-widgets/controls", - "children": [ - "IPY_MODEL_ff00a73e3d474420ab697edb5626da1b", - "IPY_MODEL_70693f5e1708442d9377b03600d256c4" - ] - } - }, - "d41d7ce333404ac8b12feed2031f1cd2": { - "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 - } - }, - "ff00a73e3d474420ab697edb5626da1b": { - "model_module": "@jupyter-widgets/controls", - "model_name": "FloatProgressModel", - "state": { - "_view_name": "ProgressView", - "style": "IPY_MODEL_d5045b7014fa46518bb0378cf52fa76f", - "_dom_classes": [], - "description": "Eval (semeval, Val): 100%", - "_model_name": "FloatProgressModel", - "bar_style": "success", - "max": 7, - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": 7, - "_view_count": null, - "_view_module_version": "1.5.0", - "orientation": "horizontal", - "min": 0, - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_e23242c190344c098076d1fc8140e6f2" - } - }, - "70693f5e1708442d9377b03600d256c4": { - "model_module": "@jupyter-widgets/controls", - "model_name": "HTMLModel", - "state": { - "_view_name": "HTMLView", - "style": "IPY_MODEL_e1a1f7ae889e45ad9b825d752c74a38d", - "_dom_classes": [], - "description": "", - "_model_name": "HTMLModel", - "placeholder": "​", - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": " 7/7 [00:05<00:00, 1.18it/s]", - "_view_count": null, - "_view_module_version": "1.5.0", - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_bc31ec29b5f24d838401db71b345aeed" - } - }, - "d5045b7014fa46518bb0378cf52fa76f": { - "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" - } - }, - "e23242c190344c098076d1fc8140e6f2": { - "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 - } - }, - "e1a1f7ae889e45ad9b825d752c74a38d": { - "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" - } - }, - "bc31ec29b5f24d838401db71b345aeed": { - "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 - } - }, - "4b138e183eaf406a8fec6a2cc36f067a": { - "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_ab66645a63274e67a823bed7702d5da2", - "_model_module": "@jupyter-widgets/controls", - "children": [ - "IPY_MODEL_b093c8725cf24d37861f2b38837f4bc4", - "IPY_MODEL_62651b48746c4536a6814fefa89c91e6" - ] - } - }, - "ab66645a63274e67a823bed7702d5da2": { - "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 - } - }, - "b093c8725cf24d37861f2b38837f4bc4": { - "model_module": "@jupyter-widgets/controls", - "model_name": "FloatProgressModel", - "state": { - "_view_name": "ProgressView", - "style": "IPY_MODEL_f5d8d08063f340f6b32bf7f2f0fd5821", - "_dom_classes": [], - "description": "Eval (semeval, Val): 100%", - "_model_name": "FloatProgressModel", - "bar_style": "success", - "max": 7, - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": 7, - "_view_count": null, - "_view_module_version": "1.5.0", - "orientation": "horizontal", - "min": 0, - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_3dbe5ad38b23422481c2e51acdc78b20" - } - }, - "62651b48746c4536a6814fefa89c91e6": { - "model_module": "@jupyter-widgets/controls", - "model_name": "HTMLModel", - "state": { - "_view_name": "HTMLView", - "style": "IPY_MODEL_9a83595e4bb74bc0948be54799248d16", - "_dom_classes": [], - "description": "", - "_model_name": "HTMLModel", - "placeholder": "​", - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": " 7/7 [00:01<00:00, 4.72it/s]", - "_view_count": null, - "_view_module_version": "1.5.0", - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_27e02234b1764aed9156f565ec454246" - } - }, - "f5d8d08063f340f6b32bf7f2f0fd5821": { - "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" - } - }, - "3dbe5ad38b23422481c2e51acdc78b20": { - "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 - } - }, - "9a83595e4bb74bc0948be54799248d16": { - "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" - } - }, - "27e02234b1764aed9156f565ec454246": { - "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 - } - }, - "ad747e2552c5429484dcd3d19c366a96": { - "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_54e47f0d45d24009aa83fbb5d614e98a", - "_model_module": "@jupyter-widgets/controls", - "children": [ - "IPY_MODEL_ab6394febb5b4d48b9d26d9846f0eb87", - "IPY_MODEL_e34035b4fc8348f2ab108b9edc5d0322" - ] - } - }, - "54e47f0d45d24009aa83fbb5d614e98a": { - "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 - } - }, - "ab6394febb5b4d48b9d26d9846f0eb87": { - "model_module": "@jupyter-widgets/controls", - "model_name": "FloatProgressModel", - "state": { - "_view_name": "ProgressView", - "style": "IPY_MODEL_0bce1deff0d64bf7a96b6307efd4544e", - "_dom_classes": [], - "description": "Eval (semeval, Val): 100%", - "_model_name": "FloatProgressModel", - "bar_style": "success", - "max": 7, - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": 7, - "_view_count": null, - "_view_module_version": "1.5.0", - "orientation": "horizontal", - "min": 0, - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_91fac974c5eb4f19b7b0cf18e3521d82" - } - }, - "e34035b4fc8348f2ab108b9edc5d0322": { - "model_module": "@jupyter-widgets/controls", - "model_name": "HTMLModel", - "state": { - "_view_name": "HTMLView", - "style": "IPY_MODEL_968570f0cb0a45c7ab5ab76e00936ae3", - "_dom_classes": [], - "description": "", - "_model_name": "HTMLModel", - "placeholder": "​", - "_view_module": "@jupyter-widgets/controls", - "_model_module_version": "1.5.0", - "value": " 7/7 [00:00<00:00, 9.29it/s]", - "_view_count": null, - "_view_module_version": "1.5.0", - "description_tooltip": null, - "_model_module": "@jupyter-widgets/controls", - "layout": "IPY_MODEL_03fb6747a39646e3b7dda6f877ce19fe" - } - }, - "0bce1deff0d64bf7a96b6307efd4544e": { - "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" - } - }, - "91fac974c5eb4f19b7b0cf18e3521d82": { - "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 - } - }, - "968570f0cb0a45c7ab5ab76e00936ae3": { - "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" - } - }, - "03fb6747a39646e3b7dda6f877ce19fe": { - "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 - } - } - } + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "accelerator": "GPU", + "colab": { + "name": "jiant STILTs Example", + "provenance": [], + "collapsed_sections": [], + "toc_visible": true + }, + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.2" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "0ad0c4ef8cc64749b6bd2ccb2ba41563": { + "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_d0fb730b54044b8583fdf3ee0476cb52", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_4d260f0aaa1d4e1498c8895bf3c418b2", + "IPY_MODEL_bf55400872a34cbcb3527870b2191c8f" + ] + } + }, + "d0fb730b54044b8583fdf3ee0476cb52": { + "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 + } + }, + "4d260f0aaa1d4e1498c8895bf3c418b2": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_1a0f2e4658744f6abfbfd1a3c8ae0d81", + "_dom_classes": [], + "description": "Downloading: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 481, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 481, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_448fafdecf8c46588f95cc4383942e59" + } + }, + "bf55400872a34cbcb3527870b2191c8f": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_a233d58461ad4ab98181153139d76571", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 481/481 [00:15<00:00, 31.4B/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_660a5872700947a4b20a7eb2d3eb80ac" + } + }, + "1a0f2e4658744f6abfbfd1a3c8ae0d81": { + "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" + } + }, + "448fafdecf8c46588f95cc4383942e59": { + "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 + } + }, + "a233d58461ad4ab98181153139d76571": { + "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" + } + }, + "660a5872700947a4b20a7eb2d3eb80ac": { + "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 + } + }, + "273d939ae19a47ae976c3a7afe9403b8": { + "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_e99430b62eb141798053b07ea119a1ad", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_cb0bcb188961445b96feec69f0477eea", + "IPY_MODEL_40a3f4a2ac2240469a787a06e4a6a361" + ] + } + }, + "e99430b62eb141798053b07ea119a1ad": { + "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 + } + }, + "cb0bcb188961445b96feec69f0477eea": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_ca9f84de217a46acaf4906bad6851c7b", + "_dom_classes": [], + "description": "Downloading: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 501200538, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 501200538, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_a27515c619da49e187318ae10c3afb46" + } + }, + "40a3f4a2ac2240469a787a06e4a6a361": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_e8f2532f90134a07b1e2727a7b83471c", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 501M/501M [00:07<00:00, 68.8MB/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_fe65d5ec01ea4f95a19808d8894d1e2c" + } + }, + "ca9f84de217a46acaf4906bad6851c7b": { + "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" + } + }, + "a27515c619da49e187318ae10c3afb46": { + "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 + } + }, + "e8f2532f90134a07b1e2727a7b83471c": { + "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" + } + }, + "fe65d5ec01ea4f95a19808d8894d1e2c": { + "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 + } + }, + "cba1747a59364cab89af52f64d7d2be4": { + "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_04c29dbb9a154153a86eb7e35d7a374e", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_78f0337d61ff43b3ba17719c4f9e05fa", + "IPY_MODEL_49fcb769f4e34e2d870b8aff33267cb9" + ] + } + }, + "04c29dbb9a154153a86eb7e35d7a374e": { + "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 + } + }, + "78f0337d61ff43b3ba17719c4f9e05fa": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_f9770a94eb4044dd90fe74991c56d1c5", + "_dom_classes": [], + "description": "Downloading: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 898823, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 898823, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_afe39f56bc4c40f8967a6e5b358d9476" + } + }, + "49fcb769f4e34e2d870b8aff33267cb9": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_e1c00cf74ea94eb9b61afd46bb042025", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 899k/899k [00:00<00:00, 3.43MB/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_0aee9253d3a14716a0a67dfda31f7a0f" + } + }, + "f9770a94eb4044dd90fe74991c56d1c5": { + "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" + } + }, + "afe39f56bc4c40f8967a6e5b358d9476": { + "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 + } + }, + "e1c00cf74ea94eb9b61afd46bb042025": { + "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" + } + }, + "0aee9253d3a14716a0a67dfda31f7a0f": { + "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 + } + }, + "c795cd64b082451f9876de86ea6353ea": { + "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_089916ffd2064364acae7fbb0f77113e", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_74b9301d8a3a4bd7a6fb4c15cd6f26a0", + "IPY_MODEL_aa6beffff7f34d59a6552f45725f1c77" + ] + } + }, + "089916ffd2064364acae7fbb0f77113e": { + "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 + } + }, + "74b9301d8a3a4bd7a6fb4c15cd6f26a0": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_908f97b966be42d0a995df0dbb3ebd2b", + "_dom_classes": [], + "description": "Downloading: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 456318, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 456318, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_a4067515d3e34605a03e21fe7e4b1957" + } + }, + "aa6beffff7f34d59a6552f45725f1c77": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_9783cdbe47fd4177ba89e447bf843a25", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 456k/456k [00:00<00:00, 3.95MB/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_4fb3f4ea5d9c4705b3e9b0dd0408fe07" + } + }, + "908f97b966be42d0a995df0dbb3ebd2b": { + "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" + } + }, + "a4067515d3e34605a03e21fe7e4b1957": { + "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 + } + }, + "9783cdbe47fd4177ba89e447bf843a25": { + "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" + } + }, + "4fb3f4ea5d9c4705b3e9b0dd0408fe07": { + "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 + } + }, + "558652d65c9c42e5b2487711ea8c5183": { + "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_b59db489de7a410fb16ac4c64554c2db", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_648bd87cbe344ce786e78d902456be01", + "IPY_MODEL_763685078bfa425a84652935a1d49965" + ] + } + }, + "b59db489de7a410fb16ac4c64554c2db": { + "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 + } + }, + "648bd87cbe344ce786e78d902456be01": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_5cada33c5612410482ab58422f866621", + "_dom_classes": [], + "description": "Tokenizing: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 1000, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 1000, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_635bed807450413797ec7d1c8a16444d" + } + }, + "763685078bfa425a84652935a1d49965": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_9878a78abe8e41c585f63ed1e77309ea", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 1000/1000 [00:13<00:00, 72.72it/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_2b0ee8fa0e614926b8ea2befa8d93893" + } + }, + "5cada33c5612410482ab58422f866621": { + "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" + } + }, + "635bed807450413797ec7d1c8a16444d": { + "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 + } + }, + "9878a78abe8e41c585f63ed1e77309ea": { + "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" + } + }, + "2b0ee8fa0e614926b8ea2befa8d93893": { + "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 + } + }, + "6bfcf6f5ebc144e88f55e1501c398ab3": { + "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_0fe088ff545b4642993a0395bc0351af", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_6644d495d3ab4198962cc3e4fd130fe0", + "IPY_MODEL_95e0eeb66af842fc9a5ea7072e665045" + ] + } + }, + "0fe088ff545b4642993a0395bc0351af": { + "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 + } + }, + "6644d495d3ab4198962cc3e4fd130fe0": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_13039f3a86204fdea19dd335aaa66519", + "_dom_classes": [], + "description": "Tokenizing: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 100, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 100, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_effe903b59b24573b1c3e406b986dfac" + } + }, + "95e0eeb66af842fc9a5ea7072e665045": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_b6aeddb44c3147e2ab912d84759bc139", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 100/100 [00:02<00:00, 38.47it/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_1b51de8cdcbd4c01af4de5865e9c575d" + } + }, + "13039f3a86204fdea19dd335aaa66519": { + "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" + } + }, + "effe903b59b24573b1c3e406b986dfac": { + "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 + } + }, + "b6aeddb44c3147e2ab912d84759bc139": { + "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" + } + }, + "1b51de8cdcbd4c01af4de5865e9c575d": { + "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 + } + }, + "f081100984b44e45a77fff620f998508": { + "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_69d9699a4d7147b5bf9ada54c4839488", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_e8e3b6cf03e04df99ac9799dbbe997cf", + "IPY_MODEL_0ca001e7315c41359a48a37579ad7ac6" + ] + } + }, + "69d9699a4d7147b5bf9ada54c4839488": { + "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 + } + }, + "e8e3b6cf03e04df99ac9799dbbe997cf": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_d4f840d6919047c795fbe22cc096ae39", + "_dom_classes": [], + "description": "Training: 100%", + "_model_name": "FloatProgressModel", + "bar_style": "danger", + "max": 375, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 374, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_db4132b9258440179d76382ed537257c" + } + }, + "0ca001e7315c41359a48a37579ad7ac6": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_9ae696b3d7bd470787c4de833990a614", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 374/375 [01:19<00:00, 4.69it/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_17a6d908da41486995c53d7436990b8b" + } + }, + "d4f840d6919047c795fbe22cc096ae39": { + "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" + } + }, + "db4132b9258440179d76382ed537257c": { + "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 + } + }, + "9ae696b3d7bd470787c4de833990a614": { + "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" + } + }, + "17a6d908da41486995c53d7436990b8b": { + "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 + } + }, + "7b6147ac6008406c932bb5c5fbf9c8ad": { + "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_d41d7ce333404ac8b12feed2031f1cd2", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_ff00a73e3d474420ab697edb5626da1b", + "IPY_MODEL_70693f5e1708442d9377b03600d256c4" + ] + } + }, + "d41d7ce333404ac8b12feed2031f1cd2": { + "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 + } + }, + "ff00a73e3d474420ab697edb5626da1b": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_d5045b7014fa46518bb0378cf52fa76f", + "_dom_classes": [], + "description": "Eval (semeval, Val): 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 7, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 7, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_e23242c190344c098076d1fc8140e6f2" + } + }, + "70693f5e1708442d9377b03600d256c4": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_e1a1f7ae889e45ad9b825d752c74a38d", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 7/7 [00:05<00:00, 1.18it/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_bc31ec29b5f24d838401db71b345aeed" + } + }, + "d5045b7014fa46518bb0378cf52fa76f": { + "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" + } + }, + "e23242c190344c098076d1fc8140e6f2": { + "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 + } + }, + "e1a1f7ae889e45ad9b825d752c74a38d": { + "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" + } + }, + "bc31ec29b5f24d838401db71b345aeed": { + "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 + } + }, + "4b138e183eaf406a8fec6a2cc36f067a": { + "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_ab66645a63274e67a823bed7702d5da2", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_b093c8725cf24d37861f2b38837f4bc4", + "IPY_MODEL_62651b48746c4536a6814fefa89c91e6" + ] + } + }, + "ab66645a63274e67a823bed7702d5da2": { + "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 + } + }, + "b093c8725cf24d37861f2b38837f4bc4": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_f5d8d08063f340f6b32bf7f2f0fd5821", + "_dom_classes": [], + "description": "Eval (semeval, Val): 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 7, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 7, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_3dbe5ad38b23422481c2e51acdc78b20" + } + }, + "62651b48746c4536a6814fefa89c91e6": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_9a83595e4bb74bc0948be54799248d16", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 7/7 [00:01<00:00, 4.72it/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_27e02234b1764aed9156f565ec454246" + } + }, + "f5d8d08063f340f6b32bf7f2f0fd5821": { + "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" + } + }, + "3dbe5ad38b23422481c2e51acdc78b20": { + "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 + } + }, + "9a83595e4bb74bc0948be54799248d16": { + "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" + } + }, + "27e02234b1764aed9156f565ec454246": { + "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 + } + }, + "ad747e2552c5429484dcd3d19c366a96": { + "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_54e47f0d45d24009aa83fbb5d614e98a", + "_model_module": "@jupyter-widgets/controls", + "children": [ + "IPY_MODEL_ab6394febb5b4d48b9d26d9846f0eb87", + "IPY_MODEL_e34035b4fc8348f2ab108b9edc5d0322" + ] + } + }, + "54e47f0d45d24009aa83fbb5d614e98a": { + "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 + } + }, + "ab6394febb5b4d48b9d26d9846f0eb87": { + "model_module": "@jupyter-widgets/controls", + "model_name": "FloatProgressModel", + "state": { + "_view_name": "ProgressView", + "style": "IPY_MODEL_0bce1deff0d64bf7a96b6307efd4544e", + "_dom_classes": [], + "description": "Eval (semeval, Val): 100%", + "_model_name": "FloatProgressModel", + "bar_style": "success", + "max": 7, + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": 7, + "_view_count": null, + "_view_module_version": "1.5.0", + "orientation": "horizontal", + "min": 0, + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_91fac974c5eb4f19b7b0cf18e3521d82" + } + }, + "e34035b4fc8348f2ab108b9edc5d0322": { + "model_module": "@jupyter-widgets/controls", + "model_name": "HTMLModel", + "state": { + "_view_name": "HTMLView", + "style": "IPY_MODEL_968570f0cb0a45c7ab5ab76e00936ae3", + "_dom_classes": [], + "description": "", + "_model_name": "HTMLModel", + "placeholder": "​", + "_view_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "value": " 7/7 [00:00<00:00, 9.29it/s]", + "_view_count": null, + "_view_module_version": "1.5.0", + "description_tooltip": null, + "_model_module": "@jupyter-widgets/controls", + "layout": "IPY_MODEL_03fb6747a39646e3b7dda6f877ce19fe" + } + }, + "0bce1deff0d64bf7a96b6307efd4544e": { + "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" + } + }, + "91fac974c5eb4f19b7b0cf18e3521d82": { + "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 + } + }, + "968570f0cb0a45c7ab5ab76e00936ae3": { + "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" + } + }, + "03fb6747a39646e3b7dda6f877ce19fe": { + "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 + } } + } + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "O9I9rz0pTamX" + }, + "source": [ + "# Edge-Probing Fine-tuning Example" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "EiowR0WNTd1C" + }, + "source": [ + "In this notebook, we will:\n", + "\n", + "* Train a RoBERTa base model on Edge-Probing (Semeval) and evaluate its performance\n", + "* Because the Edge-Probing data is not publicly available, we will simulate the run with a single example. This will serve as a guide for users who have access to the task data, or similarly formatted data.\n", + "* **The encoder is not frozen for training runs in this notebook.**\n", + "\n", + "The code shown in this notebook will work, but the results will not be representative of the task!" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "rXbD_U1_VDnw" + }, + "source": [ + "## Setup" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "tC9teoazUnW8" + }, + "source": [ + "#### Install dependencies\n", + "\n", + "First, we will install libraries we need for this code." + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "8aU3Z9szuMU9" + }, + "source": [ + "%%capture\n", + "!git clone https://github.com/nyu-mll/jiant.git\n", + "%cd jiant\n", + "!pip install -r requirements-no-torch.txt\n", + "!pip install --no-deps -e ./\n", + "%cd .." + ], + "execution_count": 1, + "outputs": [] }, - "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "rQKSAhYzVIlv" + }, + "source": [ + "## `jiant` Pipeline" + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "v88oXqmBvFuK" + }, + "source": [ + "import sys\n", + "sys.path.insert(0, \"/content/jiant\")" + ], + "execution_count": 2, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "ibmMT7CXv1_P" + }, + "source": [ + "import jiant.proj.main.tokenize_and_cache as tokenize_and_cache\n", + "import jiant.proj.main.export_model as export_model\n", + "import jiant.proj.main.scripts.configurator as configurator\n", + "import jiant.proj.main.runscript as main_runscript\n", + "import jiant.shared.caching as caching\n", + "import jiant.utils.python.io as py_io\n", + "import jiant.utils.display as display\n", + "import os" + ], + "execution_count": 3, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "-ihjR1g_1phl" + }, + "source": [ + "## Creating sample Edge-Probing data.\n", + "\n", + "Because the Edge-Probing data is not publicly available, we will simulate the run with a single example. We will write 1000 copies for the training set and 100 copies for the validation set. We will also write the corresponding task config." + ] + }, + { + "cell_type": "code", + "metadata": { + "id": "jKCz8VksvFlN" + }, + "source": [ + "example = {\n", + " \"text\": \"The current view is that the chronic inflammation in the distal part of the stomach caused by Helicobacter pylori infection results in an increased acid production from the non-infected upper corpus region of the stomach.\",\n", + " \"info\": {\"id\": 7},\n", + " \"targets\": [\n", + " {\n", + " \"label\": \"Cause-Effect(e2,e1)\",\n", + " \"span1\": [7,8],\n", + " \"span2\": [19, 20],\n", + " \"info\": {\"comment\": \"\"}\n", + " }\n", + " ]\n", + "}\n", + "# Simulate a training set of 1000 examples\n", + "train_data = [example] * 1000\n", + "# Simulate a validation set of 100 examples\n", + "val_data = [example] * 100" + ], + "execution_count": 4, + "outputs": [] + }, + { + "cell_type": "code", + "metadata": { + "id": "Uvt8Zi86yHHa" + }, + "source": [ + "os.makedirs(\"/content/tasks/configs/\", exist_ok=True)\n", + "os.makedirs(\"/content/tasks/data/semeval\", exist_ok=True)\n", + "py_io.write_jsonl(\n", + " data=train_data,\n", + " path=\"/content/tasks/data/semeval/train.jsonl\",\n", + ")\n", + "py_io.write_jsonl(\n", + " data=val_data,\n", + " path=\"/content/tasks/data/semeval/val.jsonl\",\n", + ")\n", + "py_io.write_json({\n", + " \"task\": \"semeval\",\n", + " \"paths\": {\n", + " \"train\": \"/content/tasks/data/semeval/train.jsonl\",\n", + " \"val\": \"/content/tasks/data/semeval/val.jsonl\",\n", + " },\n", + " \"name\": \"semeval\"\n", + "}, \"/content/tasks/configs/semeval_config.json\")" + ], + "execution_count": 5, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "HPZHyLOlVp07" + }, + "source": [ + "#### Download model\n", + "\n", + "Next, we will download a `roberta-base` model. This also includes the tokenizer." + ] + }, + { + "cell_type": "code", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 269, + "referenced_widgets": [ + "0ad0c4ef8cc64749b6bd2ccb2ba41563", + "d0fb730b54044b8583fdf3ee0476cb52", + "4d260f0aaa1d4e1498c8895bf3c418b2", + "bf55400872a34cbcb3527870b2191c8f", + "1a0f2e4658744f6abfbfd1a3c8ae0d81", + "448fafdecf8c46588f95cc4383942e59", + "a233d58461ad4ab98181153139d76571", + "660a5872700947a4b20a7eb2d3eb80ac", + "273d939ae19a47ae976c3a7afe9403b8", + "e99430b62eb141798053b07ea119a1ad", + "cb0bcb188961445b96feec69f0477eea", + "40a3f4a2ac2240469a787a06e4a6a361", + "ca9f84de217a46acaf4906bad6851c7b", + "a27515c619da49e187318ae10c3afb46", + "e8f2532f90134a07b1e2727a7b83471c", + "fe65d5ec01ea4f95a19808d8894d1e2c", + "cba1747a59364cab89af52f64d7d2be4", + "04c29dbb9a154153a86eb7e35d7a374e", + "78f0337d61ff43b3ba17719c4f9e05fa", + "49fcb769f4e34e2d870b8aff33267cb9", + "f9770a94eb4044dd90fe74991c56d1c5", + "afe39f56bc4c40f8967a6e5b358d9476", + "e1c00cf74ea94eb9b61afd46bb042025", + "0aee9253d3a14716a0a67dfda31f7a0f", + "c795cd64b082451f9876de86ea6353ea", + "089916ffd2064364acae7fbb0f77113e", + "74b9301d8a3a4bd7a6fb4c15cd6f26a0", + "aa6beffff7f34d59a6552f45725f1c77", + "908f97b966be42d0a995df0dbb3ebd2b", + "a4067515d3e34605a03e21fe7e4b1957", + "9783cdbe47fd4177ba89e447bf843a25", + "4fb3f4ea5d9c4705b3e9b0dd0408fe07" + ] + }, + "id": "K06qUGjkKWa7", + "outputId": "c21bdffa-0ff3-49f3-e734-af5530ab4711" + }, + "source": [ + "export_model.export_model(\n", + " hf_pretrained_model_name_or_path=\"roberta-base\",\n", + " output_base_path=\"./models/roberta-base\",\n", + ")" + ], + "execution_count": 6, + "outputs": [ { - "cell_type": "markdown", - "metadata": { - "id": "O9I9rz0pTamX" + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "0ad0c4ef8cc64749b6bd2ccb2ba41563", + "version_minor": 0, + "version_major": 2 }, - "source": [ - "# Edge-Probing Fine-tuning Example" + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=481.0, style=ProgressStyle(description_…" ] + }, + "metadata": { + "tags": [] + } }, { - "cell_type": "markdown", - "metadata": { - "id": "EiowR0WNTd1C" - }, - "source": [ - "In this notebook, we will:\n", - "\n", - "* Train a RoBERTa base model on Edge-Probing (Semeval) and evaluate its performance\n", - "* Because the Edge-Probing data is not publicly available, we will simulate the run with a single example. This will serve as a guide for users who have access to the task data, or similarly formatted data.\n", - "* **The encoder is not frozen for training runs in this notebook.**\n", - "\n", - "The code shown in this notebook will work, but the results will not be representative of the task!" - ] + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" }, { - "cell_type": "markdown", - "metadata": { - "id": "rXbD_U1_VDnw" + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "273d939ae19a47ae976c3a7afe9403b8", + "version_minor": 0, + "version_major": 2 }, - "source": [ - "## Setup" + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=501200538.0, style=ProgressStyle(descri…" ] + }, + "metadata": { + "tags": [] + } + }, + { + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" + }, + { + "output_type": "stream", + "text": [ + "Some weights of RobertaForMaskedLM were not initialized from the model checkpoint at roberta-base and are newly initialized: ['lm_head.decoder.bias']\n", + "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n" + ], + "name": "stderr" }, { - "cell_type": "markdown", - "metadata": { - "id": "tC9teoazUnW8" + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "cba1747a59364cab89af52f64d7d2be4", + "version_minor": 0, + "version_major": 2 }, - "source": [ - "#### Install dependencies\n", - "\n", - "First, we will install libraries we need for this code." + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=898823.0, style=ProgressStyle(descripti…" ] + }, + "metadata": { + "tags": [] + } }, { - "cell_type": "code", - "metadata": { - "id": "8aU3Z9szuMU9" - }, - "source": [ - "%%capture\n", - "!git clone https://github.com/nyu-mll/jiant.git\n", - "%cd jiant\n", - "!pip install -r requirements-no-torch.txt\n", - "!pip install --no-deps -e ./\n", - "%cd .." - ], - "execution_count": 1, - "outputs": [] + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" }, { - "cell_type": "markdown", - "metadata": { - "id": "rQKSAhYzVIlv" + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c795cd64b082451f9876de86ea6353ea", + "version_minor": 0, + "version_major": 2 }, - "source": [ - "## `jiant` Pipeline" + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=456318.0, style=ProgressStyle(descripti…" ] + }, + "metadata": { + "tags": [] + } }, { - "cell_type": "code", - "metadata": { - "id": "v88oXqmBvFuK" - }, - "source": [ - "import sys\n", - "sys.path.insert(0, \"/content/jiant\")" - ], - "execution_count": 2, - "outputs": [] + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" + } + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "dV-T-8r1V0wf" + }, + "source": [ + "#### Tokenize and cache\n", + "\n", + "With the model and data ready, we can now tokenize and cache the inputs features for our task. This converts the input examples to tokenized features ready to be consumed by the model, and saved them to disk in chunks." + ] + }, + { + "cell_type": "code", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 168, + "referenced_widgets": [ + "558652d65c9c42e5b2487711ea8c5183", + "b59db489de7a410fb16ac4c64554c2db", + "648bd87cbe344ce786e78d902456be01", + "763685078bfa425a84652935a1d49965", + "5cada33c5612410482ab58422f866621", + "635bed807450413797ec7d1c8a16444d", + "9878a78abe8e41c585f63ed1e77309ea", + "2b0ee8fa0e614926b8ea2befa8d93893", + "6bfcf6f5ebc144e88f55e1501c398ab3", + "0fe088ff545b4642993a0395bc0351af", + "6644d495d3ab4198962cc3e4fd130fe0", + "95e0eeb66af842fc9a5ea7072e665045", + "13039f3a86204fdea19dd335aaa66519", + "effe903b59b24573b1c3e406b986dfac", + "b6aeddb44c3147e2ab912d84759bc139", + "1b51de8cdcbd4c01af4de5865e9c575d" + ] }, + "id": "22bNWQajO4zm", + "outputId": "a8cf3ed5-c86f-42aa-9a20-c9e97dc51998" + }, + "source": [ + "# Tokenize and cache each task\n", + "task_name = \"semeval\"\n", + "\n", + "tokenize_and_cache.main(tokenize_and_cache.RunConfiguration(\n", + " task_config_path=f\"./tasks/configs/{task_name}_config.json\",\n", + " hf_pretrained_model_name_or_path=\"roberta-base\",\n", + " output_dir=f\"./cache/{task_name}\",\n", + " phases=[\"train\", \"val\"],\n", + "))" + ], + "execution_count": 7, + "outputs": [ { - "cell_type": "code", - "metadata": { - "id": "ibmMT7CXv1_P" - }, - "source": [ - "import jiant.proj.main.tokenize_and_cache as tokenize_and_cache\n", - "import jiant.proj.main.export_model as export_model\n", - "import jiant.proj.main.scripts.configurator as configurator\n", - "import jiant.proj.main.runscript as main_runscript\n", - "import jiant.shared.caching as caching\n", - "import jiant.utils.python.io as py_io\n", - "import jiant.utils.display as display\n", - "import os" - ], - "execution_count": 3, - "outputs": [] + "output_type": "stream", + "text": [ + "SemevalTask\n", + " [train]: /content/tasks/data/semeval/train.jsonl\n", + " [val]: /content/tasks/data/semeval/val.jsonl\n" + ], + "name": "stdout" }, { - "cell_type": "markdown", - "metadata": { - "id": "-ihjR1g_1phl" + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "558652d65c9c42e5b2487711ea8c5183", + "version_minor": 0, + "version_major": 2 }, - "source": [ - "## Creating sample Edge-Probing data.\n", - "\n", - "Because the Edge-Probing data is not publicly available, we will simulate the run with a single example. We will write 1000 copies for the training set and 100 copies for the validation set. We will also write the corresponding task config." + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Tokenizing', max=1000.0, style=ProgressStyle(description_…" ] + }, + "metadata": { + "tags": [] + } }, { - "cell_type": "code", - "metadata": { - "id": "jKCz8VksvFlN" - }, - "source": [ - "example = {\n", - " \"text\": \"The current view is that the chronic inflammation in the distal part of the stomach caused by Helicobacter pylori infection results in an increased acid production from the non-infected upper corpus region of the stomach.\",\n", - " \"info\": {\"id\": 7},\n", - " \"targets\": [\n", - " {\n", - " \"label\": \"Cause-Effect(e2,e1)\",\n", - " \"span1\": [7,8],\n", - " \"span2\": [19, 20],\n", - " \"info\": {\"comment\": \"\"}\n", - " }\n", - " ]\n", - "}\n", - "# Simulate a training set of 1000 examples\n", - "train_data = [example] * 1000\n", - "# Simulate a validation set of 100 examples\n", - "val_data = [example] * 100" - ], - "execution_count": 4, - "outputs": [] + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" }, { - "cell_type": "code", - "metadata": { - "id": "Uvt8Zi86yHHa" + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "6bfcf6f5ebc144e88f55e1501c398ab3", + "version_minor": 0, + "version_major": 2 }, - "source": [ - "os.makedirs(\"/content/tasks/configs/\", exist_ok=True)\n", - "os.makedirs(\"/content/tasks/data/semeval\", exist_ok=True)\n", - "py_io.write_jsonl(\n", - " data=train_data,\n", - " path=\"/content/tasks/data/semeval/train.jsonl\",\n", - ")\n", - "py_io.write_jsonl(\n", - " data=val_data,\n", - " path=\"/content/tasks/data/semeval/val.jsonl\",\n", - ")\n", - "py_io.write_json({\n", - " \"task\": \"semeval\",\n", - " \"paths\": {\n", - " \"train\": \"/content/tasks/data/semeval/train.jsonl\",\n", - " \"val\": \"/content/tasks/data/semeval/val.jsonl\",\n", - " },\n", - " \"name\": \"semeval\"\n", - "}, \"/content/tasks/configs/semeval_config.json\")" - ], - "execution_count": 5, - "outputs": [] + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Tokenizing', style=ProgressStyle(description_width='initi…" + ] + }, + "metadata": { + "tags": [] + } }, { - "cell_type": "markdown", - "metadata": { - "id": "HPZHyLOlVp07" - }, - "source": [ - "#### Download model\n", - "\n", - "Next, we will download a `roberta-base` model. This also includes the tokenizer." - ] + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" + } + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "JJ-mWSQQWJsw" + }, + "source": [ + "We can inspect the first examples of the first chunk of each task." + ] + }, + { + "cell_type": "code", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "iLk_X0KypUyr", + "outputId": "5779503a-c60e-4d51-e587-caabb11815ff" + }, + "source": [ + "row = caching.ChunkedFilesDataCache(\"./cache/semeval/train\").load_chunk(0)[0][\"data_row\"]\n", + "print(row.input_ids)\n", + "print(row.tokens)\n", + "print(row.tokens[row.spans[0][0]: row.spans[0][1]+1])\n", + "print(row.tokens[row.spans[1][0]: row.spans[1][1]+1])" + ], + "execution_count": 14, + "outputs": [ { - "cell_type": "code", - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 269, - "referenced_widgets": [ - "0ad0c4ef8cc64749b6bd2ccb2ba41563", - "d0fb730b54044b8583fdf3ee0476cb52", - "4d260f0aaa1d4e1498c8895bf3c418b2", - "bf55400872a34cbcb3527870b2191c8f", - "1a0f2e4658744f6abfbfd1a3c8ae0d81", - "448fafdecf8c46588f95cc4383942e59", - "a233d58461ad4ab98181153139d76571", - "660a5872700947a4b20a7eb2d3eb80ac", - "273d939ae19a47ae976c3a7afe9403b8", - "e99430b62eb141798053b07ea119a1ad", - "cb0bcb188961445b96feec69f0477eea", - "40a3f4a2ac2240469a787a06e4a6a361", - "ca9f84de217a46acaf4906bad6851c7b", - "a27515c619da49e187318ae10c3afb46", - "e8f2532f90134a07b1e2727a7b83471c", - "fe65d5ec01ea4f95a19808d8894d1e2c", - "cba1747a59364cab89af52f64d7d2be4", - "04c29dbb9a154153a86eb7e35d7a374e", - "78f0337d61ff43b3ba17719c4f9e05fa", - "49fcb769f4e34e2d870b8aff33267cb9", - "f9770a94eb4044dd90fe74991c56d1c5", - "afe39f56bc4c40f8967a6e5b358d9476", - "e1c00cf74ea94eb9b61afd46bb042025", - "0aee9253d3a14716a0a67dfda31f7a0f", - "c795cd64b082451f9876de86ea6353ea", - "089916ffd2064364acae7fbb0f77113e", - "74b9301d8a3a4bd7a6fb4c15cd6f26a0", - "aa6beffff7f34d59a6552f45725f1c77", - "908f97b966be42d0a995df0dbb3ebd2b", - "a4067515d3e34605a03e21fe7e4b1957", - "9783cdbe47fd4177ba89e447bf843a25", - "4fb3f4ea5d9c4705b3e9b0dd0408fe07" - ] - }, - "id": "K06qUGjkKWa7", - "outputId": "c21bdffa-0ff3-49f3-e734-af5530ab4711" - }, - "source": [ - "export_model.export_model(\n", - " hf_pretrained_model_name_or_path=\"roberta-base\",\n", - " output_base_path=\"./models/roberta-base\",\n", - ")" - ], - "execution_count": 6, - "outputs": [ - { - "output_type": "display_data", - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "0ad0c4ef8cc64749b6bd2ccb2ba41563", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=481.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": "273d939ae19a47ae976c3a7afe9403b8", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=501200538.0, style=ProgressStyle(descri…" - ] - }, - "metadata": { - "tags": [] - } - }, - { - "output_type": "stream", - "text": [ - "\n" - ], - "name": "stdout" - }, - { - "output_type": "stream", - "text": [ - "Some weights of RobertaForMaskedLM were not initialized from the model checkpoint at roberta-base and are newly initialized: ['lm_head.decoder.bias']\n", - "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n" - ], - "name": "stderr" - }, - { - "output_type": "display_data", - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "cba1747a59364cab89af52f64d7d2be4", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=898823.0, style=ProgressStyle(descripti…" - ] - }, - "metadata": { - "tags": [] - } - }, - { - "output_type": "stream", - "text": [ - "\n" - ], - "name": "stdout" - }, - { - "output_type": "display_data", - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "c795cd64b082451f9876de86ea6353ea", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, description='Downloading', max=456318.0, style=ProgressStyle(descripti…" - ] - }, - "metadata": { - "tags": [] - } - }, - { - "output_type": "stream", - "text": [ - "\n" - ], - "name": "stdout" - } - ] + "output_type": "stream", + "text": [ + "[ 0 133 595 1217 16 14 5 7642 16000 11 5 7018\n", + " 337 233 9 5 9377 1726 30 31141 2413 35995 181 4360\n", + " 6249 7910 775 11 41 1130 10395 931 31 5 786 12\n", + " 37597 196 2853 42168 976 9 5 9377 4 2 1 1\n", + " 1 1 1 1 1 1 1 1 1 1 1 1\n", + " 1 1 1 1 1 1 1 1 1 1 1 1\n", + " 1 1 1 1 1 1 1 1 1 1 1 1\n", + " 1 1 1 1 1 1 1 1 1 1 1 1\n", + " 1 1 1 1 1 1 1 1 1 1 1 1\n", + " 1 1 1 1 1 1 1 1 1 1 1 1\n", + " 1 1 1 1 1 1 1 1]\n", + "['', 'The', 'Ġcurrent', 'Ġview', 'Ġis', 'Ġthat', 'Ġthe', 'Ġchronic', 'Ġinflammation', 'Ġin', 'Ġthe', 'Ġdist', 'al', 'Ġpart', 'Ġof', 'Ġthe', 'Ġstomach', 'Ġcaused', 'Ġby', 'ĠHelic', 'ob', 'acter', 'Ġp', 'yl', 'ori', 'Ġinfection', 'Ġresults', 'Ġin', 'Ġan', 'Ġincreased', 'Ġacid', 'Ġproduction', 'Ġfrom', 'Ġthe', 'Ġnon', '-', 'infect', 'ed', 'Ġupper', 'Ġcorpus', 'Ġregion', 'Ġof', 'Ġthe', 'Ġstomach', '.', '']\n", + "['Ġinflammation']\n", + "['Ġinfection']\n" + ], + "name": "stdout" + } + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "3MBuH19IWOr0" + }, + "source": [ + "#### Writing a run config\n", + "\n", + "Here we are going to write what we call a `jiant_task_container_config`. This configuration file basically defines a lot of the subtleties of our training pipeline, such as what tasks we will train on, do evaluation on, batch size for each task. The new version of `jiant` leans heavily toward explicitly specifying everything, for the purpose of inspectability and leaving minimal surprises for the user, even as the cost of being more verbose.\n", + "\n", + "We use a helper \"Configurator\" to write out a `jiant_task_container_config`, since most of our setup is pretty standard. \n", + "\n", + "**Depending on what GPU your Colab session is assigned to, you may need to lower the train batch size.**" + ] + }, + { + "cell_type": "code", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" }, + "id": "pQYtl7xTKsiP", + "outputId": "00d58dc6-3d0d-40fa-8a3f-d19553803567" + }, + "source": [ + "jiant_run_config = configurator.SimpleAPIMultiTaskConfigurator(\n", + " task_config_base_path=\"./tasks/configs\",\n", + " task_cache_base_path=\"./cache\",\n", + " train_task_name_list=[\"semeval\"],\n", + " val_task_name_list=[\"semeval\"],\n", + " train_batch_size=8,\n", + " eval_batch_size=16,\n", + " epochs=3,\n", + " num_gpus=1,\n", + ").create_config()\n", + "os.makedirs(\"./run_configs/\", exist_ok=True)\n", + "py_io.write_json(jiant_run_config, \"./run_configs/semeval_run_config.json\")\n", + "display.show_json(jiant_run_config)" + ], + "execution_count": 15, + "outputs": [ { - "cell_type": "markdown", - "metadata": { - "id": "dV-T-8r1V0wf" - }, - "source": [ - "#### Tokenize and cache\n", - "\n", - "With the model and data ready, we can now tokenize and cache the inputs features for our task. This converts the input examples to tokenized features ready to be consumed by the model, and saved them to disk in chunks." - ] + "output_type": "stream", + "text": [ + "{\n", + " \"task_config_path_dict\": {\n", + " \"semeval\": \"./tasks/configs/semeval_config.json\"\n", + " },\n", + " \"task_cache_config_dict\": {\n", + " \"semeval\": {\n", + " \"train\": \"./cache/semeval/train\",\n", + " \"val\": \"./cache/semeval/val\",\n", + " \"val_labels\": \"./cache/semeval/val_labels\"\n", + " }\n", + " },\n", + " \"sampler_config\": {\n", + " \"sampler_type\": \"ProportionalMultiTaskSampler\"\n", + " },\n", + " \"global_train_config\": {\n", + " \"max_steps\": 375,\n", + " \"warmup_steps\": 37\n", + " },\n", + " \"task_specific_configs_dict\": {\n", + " \"semeval\": {\n", + " \"train_batch_size\": 8,\n", + " \"eval_batch_size\": 16,\n", + " \"gradient_accumulation_steps\": 1,\n", + " \"eval_subset_num\": 500\n", + " }\n", + " },\n", + " \"taskmodels_config\": {\n", + " \"task_to_taskmodel_map\": {\n", + " \"semeval\": \"semeval\"\n", + " },\n", + " \"taskmodel_config_map\": {\n", + " \"semeval\": null\n", + " }\n", + " },\n", + " \"task_run_config\": {\n", + " \"train_task_list\": [\n", + " \"semeval\"\n", + " ],\n", + " \"train_val_task_list\": [\n", + " \"semeval\"\n", + " ],\n", + " \"val_task_list\": [\n", + " \"semeval\"\n", + " ],\n", + " \"test_task_list\": []\n", + " },\n", + " \"metric_aggregator_config\": {\n", + " \"metric_aggregator_type\": \"EqualMetricAggregator\"\n", + " }\n", + "}\n" + ], + "name": "stdout" + } + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "-UF501yoXHBi" + }, + "source": [ + "To briefly go over the major components of the `jiant_task_container_config`:\n", + "\n", + "* `task_config_path_dict`: The paths to the task config files we wrote above.\n", + "* `task_cache_config_dict`: The paths to the task features caches we generated above.\n", + "* `sampler_config`: Determines how to sample from different tasks during training.\n", + "* `global_train_config`: The number of total steps and warmup steps during training.\n", + "* `task_specific_configs_dict`: Task-specific arguments for each task, such as training batch size and gradient accumulation steps.\n", + "* `taskmodels_config`: Task-model specific arguments for each task-model, including what tasks use which model.\n", + "* `metric_aggregator_config`: Determines how to weight/aggregate the metrics across multiple tasks." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "BBKkvXzdYPqZ" + }, + "source": [ + "#### Start training\n", + "\n", + "Finally, we can start our training run. \n", + "\n", + "Before starting training, the script also prints out the list of parameters in our model." + ] + }, + { + "cell_type": "code", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000, + "referenced_widgets": [ + "f081100984b44e45a77fff620f998508", + "69d9699a4d7147b5bf9ada54c4839488", + "e8e3b6cf03e04df99ac9799dbbe997cf", + "0ca001e7315c41359a48a37579ad7ac6", + "d4f840d6919047c795fbe22cc096ae39", + "db4132b9258440179d76382ed537257c", + "9ae696b3d7bd470787c4de833990a614", + "17a6d908da41486995c53d7436990b8b", + "7b6147ac6008406c932bb5c5fbf9c8ad", + "d41d7ce333404ac8b12feed2031f1cd2", + "ff00a73e3d474420ab697edb5626da1b", + "70693f5e1708442d9377b03600d256c4", + "d5045b7014fa46518bb0378cf52fa76f", + "e23242c190344c098076d1fc8140e6f2", + "e1a1f7ae889e45ad9b825d752c74a38d", + "bc31ec29b5f24d838401db71b345aeed", + "4b138e183eaf406a8fec6a2cc36f067a", + "ab66645a63274e67a823bed7702d5da2", + "b093c8725cf24d37861f2b38837f4bc4", + "62651b48746c4536a6814fefa89c91e6", + "f5d8d08063f340f6b32bf7f2f0fd5821", + "3dbe5ad38b23422481c2e51acdc78b20", + "9a83595e4bb74bc0948be54799248d16", + "27e02234b1764aed9156f565ec454246", + "ad747e2552c5429484dcd3d19c366a96", + "54e47f0d45d24009aa83fbb5d614e98a", + "ab6394febb5b4d48b9d26d9846f0eb87", + "e34035b4fc8348f2ab108b9edc5d0322", + "0bce1deff0d64bf7a96b6307efd4544e", + "91fac974c5eb4f19b7b0cf18e3521d82", + "968570f0cb0a45c7ab5ab76e00936ae3", + "03fb6747a39646e3b7dda6f877ce19fe" + ] }, + "id": "JdwWPgjQWx6I", + "outputId": "ba7e86d3-76e4-47bc-b61a-188783502323" + }, + "source": [ + "run_args = main_runscript.RunConfiguration(\n", + " jiant_task_container_config_path=\"./run_configs/semeval_run_config.json\",\n", + " output_dir=\"./runs/semeval\",\n", + " hf_pretrained_model_name_or_path=\"roberta-base\",\n", + " model_path=\"./models/roberta-base/model/roberta.p\",\n", + " model_config_path=\"./models/roberta-base/model/roberta.json\",\n", + " learning_rate=1e-5,\n", + " eval_every_steps=500,\n", + " do_train=True,\n", + " do_val=True,\n", + " do_save=True,\n", + " force_overwrite=True,\n", + ")\n", + "main_runscript.run_loop(run_args)" + ], + "execution_count": 16, + "outputs": [ { - "cell_type": "code", - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 168, - "referenced_widgets": [ - "558652d65c9c42e5b2487711ea8c5183", - "b59db489de7a410fb16ac4c64554c2db", - "648bd87cbe344ce786e78d902456be01", - "763685078bfa425a84652935a1d49965", - "5cada33c5612410482ab58422f866621", - "635bed807450413797ec7d1c8a16444d", - "9878a78abe8e41c585f63ed1e77309ea", - "2b0ee8fa0e614926b8ea2befa8d93893", - "6bfcf6f5ebc144e88f55e1501c398ab3", - "0fe088ff545b4642993a0395bc0351af", - "6644d495d3ab4198962cc3e4fd130fe0", - "95e0eeb66af842fc9a5ea7072e665045", - "13039f3a86204fdea19dd335aaa66519", - "effe903b59b24573b1c3e406b986dfac", - "b6aeddb44c3147e2ab912d84759bc139", - "1b51de8cdcbd4c01af4de5865e9c575d" - ] - }, - "id": "22bNWQajO4zm", - "outputId": "a8cf3ed5-c86f-42aa-9a20-c9e97dc51998" - }, - "source": [ - "# Tokenize and cache each task\n", - "task_name = \"semeval\"\n", - "\n", - "tokenize_and_cache.main(tokenize_and_cache.RunConfiguration(\n", - " task_config_path=f\"./tasks/configs/{task_name}_config.json\",\n", - " hf_pretrained_model_name_or_path=\"roberta-base\",\n", - " output_dir=f\"./cache/{task_name}\",\n", - " phases=[\"train\", \"val\"],\n", - "))" - ], - "execution_count": 7, - "outputs": [ - { - "output_type": "stream", - "text": [ - "SemevalTask\n", - " [train]: /content/tasks/data/semeval/train.jsonl\n", - " [val]: /content/tasks/data/semeval/val.jsonl\n" - ], - "name": "stdout" - }, - { - "output_type": "display_data", - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "558652d65c9c42e5b2487711ea8c5183", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, description='Tokenizing', max=1000.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": "6bfcf6f5ebc144e88f55e1501c398ab3", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, description='Tokenizing', style=ProgressStyle(description_width='initi…" - ] - }, - "metadata": { - "tags": [] - } - }, - { - "output_type": "stream", - "text": [ - "\n" - ], - "name": "stdout" - } - ] + "output_type": "stream", + "text": [ + " jiant_task_container_config_path: ./run_configs/semeval_run_config.json\n", + " output_dir: ./runs/semeval\n", + " model_type: roberta-base\n", + " model_path: ./models/roberta-base/model/roberta-base.p\n", + " model_config_path: ./models/roberta-base/model/roberta-base.json\n", + " model_load_mode: from_transformers\n", + " do_train: True\n", + " do_val: True\n", + " do_save: True\n", + " do_save_last: False\n", + " do_save_best: False\n", + " write_val_preds: False\n", + " write_test_preds: False\n", + " eval_every_steps: 500\n", + " save_every_steps: 0\n", + " save_checkpoint_every_steps: 0\n", + " no_improvements_for_n_evals: 0\n", + " keep_checkpoint_when_done: False\n", + " force_overwrite: True\n", + " seed: -1\n", + " learning_rate: 1e-05\n", + " adam_epsilon: 1e-08\n", + " max_grad_norm: 1.0\n", + " optimizer_type: adam\n", + " no_cuda: False\n", + " fp16: False\n", + " fp16_opt_level: O1\n", + " local_rank: -1\n", + " server_ip: \n", + " server_port: \n", + "device: cuda n_gpu: 1, distributed training: False, 16-bits training: False\n", + "Using seed: 195818355\n", + "{\n", + " \"jiant_task_container_config_path\": \"./run_configs/semeval_run_config.json\",\n", + " \"output_dir\": \"./runs/semeval\",\n", + " \"model_type\": \"roberta-base\",\n", + " \"model_path\": \"./models/roberta-base/model/roberta-base.p\",\n", + " \"model_config_path\": \"./models/roberta-base/model/roberta-base.json\",\n", + " \"model_load_mode\": \"from_transformers\",\n", + " \"do_train\": true,\n", + " \"do_val\": true,\n", + " \"do_save\": true,\n", + " \"do_save_last\": false,\n", + " \"do_save_best\": false,\n", + " \"write_val_preds\": false,\n", + " \"write_test_preds\": false,\n", + " \"eval_every_steps\": 500,\n", + " \"save_every_steps\": 0,\n", + " \"save_checkpoint_every_steps\": 0,\n", + " \"no_improvements_for_n_evals\": 0,\n", + " \"keep_checkpoint_when_done\": false,\n", + " \"force_overwrite\": true,\n", + " \"seed\": 195818355,\n", + " \"learning_rate\": 1e-05,\n", + " \"adam_epsilon\": 1e-08,\n", + " \"max_grad_norm\": 1.0,\n", + " \"optimizer_type\": \"adam\",\n", + " \"no_cuda\": false,\n", + " \"fp16\": false,\n", + " \"fp16_opt_level\": \"O1\",\n", + " \"local_rank\": -1,\n", + " \"server_ip\": \"\",\n", + " \"server_port\": \"\"\n", + "}\n", + "1\n", + "Creating Tasks:\n", + " semeval (SemevalTask): ./tasks/configs/semeval_config.json\n" + ], + "name": "stdout" }, { - "cell_type": "markdown", - "metadata": { - "id": "JJ-mWSQQWJsw" - }, - "source": [ - "We can inspect the first examples of the first chunk of each task." - ] + "output_type": "stream", + "text": [ + "/content/jiant/jiant/proj/main/components/container_setup.py:78: UserWarning: task semeval from ./tasks/configs/semeval_config.json has conflicting names: semeval/semval. Using semeval\n", + " task_name, task_config_path, task_name, task.name, task_name,\n" + ], + "name": "stderr" }, { - "cell_type": "code", - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "iLk_X0KypUyr", - "outputId": "5779503a-c60e-4d51-e587-caabb11815ff" - }, - "source": [ - "row = caching.ChunkedFilesDataCache(\"./cache/semeval/train\").load_chunk(0)[0][\"data_row\"]\n", - "print(row.input_ids)\n", - "print(row.tokens)\n", - "print(row.tokens[row.spans[0][0]: row.spans[0][1]+1])\n", - "print(row.tokens[row.spans[1][0]: row.spans[1][1]+1])" - ], - "execution_count": 14, - "outputs": [ - { - "output_type": "stream", - "text": [ - "[ 0 133 595 1217 16 14 5 7642 16000 11 5 7018\n", - " 337 233 9 5 9377 1726 30 31141 2413 35995 181 4360\n", - " 6249 7910 775 11 41 1130 10395 931 31 5 786 12\n", - " 37597 196 2853 42168 976 9 5 9377 4 2 1 1\n", - " 1 1 1 1 1 1 1 1 1 1 1 1\n", - " 1 1 1 1 1 1 1 1 1 1 1 1\n", - " 1 1 1 1 1 1 1 1 1 1 1 1\n", - " 1 1 1 1 1 1 1 1 1 1 1 1\n", - " 1 1 1 1 1 1 1 1 1 1 1 1\n", - " 1 1 1 1 1 1 1 1 1 1 1 1\n", - " 1 1 1 1 1 1 1 1]\n", - "['', 'The', 'Ġcurrent', 'Ġview', 'Ġis', 'Ġthat', 'Ġthe', 'Ġchronic', 'Ġinflammation', 'Ġin', 'Ġthe', 'Ġdist', 'al', 'Ġpart', 'Ġof', 'Ġthe', 'Ġstomach', 'Ġcaused', 'Ġby', 'ĠHelic', 'ob', 'acter', 'Ġp', 'yl', 'ori', 'Ġinfection', 'Ġresults', 'Ġin', 'Ġan', 'Ġincreased', 'Ġacid', 'Ġproduction', 'Ġfrom', 'Ġthe', 'Ġnon', '-', 'infect', 'ed', 'Ġupper', 'Ġcorpus', 'Ġregion', 'Ġof', 'Ġthe', 'Ġstomach', '.', '']\n", - "['Ġinflammation']\n", - "['Ġinfection']\n" - ], - "name": "stdout" - } - ] + "output_type": "stream", + "text": [ + "No optimizer decay for:\n", + " encoder.embeddings.LayerNorm.weight\n", + " encoder.embeddings.LayerNorm.bias\n", + " encoder.encoder.layer.0.attention.self.query.bias\n", + " encoder.encoder.layer.0.attention.self.key.bias\n", + " encoder.encoder.layer.0.attention.self.value.bias\n", + " encoder.encoder.layer.0.attention.output.dense.bias\n", + " encoder.encoder.layer.0.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.0.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.0.intermediate.dense.bias\n", + " encoder.encoder.layer.0.output.dense.bias\n", + " encoder.encoder.layer.0.output.LayerNorm.weight\n", + " encoder.encoder.layer.0.output.LayerNorm.bias\n", + " encoder.encoder.layer.1.attention.self.query.bias\n", + " encoder.encoder.layer.1.attention.self.key.bias\n", + " encoder.encoder.layer.1.attention.self.value.bias\n", + " encoder.encoder.layer.1.attention.output.dense.bias\n", + " encoder.encoder.layer.1.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.1.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.1.intermediate.dense.bias\n", + " encoder.encoder.layer.1.output.dense.bias\n", + " encoder.encoder.layer.1.output.LayerNorm.weight\n", + " encoder.encoder.layer.1.output.LayerNorm.bias\n", + " encoder.encoder.layer.2.attention.self.query.bias\n", + " encoder.encoder.layer.2.attention.self.key.bias\n", + " encoder.encoder.layer.2.attention.self.value.bias\n", + " encoder.encoder.layer.2.attention.output.dense.bias\n", + " encoder.encoder.layer.2.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.2.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.2.intermediate.dense.bias\n", + " encoder.encoder.layer.2.output.dense.bias\n", + " encoder.encoder.layer.2.output.LayerNorm.weight\n", + " encoder.encoder.layer.2.output.LayerNorm.bias\n", + " encoder.encoder.layer.3.attention.self.query.bias\n", + " encoder.encoder.layer.3.attention.self.key.bias\n", + " encoder.encoder.layer.3.attention.self.value.bias\n", + " encoder.encoder.layer.3.attention.output.dense.bias\n", + " encoder.encoder.layer.3.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.3.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.3.intermediate.dense.bias\n", + " encoder.encoder.layer.3.output.dense.bias\n", + " encoder.encoder.layer.3.output.LayerNorm.weight\n", + " encoder.encoder.layer.3.output.LayerNorm.bias\n", + " encoder.encoder.layer.4.attention.self.query.bias\n", + " encoder.encoder.layer.4.attention.self.key.bias\n", + " encoder.encoder.layer.4.attention.self.value.bias\n", + " encoder.encoder.layer.4.attention.output.dense.bias\n", + " encoder.encoder.layer.4.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.4.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.4.intermediate.dense.bias\n", + " encoder.encoder.layer.4.output.dense.bias\n", + " encoder.encoder.layer.4.output.LayerNorm.weight\n", + " encoder.encoder.layer.4.output.LayerNorm.bias\n", + " encoder.encoder.layer.5.attention.self.query.bias\n", + " encoder.encoder.layer.5.attention.self.key.bias\n", + " encoder.encoder.layer.5.attention.self.value.bias\n", + " encoder.encoder.layer.5.attention.output.dense.bias\n", + " encoder.encoder.layer.5.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.5.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.5.intermediate.dense.bias\n", + " encoder.encoder.layer.5.output.dense.bias\n", + " encoder.encoder.layer.5.output.LayerNorm.weight\n", + " encoder.encoder.layer.5.output.LayerNorm.bias\n", + " encoder.encoder.layer.6.attention.self.query.bias\n", + " encoder.encoder.layer.6.attention.self.key.bias\n", + " encoder.encoder.layer.6.attention.self.value.bias\n", + " encoder.encoder.layer.6.attention.output.dense.bias\n", + " encoder.encoder.layer.6.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.6.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.6.intermediate.dense.bias\n", + " encoder.encoder.layer.6.output.dense.bias\n", + " encoder.encoder.layer.6.output.LayerNorm.weight\n", + " encoder.encoder.layer.6.output.LayerNorm.bias\n", + " encoder.encoder.layer.7.attention.self.query.bias\n", + " encoder.encoder.layer.7.attention.self.key.bias\n", + " encoder.encoder.layer.7.attention.self.value.bias\n", + " encoder.encoder.layer.7.attention.output.dense.bias\n", + " encoder.encoder.layer.7.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.7.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.7.intermediate.dense.bias\n", + " encoder.encoder.layer.7.output.dense.bias\n", + " encoder.encoder.layer.7.output.LayerNorm.weight\n", + " encoder.encoder.layer.7.output.LayerNorm.bias\n", + " encoder.encoder.layer.8.attention.self.query.bias\n", + " encoder.encoder.layer.8.attention.self.key.bias\n", + " encoder.encoder.layer.8.attention.self.value.bias\n", + " encoder.encoder.layer.8.attention.output.dense.bias\n", + " encoder.encoder.layer.8.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.8.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.8.intermediate.dense.bias\n", + " encoder.encoder.layer.8.output.dense.bias\n", + " encoder.encoder.layer.8.output.LayerNorm.weight\n", + " encoder.encoder.layer.8.output.LayerNorm.bias\n", + " encoder.encoder.layer.9.attention.self.query.bias\n", + " encoder.encoder.layer.9.attention.self.key.bias\n", + " encoder.encoder.layer.9.attention.self.value.bias\n", + " encoder.encoder.layer.9.attention.output.dense.bias\n", + " encoder.encoder.layer.9.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.9.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.9.intermediate.dense.bias\n", + " encoder.encoder.layer.9.output.dense.bias\n", + " encoder.encoder.layer.9.output.LayerNorm.weight\n", + " encoder.encoder.layer.9.output.LayerNorm.bias\n", + " encoder.encoder.layer.10.attention.self.query.bias\n", + " encoder.encoder.layer.10.attention.self.key.bias\n", + " encoder.encoder.layer.10.attention.self.value.bias\n", + " encoder.encoder.layer.10.attention.output.dense.bias\n", + " encoder.encoder.layer.10.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.10.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.10.intermediate.dense.bias\n", + " encoder.encoder.layer.10.output.dense.bias\n", + " encoder.encoder.layer.10.output.LayerNorm.weight\n", + " encoder.encoder.layer.10.output.LayerNorm.bias\n", + " encoder.encoder.layer.11.attention.self.query.bias\n", + " encoder.encoder.layer.11.attention.self.key.bias\n", + " encoder.encoder.layer.11.attention.self.value.bias\n", + " encoder.encoder.layer.11.attention.output.dense.bias\n", + " encoder.encoder.layer.11.attention.output.LayerNorm.weight\n", + " encoder.encoder.layer.11.attention.output.LayerNorm.bias\n", + " encoder.encoder.layer.11.intermediate.dense.bias\n", + " encoder.encoder.layer.11.output.dense.bias\n", + " encoder.encoder.layer.11.output.LayerNorm.weight\n", + " encoder.encoder.layer.11.output.LayerNorm.bias\n", + " encoder.pooler.dense.bias\n", + " taskmodels_dict.semeval.span_comparison_head.span_attention_extractor._global_attention._module.bias\n", + " taskmodels_dict.semeval.span_comparison_head.classifier.bias\n", + "Using AdamW\n" + ], + "name": "stdout" }, { - "cell_type": "markdown", - "metadata": { - "id": "3MBuH19IWOr0" + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "f081100984b44e45a77fff620f998508", + "version_minor": 0, + "version_major": 2 }, - "source": [ - "#### Writing a run config\n", - "\n", - "Here we are going to write what we call a `jiant_task_container_config`. This configuration file basically defines a lot of the subtleties of our training pipeline, such as what tasks we will train on, do evaluation on, batch size for each task. The new version of `jiant` leans heavily toward explicitly specifying everything, for the purpose of inspectability and leaving minimal surprises for the user, even as the cost of being more verbose.\n", - "\n", - "We use a helper \"Configurator\" to write out a `jiant_task_container_config`, since most of our setup is pretty standard. \n", - "\n", - "**Depending on what GPU your Colab session is assigned to, you may need to lower the train batch size.**" + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Training', max=375.0, style=ProgressStyle(description_wid…" ] + }, + "metadata": { + "tags": [] + } }, { - "cell_type": "code", - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/" - }, - "id": "pQYtl7xTKsiP", - "outputId": "00d58dc6-3d0d-40fa-8a3f-d19553803567" - }, - "source": [ - "jiant_run_config = configurator.SimpleAPIMultiTaskConfigurator(\n", - " task_config_base_path=\"./tasks/configs\",\n", - " task_cache_base_path=\"./cache\",\n", - " train_task_name_list=[\"semeval\"],\n", - " val_task_name_list=[\"semeval\"],\n", - " train_batch_size=8,\n", - " eval_batch_size=16,\n", - " epochs=3,\n", - " num_gpus=1,\n", - ").create_config()\n", - "os.makedirs(\"./run_configs/\", exist_ok=True)\n", - "py_io.write_json(jiant_run_config, \"./run_configs/semeval_run_config.json\")\n", - "display.show_json(jiant_run_config)" - ], - "execution_count": 15, - "outputs": [ - { - "output_type": "stream", - "text": [ - "{\n", - " \"task_config_path_dict\": {\n", - " \"semeval\": \"./tasks/configs/semeval_config.json\"\n", - " },\n", - " \"task_cache_config_dict\": {\n", - " \"semeval\": {\n", - " \"train\": \"./cache/semeval/train\",\n", - " \"val\": \"./cache/semeval/val\",\n", - " \"val_labels\": \"./cache/semeval/val_labels\"\n", - " }\n", - " },\n", - " \"sampler_config\": {\n", - " \"sampler_type\": \"ProportionalMultiTaskSampler\"\n", - " },\n", - " \"global_train_config\": {\n", - " \"max_steps\": 375,\n", - " \"warmup_steps\": 37\n", - " },\n", - " \"task_specific_configs_dict\": {\n", - " \"semeval\": {\n", - " \"train_batch_size\": 8,\n", - " \"eval_batch_size\": 16,\n", - " \"gradient_accumulation_steps\": 1,\n", - " \"eval_subset_num\": 500\n", - " }\n", - " },\n", - " \"taskmodels_config\": {\n", - " \"task_to_taskmodel_map\": {\n", - " \"semeval\": \"semeval\"\n", - " },\n", - " \"taskmodel_config_map\": {\n", - " \"semeval\": null\n", - " }\n", - " },\n", - " \"task_run_config\": {\n", - " \"train_task_list\": [\n", - " \"semeval\"\n", - " ],\n", - " \"train_val_task_list\": [\n", - " \"semeval\"\n", - " ],\n", - " \"val_task_list\": [\n", - " \"semeval\"\n", - " ],\n", - " \"test_task_list\": []\n", - " },\n", - " \"metric_aggregator_config\": {\n", - " \"metric_aggregator_type\": \"EqualMetricAggregator\"\n", - " }\n", - "}\n" - ], - "name": "stdout" - } - ] + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" }, { - "cell_type": "markdown", - "metadata": { - "id": "-UF501yoXHBi" + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "7b6147ac6008406c932bb5c5fbf9c8ad", + "version_minor": 0, + "version_major": 2 }, - "source": [ - "To briefly go over the major components of the `jiant_task_container_config`:\n", - "\n", - "* `task_config_path_dict`: The paths to the task config files we wrote above.\n", - "* `task_cache_config_dict`: The paths to the task features caches we generated above.\n", - "* `sampler_config`: Determines how to sample from different tasks during training.\n", - "* `global_train_config`: The number of total steps and warmup steps during training.\n", - "* `task_specific_configs_dict`: Task-specific arguments for each task, such as training batch size and gradient accumulation steps.\n", - "* `taskmodels_config`: Task-model specific arguments for each task-model, including what tasks use which model.\n", - "* `metric_aggregator_config`: Determines how to weight/aggregate the metrics across multiple tasks." + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Eval (semeval, Val)', max=7.0, style=ProgressStyle(descri…" ] + }, + "metadata": { + "tags": [] + } }, { - "cell_type": "markdown", - "metadata": { - "id": "BBKkvXzdYPqZ" - }, - "source": [ - "#### Start training\n", - "\n", - "Finally, we can start our training run. \n", - "\n", - "Before starting training, the script also prints out the list of parameters in our model." - ] + "output_type": "stream", + "text": [ + "\n" + ], + "name": "stdout" }, { - "cell_type": "code", - "metadata": { - "colab": { - "base_uri": "https://localhost:8080/", - "height": 1000, - "referenced_widgets": [ - "f081100984b44e45a77fff620f998508", - "69d9699a4d7147b5bf9ada54c4839488", - "e8e3b6cf03e04df99ac9799dbbe997cf", - "0ca001e7315c41359a48a37579ad7ac6", - "d4f840d6919047c795fbe22cc096ae39", - "db4132b9258440179d76382ed537257c", - "9ae696b3d7bd470787c4de833990a614", - "17a6d908da41486995c53d7436990b8b", - "7b6147ac6008406c932bb5c5fbf9c8ad", - "d41d7ce333404ac8b12feed2031f1cd2", - "ff00a73e3d474420ab697edb5626da1b", - "70693f5e1708442d9377b03600d256c4", - "d5045b7014fa46518bb0378cf52fa76f", - "e23242c190344c098076d1fc8140e6f2", - "e1a1f7ae889e45ad9b825d752c74a38d", - "bc31ec29b5f24d838401db71b345aeed", - "4b138e183eaf406a8fec6a2cc36f067a", - "ab66645a63274e67a823bed7702d5da2", - "b093c8725cf24d37861f2b38837f4bc4", - "62651b48746c4536a6814fefa89c91e6", - "f5d8d08063f340f6b32bf7f2f0fd5821", - "3dbe5ad38b23422481c2e51acdc78b20", - "9a83595e4bb74bc0948be54799248d16", - "27e02234b1764aed9156f565ec454246", - "ad747e2552c5429484dcd3d19c366a96", - "54e47f0d45d24009aa83fbb5d614e98a", - "ab6394febb5b4d48b9d26d9846f0eb87", - "e34035b4fc8348f2ab108b9edc5d0322", - "0bce1deff0d64bf7a96b6307efd4544e", - "91fac974c5eb4f19b7b0cf18e3521d82", - "968570f0cb0a45c7ab5ab76e00936ae3", - "03fb6747a39646e3b7dda6f877ce19fe" - ] - }, - "id": "JdwWPgjQWx6I", - "outputId": "ba7e86d3-76e4-47bc-b61a-188783502323" + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "4b138e183eaf406a8fec6a2cc36f067a", + "version_minor": 0, + "version_major": 2 }, - "source": [ - "run_args = main_runscript.RunConfiguration(\n", - " jiant_task_container_config_path=\"./run_configs/semeval_run_config.json\",\n", - " output_dir=\"./runs/semeval\",\n", - " hf_pretrained_model_name_or_path=\"roberta-base\",\n", - " model_path=\"./models/roberta-base/model/roberta-base.p\",\n", - " model_config_path=\"./models/roberta-base/model/roberta-base.json\",\n", - " learning_rate=1e-5,\n", - " eval_every_steps=500,\n", - " do_train=True,\n", - " do_val=True,\n", - " do_save=True,\n", - " force_overwrite=True,\n", - ")\n", - "main_runscript.run_loop(run_args)" - ], - "execution_count": 16, - "outputs": [ - { - "output_type": "stream", - "text": [ - " jiant_task_container_config_path: ./run_configs/semeval_run_config.json\n", - " output_dir: ./runs/semeval\n", - " model_type: roberta-base\n", - " model_path: ./models/roberta-base/model/roberta-base.p\n", - " model_config_path: ./models/roberta-base/model/roberta-base.json\n", - " model_load_mode: from_transformers\n", - " do_train: True\n", - " do_val: True\n", - " do_save: True\n", - " do_save_last: False\n", - " do_save_best: False\n", - " write_val_preds: False\n", - " write_test_preds: False\n", - " eval_every_steps: 500\n", - " save_every_steps: 0\n", - " save_checkpoint_every_steps: 0\n", - " no_improvements_for_n_evals: 0\n", - " keep_checkpoint_when_done: False\n", - " force_overwrite: True\n", - " seed: -1\n", - " learning_rate: 1e-05\n", - " adam_epsilon: 1e-08\n", - " max_grad_norm: 1.0\n", - " optimizer_type: adam\n", - " no_cuda: False\n", - " fp16: False\n", - " fp16_opt_level: O1\n", - " local_rank: -1\n", - " server_ip: \n", - " server_port: \n", - "device: cuda n_gpu: 1, distributed training: False, 16-bits training: False\n", - "Using seed: 195818355\n", - "{\n", - " \"jiant_task_container_config_path\": \"./run_configs/semeval_run_config.json\",\n", - " \"output_dir\": \"./runs/semeval\",\n", - " \"model_type\": \"roberta-base\",\n", - " \"model_path\": \"./models/roberta-base/model/roberta-base.p\",\n", - " \"model_config_path\": \"./models/roberta-base/model/roberta-base.json\",\n", - " \"model_load_mode\": \"from_transformers\",\n", - " \"do_train\": true,\n", - " \"do_val\": true,\n", - " \"do_save\": true,\n", - " \"do_save_last\": false,\n", - " \"do_save_best\": false,\n", - " \"write_val_preds\": false,\n", - " \"write_test_preds\": false,\n", - " \"eval_every_steps\": 500,\n", - " \"save_every_steps\": 0,\n", - " \"save_checkpoint_every_steps\": 0,\n", - " \"no_improvements_for_n_evals\": 0,\n", - " \"keep_checkpoint_when_done\": false,\n", - " \"force_overwrite\": true,\n", - " \"seed\": 195818355,\n", - " \"learning_rate\": 1e-05,\n", - " \"adam_epsilon\": 1e-08,\n", - " \"max_grad_norm\": 1.0,\n", - " \"optimizer_type\": \"adam\",\n", - " \"no_cuda\": false,\n", - " \"fp16\": false,\n", - " \"fp16_opt_level\": \"O1\",\n", - " \"local_rank\": -1,\n", - " \"server_ip\": \"\",\n", - " \"server_port\": \"\"\n", - "}\n", - "1\n", - "Creating Tasks:\n", - " semeval (SemevalTask): ./tasks/configs/semeval_config.json\n" - ], - "name": "stdout" - }, - { - "output_type": "stream", - "text": [ - "/content/jiant/jiant/proj/main/components/container_setup.py:78: UserWarning: task semeval from ./tasks/configs/semeval_config.json has conflicting names: semeval/semval. Using semeval\n", - " task_name, task_config_path, task_name, task.name, task_name,\n" - ], - "name": "stderr" - }, - { - "output_type": "stream", - "text": [ - "No optimizer decay for:\n", - " encoder.embeddings.LayerNorm.weight\n", - " encoder.embeddings.LayerNorm.bias\n", - " encoder.encoder.layer.0.attention.self.query.bias\n", - " encoder.encoder.layer.0.attention.self.key.bias\n", - " encoder.encoder.layer.0.attention.self.value.bias\n", - " encoder.encoder.layer.0.attention.output.dense.bias\n", - " encoder.encoder.layer.0.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.0.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.0.intermediate.dense.bias\n", - " encoder.encoder.layer.0.output.dense.bias\n", - " encoder.encoder.layer.0.output.LayerNorm.weight\n", - " encoder.encoder.layer.0.output.LayerNorm.bias\n", - " encoder.encoder.layer.1.attention.self.query.bias\n", - " encoder.encoder.layer.1.attention.self.key.bias\n", - " encoder.encoder.layer.1.attention.self.value.bias\n", - " encoder.encoder.layer.1.attention.output.dense.bias\n", - " encoder.encoder.layer.1.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.1.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.1.intermediate.dense.bias\n", - " encoder.encoder.layer.1.output.dense.bias\n", - " encoder.encoder.layer.1.output.LayerNorm.weight\n", - " encoder.encoder.layer.1.output.LayerNorm.bias\n", - " encoder.encoder.layer.2.attention.self.query.bias\n", - " encoder.encoder.layer.2.attention.self.key.bias\n", - " encoder.encoder.layer.2.attention.self.value.bias\n", - " encoder.encoder.layer.2.attention.output.dense.bias\n", - " encoder.encoder.layer.2.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.2.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.2.intermediate.dense.bias\n", - " encoder.encoder.layer.2.output.dense.bias\n", - " encoder.encoder.layer.2.output.LayerNorm.weight\n", - " encoder.encoder.layer.2.output.LayerNorm.bias\n", - " encoder.encoder.layer.3.attention.self.query.bias\n", - " encoder.encoder.layer.3.attention.self.key.bias\n", - " encoder.encoder.layer.3.attention.self.value.bias\n", - " encoder.encoder.layer.3.attention.output.dense.bias\n", - " encoder.encoder.layer.3.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.3.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.3.intermediate.dense.bias\n", - " encoder.encoder.layer.3.output.dense.bias\n", - " encoder.encoder.layer.3.output.LayerNorm.weight\n", - " encoder.encoder.layer.3.output.LayerNorm.bias\n", - " encoder.encoder.layer.4.attention.self.query.bias\n", - " encoder.encoder.layer.4.attention.self.key.bias\n", - " encoder.encoder.layer.4.attention.self.value.bias\n", - " encoder.encoder.layer.4.attention.output.dense.bias\n", - " encoder.encoder.layer.4.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.4.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.4.intermediate.dense.bias\n", - " encoder.encoder.layer.4.output.dense.bias\n", - " encoder.encoder.layer.4.output.LayerNorm.weight\n", - " encoder.encoder.layer.4.output.LayerNorm.bias\n", - " encoder.encoder.layer.5.attention.self.query.bias\n", - " encoder.encoder.layer.5.attention.self.key.bias\n", - " encoder.encoder.layer.5.attention.self.value.bias\n", - " encoder.encoder.layer.5.attention.output.dense.bias\n", - " encoder.encoder.layer.5.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.5.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.5.intermediate.dense.bias\n", - " encoder.encoder.layer.5.output.dense.bias\n", - " encoder.encoder.layer.5.output.LayerNorm.weight\n", - " encoder.encoder.layer.5.output.LayerNorm.bias\n", - " encoder.encoder.layer.6.attention.self.query.bias\n", - " encoder.encoder.layer.6.attention.self.key.bias\n", - " encoder.encoder.layer.6.attention.self.value.bias\n", - " encoder.encoder.layer.6.attention.output.dense.bias\n", - " encoder.encoder.layer.6.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.6.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.6.intermediate.dense.bias\n", - " encoder.encoder.layer.6.output.dense.bias\n", - " encoder.encoder.layer.6.output.LayerNorm.weight\n", - " encoder.encoder.layer.6.output.LayerNorm.bias\n", - " encoder.encoder.layer.7.attention.self.query.bias\n", - " encoder.encoder.layer.7.attention.self.key.bias\n", - " encoder.encoder.layer.7.attention.self.value.bias\n", - " encoder.encoder.layer.7.attention.output.dense.bias\n", - " encoder.encoder.layer.7.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.7.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.7.intermediate.dense.bias\n", - " encoder.encoder.layer.7.output.dense.bias\n", - " encoder.encoder.layer.7.output.LayerNorm.weight\n", - " encoder.encoder.layer.7.output.LayerNorm.bias\n", - " encoder.encoder.layer.8.attention.self.query.bias\n", - " encoder.encoder.layer.8.attention.self.key.bias\n", - " encoder.encoder.layer.8.attention.self.value.bias\n", - " encoder.encoder.layer.8.attention.output.dense.bias\n", - " encoder.encoder.layer.8.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.8.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.8.intermediate.dense.bias\n", - " encoder.encoder.layer.8.output.dense.bias\n", - " encoder.encoder.layer.8.output.LayerNorm.weight\n", - " encoder.encoder.layer.8.output.LayerNorm.bias\n", - " encoder.encoder.layer.9.attention.self.query.bias\n", - " encoder.encoder.layer.9.attention.self.key.bias\n", - " encoder.encoder.layer.9.attention.self.value.bias\n", - " encoder.encoder.layer.9.attention.output.dense.bias\n", - " encoder.encoder.layer.9.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.9.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.9.intermediate.dense.bias\n", - " encoder.encoder.layer.9.output.dense.bias\n", - " encoder.encoder.layer.9.output.LayerNorm.weight\n", - " encoder.encoder.layer.9.output.LayerNorm.bias\n", - " encoder.encoder.layer.10.attention.self.query.bias\n", - " encoder.encoder.layer.10.attention.self.key.bias\n", - " encoder.encoder.layer.10.attention.self.value.bias\n", - " encoder.encoder.layer.10.attention.output.dense.bias\n", - " encoder.encoder.layer.10.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.10.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.10.intermediate.dense.bias\n", - " encoder.encoder.layer.10.output.dense.bias\n", - " encoder.encoder.layer.10.output.LayerNorm.weight\n", - " encoder.encoder.layer.10.output.LayerNorm.bias\n", - " encoder.encoder.layer.11.attention.self.query.bias\n", - " encoder.encoder.layer.11.attention.self.key.bias\n", - " encoder.encoder.layer.11.attention.self.value.bias\n", - " encoder.encoder.layer.11.attention.output.dense.bias\n", - " encoder.encoder.layer.11.attention.output.LayerNorm.weight\n", - " encoder.encoder.layer.11.attention.output.LayerNorm.bias\n", - " encoder.encoder.layer.11.intermediate.dense.bias\n", - " encoder.encoder.layer.11.output.dense.bias\n", - " encoder.encoder.layer.11.output.LayerNorm.weight\n", - " encoder.encoder.layer.11.output.LayerNorm.bias\n", - " encoder.pooler.dense.bias\n", - " taskmodels_dict.semeval.span_comparison_head.span_attention_extractor._global_attention._module.bias\n", - " taskmodels_dict.semeval.span_comparison_head.classifier.bias\n", - "Using AdamW\n" - ], - "name": "stdout" - }, - { - "output_type": "display_data", - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "f081100984b44e45a77fff620f998508", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, description='Training', max=375.0, style=ProgressStyle(description_wid…" - ] - }, - "metadata": { - "tags": [] - } - }, - { - "output_type": "stream", - "text": [ - "\n" - ], - "name": "stdout" - }, - { - "output_type": "display_data", - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "7b6147ac6008406c932bb5c5fbf9c8ad", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, description='Eval (semeval, Val)', max=7.0, style=ProgressStyle(descri…" - ] - }, - "metadata": { - "tags": [] - } - }, - { - "output_type": "stream", - "text": [ - "\n" - ], - "name": "stdout" - }, - { - "output_type": "display_data", - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "4b138e183eaf406a8fec6a2cc36f067a", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, description='Eval (semeval, Val)', max=7.0, style=ProgressStyle(descri…" - ] - }, - "metadata": { - "tags": [] - } - }, - { - "output_type": "stream", - "text": [ - "\n", - "Loading Best\n" - ], - "name": "stdout" - }, - { - "output_type": "display_data", - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "ad747e2552c5429484dcd3d19c366a96", - "version_minor": 0, - "version_major": 2 - }, - "text/plain": [ - "HBox(children=(FloatProgress(value=0.0, description='Eval (semeval, Val)', max=7.0, style=ProgressStyle(descri…" - ] - }, - "metadata": { - "tags": [] - } - }, - { - "output_type": "stream", - "text": [ - "\n", - "{\n", - " \"aggregated\": 1.0,\n", - " \"semeval\": {\n", - " \"loss\": 0.007899788208305836,\n", - " \"metrics\": {\n", - " \"major\": 1.0,\n", - " \"minor\": {\n", - " \"acc\": 1.0,\n", - " \"f1_micro\": 1.0,\n", - " \"acc_and_f1_micro\": 1.0\n", - " }\n", - " }\n", - " }\n", - "}\n" - ], - "name": "stdout" - } + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Eval (semeval, Val)', max=7.0, style=ProgressStyle(descri…" ] + }, + "metadata": { + "tags": [] + } }, { - "cell_type": "markdown", - "metadata": { - "id": "4SXcuHFIYp6Y" + "output_type": "stream", + "text": [ + "\n", + "Loading Best\n" + ], + "name": "stdout" + }, + { + "output_type": "display_data", + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "ad747e2552c5429484dcd3d19c366a96", + "version_minor": 0, + "version_major": 2 }, - "source": [ - "Since we're training and evaluating on the same (duplicated) example, we should get perfect performance, but hopefully this notebook should be illustrative of the workflow for edge-probing tasks." + "text/plain": [ + "HBox(children=(FloatProgress(value=0.0, description='Eval (semeval, Val)', max=7.0, style=ProgressStyle(descri…" ] + }, + "metadata": { + "tags": [] + } + }, + { + "output_type": "stream", + "text": [ + "\n", + "{\n", + " \"aggregated\": 1.0,\n", + " \"semeval\": {\n", + " \"loss\": 0.007899788208305836,\n", + " \"metrics\": {\n", + " \"major\": 1.0,\n", + " \"minor\": {\n", + " \"acc\": 1.0,\n", + " \"f1_micro\": 1.0,\n", + " \"acc_and_f1_micro\": 1.0\n", + " }\n", + " }\n", + " }\n", + "}\n" + ], + "name": "stdout" } - ] + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "4SXcuHFIYp6Y" + }, + "source": [ + "Since we're training and evaluating on the same (duplicated) example, we should get perfect performance, but hopefully this notebook should be illustrative of the workflow for edge-probing tasks." + ] + } + ] } \ No newline at end of file diff --git a/examples/notebooks/jiant_MNLI_Diagnostic_Example.ipynb b/examples/notebooks/jiant_MNLI_Diagnostic_Example.ipynb index a3a1eaff2..d2050752d 100644 --- a/examples/notebooks/jiant_MNLI_Diagnostic_Example.ipynb +++ b/examples/notebooks/jiant_MNLI_Diagnostic_Example.ipynb @@ -68,6 +68,7 @@ "outputs": [], "source": [ "%%capture\n", + "%cd /content\n", "# Download/preprocess MNLI and Dognostic data\n", "!PYTHONPATH=/content/jiant python jiant/jiant/scripts/download_data/runscript.py \\\n", " download \\\n", @@ -321,8 +322,8 @@ " jiant_task_container_config_path=\"./run_configs/jiant_run_config.json\",\n", " output_dir=\"./runs/run1\",\n", " hf_pretrained_model_name_or_path=\"roberta-base\",\n", - " model_path=\"./models/roberta-base/model/roberta-base.p\",\n", - " model_config_path=\"./models/roberta-base/model/roberta-base.json\",\n", + " model_path=\"./models/roberta-base/model/roberta.p\",\n", + " model_config_path=\"./models/roberta-base/model/roberta.json\",\n", " learning_rate=1e-5,\n", " eval_every_steps=500,\n", " do_train=True,\n", @@ -376,4 +377,4 @@ }, "nbformat": 4, "nbformat_minor": 1 -} +} \ No newline at end of file diff --git a/examples/notebooks/jiant_Multi_Task_Example.ipynb b/examples/notebooks/jiant_Multi_Task_Example.ipynb index 1ebbf465c..7f6c9acfa 100644 --- a/examples/notebooks/jiant_Multi_Task_Example.ipynb +++ b/examples/notebooks/jiant_Multi_Task_Example.ipynb @@ -88,6 +88,7 @@ "outputs": [], "source": [ "%%capture\n", + "%cd /content\n", "# Download RTE, STS-B and CommonsenseQA data\n", "!PYTHONPATH=/content/jiant python jiant/jiant/scripts/download_data/runscript.py \\\n", " download \\\n", @@ -342,8 +343,8 @@ " jiant_task_container_config_path=\"./run_configs/jiant_run_config.json\",\n", " output_dir=\"./runs/run1\",\n", " hf_pretrained_model_name_or_path=\"roberta-base\",\n", - " model_path=\"./models/roberta-base/model/roberta-base.p\",\n", - " model_config_path=\"./models/roberta-base/model/roberta-base.json\",\n", + " model_path=\"./models/roberta-base/model/roberta.p\",\n", + " model_config_path=\"./models/roberta-base/model/roberta.json\",\n", " learning_rate=1e-5,\n", " eval_every_steps=500,\n", " do_train=True,\n", @@ -392,4 +393,4 @@ }, "nbformat": 4, "nbformat_minor": 1 -} +} \ No newline at end of file diff --git a/examples/notebooks/jiant_STILTs_Example.ipynb b/examples/notebooks/jiant_STILTs_Example.ipynb index 2292f24f4..958eb883d 100644 --- a/examples/notebooks/jiant_STILTs_Example.ipynb +++ b/examples/notebooks/jiant_STILTs_Example.ipynb @@ -90,6 +90,7 @@ "outputs": [], "source": [ "%%capture\n", + "%cd /content\n", "# Download MNLI and RTE data\n", "!PYTHONPATH=/content/jiant python jiant/jiant/scripts/download_data/runscript.py \\\n", " download \\\n", @@ -367,8 +368,8 @@ " jiant_task_container_config_path=\"./run_configs/mnli_run_config.json\",\n", " output_dir=\"./runs/mnli\",\n", " hf_pretrained_model_name_or_path=\"roberta-base\",\n", - " model_path=\"./models/roberta-base/model/roberta-base.p\",\n", - " model_config_path=\"./models/roberta-base/model/roberta-base.json\",\n", + " model_path=\"./models/roberta-base/model/roberta.p\",\n", + " model_config_path=\"./models/roberta-base/model/roberta.json\",\n", " learning_rate=1e-5,\n", " eval_every_steps=500,\n", " do_train=True,\n", @@ -405,7 +406,7 @@ " hf_pretrained_model_name_or_path=\"roberta-base\",\n", " model_path=\"./runs/mnli/best_model.p\", # Loading the best model\n", " model_load_mode=\"partial\",\n", - " model_config_path=\"./models/roberta-base/model/roberta-base.json\",\n", + " model_config_path=\"./models/roberta-base/model/roberta.json\",\n", " learning_rate=1e-5,\n", " eval_every_steps=500,\n", " do_train=True,\n", @@ -454,4 +455,4 @@ }, "nbformat": 4, "nbformat_minor": 1 -} +} \ No newline at end of file diff --git a/examples/notebooks/jiant_XNLI_Example.ipynb b/examples/notebooks/jiant_XNLI_Example.ipynb index 975f0f5a0..cdf0889b2 100644 --- a/examples/notebooks/jiant_XNLI_Example.ipynb +++ b/examples/notebooks/jiant_XNLI_Example.ipynb @@ -91,6 +91,7 @@ "outputs": [], "source": [ "%%capture\n", + "%cd /content\n", "# Download MNLI and XNLI data\n", "!PYTHONPATH=/content/jiant python jiant/jiant/scripts/download_data/runscript.py \\\n", " download \\\n", @@ -383,8 +384,8 @@ " jiant_task_container_config_path=\"./run_configs/jiant_run_config.json\",\n", " output_dir=\"./runs/run1\",\n", " hf_pretrained_model_name_or_path=\"xlm-roberta-base\",\n", - " model_path=\"./models/xlm-roberta-base/model/xlm-roberta-base.p\",\n", - " model_config_path=\"./models/xlm-roberta-base/model/xlm-roberta-base.json\",\n", + " model_path=\"./models/xlm-roberta-base/model/xlm-roberta.p\",\n", + " model_config_path=\"./models/xlm-roberta-base/model/xlm-roberta.json\",\n", " learning_rate=1e-5,\n", " eval_every_steps=500,\n", " do_train=True,\n", @@ -433,4 +434,4 @@ }, "nbformat": 4, "nbformat_minor": 1 -} +} \ No newline at end of file diff --git a/guides/tasks/supported_tasks.md b/guides/tasks/supported_tasks.md index 29e3413c8..c57842b42 100644 --- a/guides/tasks/supported_tasks.md +++ b/guides/tasks/supported_tasks.md @@ -7,8 +7,11 @@ | [Argument Reasoning Comprehension](https://arxiv.org/abs/1708.01425) | arct | ✅ | ✅ | arct | [Github](https://github.com/UKPLab/argument-reasoning-comprehension-task) | | Abductive NLI | abductive_nli | ✅ | ✅ | abductive_nli | | | SuperGLUE Winogender Diagnostic | superglue_axg | ✅ | ✅ | superglue_axg | SuperGLUE | -| Acceptability Definiteness | acceptability_definiteness | ✅ | | acceptability_definiteness | Function Words | -| Adversarial NLI | `adversarial_nli_{round}` | ✅ | | adversarial_nli | 3 rounds | +| Acceptability Definiteness | acceptability_definiteness | ✅ | ✅ | acceptability_definiteness | Function Words | +| Acceptability Coord | acceptability_coord | ✅ | ✅ | acceptability_coord | Function Words | +| Acceptability EOS | acceptability_eos | ✅ | ✅ | acceptability_eos | Function Words | +| Acceptability WH Words | acceptability_whwords | ✅ | ✅ | acceptability_whwords | Function Words | +| Adversarial NLI | `adversarial_nli_{round}` | ✅ | ✅ | adversarial_nli | 3 rounds | | ARC ("easy" version) | arc_easy | ✅ | ✅ | arc_easy | [site](https://allenai.org/data/arc) | | ARC ("challenge" version) | arc_challenge | ✅ | ✅ | arc_challenge | [site](https://allenai.org/data/arc) | | BoolQ | boolq | ✅ | ✅ | boolq | SuperGLUE | @@ -55,7 +58,16 @@ | ReCord | record | ✅ | ✅ | record | SuperGLUE | | RTE | rte | ✅ | ✅ | rte | GLUE, SuperGLUE | | SciTail | scitail | ✅ | ✅ | scitail | | -| SentEval: Tense | senteval_tense | ✅ | | senteval_tense | SentEval | +| SentEval: Bigram Shift | senteval_bigram_shift | ✅ | ✅ | senteval_bigram_shift | SentEval | +| SentEval: Coord Inversion | senteval_coordination_inversion | ✅ | ✅ | senteval_coordination_inversion | SentEval | +| SentEval: Obj number | senteval_obj_number | ✅ | ✅ | senteval_obj_number | SentEval | +| SentEval: Odd Man Out | senteval_odd_man_out | ✅ | ✅ | senteval_odd_man_out | SentEval | +| SentEval: Past-Present | senteval_past_present | ✅ | ✅ | senteval_past_present | SentEval | +| SentEval: Sentence Length | senteval_sentence_length | ✅ | ✅ | senteval_sentence_length | SentEval | +| SentEval: Subj Number | senteval_subj_number | ✅ | ✅ | senteval_subj_number | SentEval | +| SentEval: Top Constituents | senteval_top_constituents | ✅ | ✅ | senteval_top_constituents | SentEval | +| SentEval: Tree Depth | senteval_tree_depth | ✅ | ✅ | senteval_tree_depth | SentEval | +| SentEval: Word Content | senteval_word_content | ✅ | ✅ | senteval_word_content | SentEval | | EP-Rel | semeval | ✅ | | semeval | Edge-Probing | | SNLI | snli | ✅ | ✅ | snli | | | SocialIQA | socialiqa | ✅ | ✅ | socialiqa | | diff --git a/jiant/proj/main/export_model.py b/jiant/proj/main/export_model.py index 7ceae03a8..dfd1cae32 100644 --- a/jiant/proj/main/export_model.py +++ b/jiant/proj/main/export_model.py @@ -23,7 +23,7 @@ def export_model( - Tokenizer data - JSON file pointing to paths for the above Args: - pretrained_model_name_or_path (:obj:`str` or :obj:`os.PathLike`): + hf_pretrained_model_name_or_path (:obj:`str` or :obj:`os.PathLike`): Can be either: - A string, the `model id` of a pretrained model configuration diff --git a/jiant/proj/main/modeling/heads.py b/jiant/proj/main/modeling/heads.py index b68c84b56..fca8a7e28 100644 --- a/jiant/proj/main/modeling/heads.py +++ b/jiant/proj/main/modeling/heads.py @@ -221,8 +221,10 @@ class BertMLMHead(BaseMLMHead): def __init__(self, hidden_size, vocab_size, layer_norm_eps=1e-12, hidden_act="gelu"): super().__init__() self.dense = nn.Linear(hidden_size, hidden_size) - self.transform_act_fn = transformers.modeling_bert.ACT2FN[hidden_act] - self.LayerNorm = transformers.modeling_bert.BertLayerNorm(hidden_size, eps=layer_norm_eps) + self.transform_act_fn = transformers.models.bert.modeling_bert.ACT2FN[hidden_act] + self.LayerNorm = transformers.models.bert.modeling_bert.BertLayerNorm( + hidden_size, eps=layer_norm_eps + ) self.decoder = nn.Linear(hidden_size, vocab_size, bias=False) self.bias = nn.Parameter(torch.zeros(vocab_size), requires_grad=True) @@ -246,7 +248,9 @@ class RobertaMLMHead(BaseMLMHead): def __init__(self, hidden_size, vocab_size, layer_norm_eps=1e-12): super().__init__() self.dense = nn.Linear(hidden_size, hidden_size) - self.layer_norm = transformers.modeling_bert.BertLayerNorm(hidden_size, eps=layer_norm_eps) + self.layer_norm = transformers.models.bert.modeling_bert.BertLayerNorm( + hidden_size, eps=layer_norm_eps + ) self.decoder = nn.Linear(hidden_size, vocab_size, bias=False) self.bias = nn.Parameter(torch.zeros(vocab_size), requires_grad=True) @@ -257,7 +261,7 @@ def __init__(self, hidden_size, vocab_size, layer_norm_eps=1e-12): def forward(self, unpooled): x = self.dense(unpooled) - x = transformers.modeling_bert.gelu(x) + x = transformers.models.bert.modeling_bert.gelu(x) x = self.layer_norm(x) # project back to size of vocabulary with bias @@ -276,7 +280,7 @@ def __init__(self, hidden_size, embedding_size, vocab_size, hidden_act="gelu"): self.bias = nn.Parameter(torch.zeros(vocab_size), requires_grad=True) self.dense = nn.Linear(hidden_size, embedding_size) self.decoder = nn.Linear(embedding_size, vocab_size) - self.activation = transformers.modeling_bert.ACT2FN[hidden_act] + self.activation = transformers.models.bert.modeling_bert.ACT2FN[hidden_act] # Need a link between the two variables so that the bias is correctly resized with # `resize_token_embeddings` diff --git a/jiant/proj/main/modeling/taskmodels.py b/jiant/proj/main/modeling/taskmodels.py index 65df810e8..583570fe4 100644 --- a/jiant/proj/main/modeling/taskmodels.py +++ b/jiant/proj/main/modeling/taskmodels.py @@ -8,10 +8,8 @@ import torch.nn as nn import jiant.proj.main.modeling.heads as heads -import jiant.utils.transformer_utils as transformer_utils - -from jiant.proj.main.components.outputs import LogitsAndLossOutput -from jiant.proj.main.components.outputs import LogitsOutput +from jiant.proj.main.components.outputs import LogitsOutput, LogitsAndLossOutput +from jiant.utils.python.datastructures import take_one from jiant.shared.model_resolution import ModelArchitectures from jiant.tasks.core import TaskTypes from jiant.utils.python.datastructures import take_one @@ -284,9 +282,11 @@ def __init__(self, task, encoder, head: heads.AbstractPoolerHead, **kwargs): super().__init__(task=task, encoder=encoder, head=head) self.layer = kwargs["layer"] - def forward(self, batch, tokenizer, compute_loss: bool = False): - with transformer_utils.output_hidden_states_context(self.encoder): - encoder_output = get_output_from_encoder_and_batch(encoder=self.encoder, batch=batch) + def forward(self, batch, task, tokenizer, compute_loss: bool = False): + encoder_output = get_output_from_encoder_and_batch( + encoder_output=self.encoder, batch=batch, output_hidden_states=True + ) + # A tuple of layers of hidden states hidden_states = take_one(encoder_output.other) layer_hidden_states = hidden_states[self.layer] @@ -319,7 +319,7 @@ class EncoderOutput: # Extend later with attention, hidden_acts, etc -def get_output_from_encoder_and_batch(encoder, batch) -> EncoderOutput: +def get_output_from_encoder_and_batch(encoder, batch, output_hidden_states=False) -> EncoderOutput: """Pass batch to encoder, return encoder model output. Args: @@ -335,10 +335,13 @@ def get_output_from_encoder_and_batch(encoder, batch) -> EncoderOutput: input_ids=batch.input_ids, segment_ids=batch.segment_ids, input_mask=batch.input_mask, + output_hidden_states=output_hidden_states, ) -def get_output_from_encoder(encoder, input_ids, segment_ids, input_mask) -> EncoderOutput: +def get_output_from_encoder( + encoder, input_ids, segment_ids, input_mask, output_hidden_states=False +) -> EncoderOutput: """Pass inputs to encoder, return encoder output. Args: @@ -362,18 +365,29 @@ def get_output_from_encoder(encoder, input_ids, segment_ids, input_mask) -> Enco ModelArchitectures.XLM_ROBERTA, ]: pooled, unpooled, other = get_output_from_standard_transformer_models( - encoder=encoder, input_ids=input_ids, segment_ids=segment_ids, input_mask=input_mask, + encoder=encoder, + input_ids=input_ids, + segment_ids=segment_ids, + input_mask=input_mask, + output_hidden_states=output_hidden_states, ) elif model_arch == ModelArchitectures.ELECTRA: pooled, unpooled, other = get_output_from_electra( - encoder=encoder, input_ids=input_ids, segment_ids=segment_ids, input_mask=input_mask, + encoder=encoder, + input_ids=input_ids, + segment_ids=segment_ids, + input_mask=input_mask, + output_hidden_states=output_hidden_states, ) elif model_arch in [ ModelArchitectures.BART, ModelArchitectures.MBART, ]: pooled, unpooled, other = get_output_from_bart_models( - encoder=encoder, input_ids=input_ids, input_mask=input_mask, + encoder=encoder, + input_ids=input_ids, + input_mask=input_mask, + output_hidden_states=output_hidden_states, ) else: raise KeyError(model_arch) @@ -385,38 +399,54 @@ def get_output_from_encoder(encoder, input_ids, segment_ids, input_mask) -> Enco return EncoderOutput(pooled=pooled, unpooled=unpooled) -def get_output_from_standard_transformer_models(encoder, input_ids, segment_ids, input_mask): - output = encoder(input_ids=input_ids, token_type_ids=segment_ids, attention_mask=input_mask) - pooled, unpooled, other = output[1], output[0], output[2:] - return pooled, unpooled, other +def get_output_from_standard_transformer_models( + encoder, input_ids, segment_ids, input_mask, output_hidden_states=False +): + output = encoder( + input_ids=input_ids, + token_type_ids=segment_ids, + attention_mask=input_mask, + output_hidden_states=output_hidden_states, + ) + return output.pooler_output, output.last_hidden_state, output.hidden_states -def get_output_from_bart_models(encoder, input_ids, input_mask): +def get_output_from_bart_models(encoder, input_ids, input_mask, output_hidden_states=False): # BART and mBART and encoder-decoder architectures. # As described in the BART paper and implemented in Transformers, # for single input tasks, the encoder input is the sequence, # the decode input is 1-shifted sequence, and the resulting # sentence representation is the final decoder state. # That's what we use for `unpooled` here. - dec_last, dec_all, enc_last, enc_all = encoder( - input_ids=input_ids, attention_mask=input_mask, output_hidden_states=True, + output = encoder( + input_ids=input_ids, attention_mask=input_mask, output_hidden_states=output_hidden_states, ) - unpooled = dec_last + dec_all = output.decoder_hidden_states + enc_all = output.encoder_hidden_states - other = (enc_all + dec_all,) + unpooled = output + + hidden_states = (enc_all + dec_all,) bsize, slen = input_ids.shape batch_idx = torch.arange(bsize).to(input_ids.device) # Get last non-pad index pooled = unpooled[batch_idx, slen - input_ids.eq(encoder.config.pad_token_id).sum(1) - 1] - return pooled, unpooled, other + return pooled, unpooled, hidden_states -def get_output_from_electra(encoder, input_ids, segment_ids, input_mask): - output = encoder(input_ids=input_ids, token_type_ids=segment_ids, attention_mask=input_mask) - unpooled = output[0] +def get_output_from_electra( + encoder, input_ids, segment_ids, input_mask, output_hidden_states=False +): + output = encoder( + input_ids=input_ids, + token_type_ids=segment_ids, + attention_mask=input_mask, + output_hidden_states=output_hidden_states, + ) + unpooled = output.hidden_states pooled = unpooled[:, 0, :] - return pooled, unpooled, output + return pooled, unpooled, output.hidden_states def compute_mlm_loss(logits, masked_lm_labels): diff --git a/jiant/proj/main/runscript.py b/jiant/proj/main/runscript.py index 11ee44ad9..ba6053323 100644 --- a/jiant/proj/main/runscript.py +++ b/jiant/proj/main/runscript.py @@ -22,7 +22,6 @@ class RunConfiguration(zconf.RunConfig): # === Model parameters === # hf_pretrained_model_name_or_path = zconf.attr(type=str, required=True) - model_type = zconf.attr(type=str, required=True) model_path = zconf.attr(type=str, required=True) model_config_path = zconf.attr(default=None, type=str) model_load_mode = zconf.attr(default="from_transformers", type=str) diff --git a/jiant/scripts/download_data/constants.py b/jiant/scripts/download_data/constants.py index badd231c4..132a6c489 100644 --- a/jiant/scripts/download_data/constants.py +++ b/jiant/scripts/download_data/constants.py @@ -24,6 +24,20 @@ "piqa", "winogrande", "ropes", + "acceptability_definiteness", + "acceptability_coord", + "acceptability_eos", + "acceptability_whwords", + "senteval_bigram_shift", + "senteval_coordination_inversion", + "senteval_obj_number", + "senteval_odd_man_out", + "senteval_past_present", + "senteval_sentence_length", + "senteval_subj_number", + "senteval_top_constituents", + "senteval_tree_depth", + "senteval_word_content", } DIRECT_DOWNLOAD_TASKS = set( diff --git a/jiant/scripts/download_data/dl_datasets/files_tasks.py b/jiant/scripts/download_data/dl_datasets/files_tasks.py index b943b8fb6..1ff772aba 100644 --- a/jiant/scripts/download_data/dl_datasets/files_tasks.py +++ b/jiant/scripts/download_data/dl_datasets/files_tasks.py @@ -89,6 +89,30 @@ def download_task_data_and_write_config(task_name: str, task_data_path: str, tas download_ropes_data_and_write_config( task_name=task_name, task_data_path=task_data_path, task_config_path=task_config_path ) + elif task_name in [ + "acceptability_definiteness", + "acceptability_coord", + "acceptability_eos", + "acceptability_whwords", + ]: + download_acceptability_judgments_data_and_write_config( + task_name=task_name, task_data_path=task_data_path, task_config_path=task_config_path + ) + elif task_name in [ + "senteval_bigram_shift", + "senteval_coordination_inversion", + "senteval_obj_number", + "senteval_odd_man_out", + "senteval_past_present", + "senteval_sentence_length", + "senteval_subj_number", + "senteval_top_constituents", + "senteval_tree_depth", + "senteval_word_content", + ]: + download_senteval_data_and_write_config( + task_name=task_name, task_data_path=task_data_path, task_config_path=task_config_path + ) else: raise KeyError(task_name) @@ -1012,3 +1036,69 @@ def download_ropes_data_and_write_config( }, path=task_config_path, ) + + +def download_acceptability_judgments_data_and_write_config( + task_name: str, task_data_path: str, task_config_path: str +): + dataset_name = { + "acceptability_definiteness": "definiteness", + "acceptability_coord": "coordinating-conjunctions", + "acceptability_whwords": "whwords", + "acceptability_eos": "eos", + }[task_name] + os.makedirs(task_data_path, exist_ok=True) + # data contains all train/val/test examples + # metadata contains the split indicators + # (there are 10 CV folds, we use fold1 by default, see below) + data_path = os.path.join(task_data_path, "data.json") + metadata_path = os.path.join(task_data_path, "metadata.json") + download_utils.download_file( + url="https://raw.githubusercontent.com/decompositional-semantics-initiative/DNC/master/" + f"function_words/ACCEPTABILITY/acceptability-{dataset_name}_data.json", + file_path=data_path, + ) + download_utils.download_file( + url="https://raw.githubusercontent.com/decompositional-semantics-initiative/DNC/master/" + f"function_words/ACCEPTABILITY/acceptability-{dataset_name}_metadata.json", + file_path=metadata_path, + ) + py_io.write_json( + data={ + "task": task_name, + "paths": {"data": data_path, "metadata": metadata_path}, + "name": task_name, + "kwargs": {"fold": "fold1"}, # use fold1 (out of 10) by default + }, + path=task_config_path, + ) + + +def download_senteval_data_and_write_config( + task_name: str, task_data_path: str, task_config_path: str +): + name_map = { + "senteval_bigram_shift": "bigram_shift", + "senteval_coordination_inversion": "coordination_inversion", + "senteval_obj_number": "obj_number", + "senteval_odd_man_out": "odd_man_out", + "senteval_past_present": "past_present", + "senteval_sentence_length": "sentence_length", + "senteval_subj_number": "subj_number", + "senteval_top_constituents": "top_constituents", + "senteval_tree_depth": "tree_depth", + "senteval_word_content": "word_content", + } + dataset_name = name_map[task_name] + os.makedirs(task_data_path, exist_ok=True) + # data contains all train/val/test examples, first column indicates the split + data_path = os.path.join(task_data_path, "data.tsv") + download_utils.download_file( + url="https://raw.githubusercontent.com/facebookresearch/SentEval/master/data/probing/" + f"{dataset_name}.txt", + file_path=data_path, + ) + py_io.write_json( + data={"task": task_name, "paths": {"data": data_path}, "name": task_name}, + path=task_config_path, + ) diff --git a/jiant/scripts/download_data/runscript.py b/jiant/scripts/download_data/runscript.py index 65d2f90c9..566e3a593 100644 --- a/jiant/scripts/download_data/runscript.py +++ b/jiant/scripts/download_data/runscript.py @@ -47,7 +47,9 @@ def download_data(task_names, output_base_path): task_data_base_path = py_io.create_dir(output_base_path, "data") task_config_base_path = py_io.create_dir(output_base_path, "configs") - assert set(task_names).issubset(SUPPORTED_TASKS) + assert set(task_names).issubset(SUPPORTED_TASKS), "Following tasks are not support: {}".format( + ",".join(set(task_names) - SUPPORTED_TASKS) + ) # Download specified tasks and generate configs for specified tasks for i, task_name in enumerate(task_names): diff --git a/jiant/tasks/evaluate/core.py b/jiant/tasks/evaluate/core.py index 8b3d3638a..fbd535692 100644 --- a/jiant/tasks/evaluate/core.py +++ b/jiant/tasks/evaluate/core.py @@ -957,6 +957,9 @@ def get_evaluation_scheme_for_task(task) -> BaseEvaluationScheme: tasks.AdversarialNliTask, tasks.AbductiveNliTask, tasks.AcceptabilityDefinitenessTask, + tasks.AcceptabilityCoordTask, + tasks.AcceptabilityEOSTask, + tasks.AcceptabilityWHwordsTask, tasks.BoolQTask, tasks.CopaTask, tasks.FeverNliTask, @@ -966,7 +969,16 @@ def get_evaluation_scheme_for_task(task) -> BaseEvaluationScheme: tasks.RaceTask, tasks.RteTask, tasks.SciTailTask, - tasks.SentevalTenseTask, + tasks.SentEvalBigramShiftTask, + tasks.SentEvalCoordinationInversionTask, + tasks.SentEvalObjNumberTask, + tasks.SentEvalOddManOutTask, + tasks.SentEvalPastPresentTask, + tasks.SentEvalSentenceLengthTask, + tasks.SentEvalSubjNumberTask, + tasks.SentEvalTopConstituentsTask, + tasks.SentEvalTreeDepthTask, + tasks.SentEvalWordContentTask, tasks.SnliTask, tasks.SstTask, tasks.WiCTask, diff --git a/jiant/tasks/lib/acceptability_judgement/base.py b/jiant/tasks/lib/acceptability_judgement/base.py new file mode 100644 index 000000000..5f05e83bf --- /dev/null +++ b/jiant/tasks/lib/acceptability_judgement/base.py @@ -0,0 +1,107 @@ +import numpy as np +import torch +from dataclasses import dataclass +from typing import List + +from jiant.tasks.core import ( + BaseExample, + BaseTokenizedExample, + BaseDataRow, + BatchMixin, + Task, + TaskTypes, +) +from jiant.tasks.lib.templates.shared import single_sentence_featurize, labels_to_bimap +from jiant.utils.python.io import read_json + + +@dataclass +class Example(BaseExample): + guid: str + text: str + label: str + + def tokenize(self, tokenizer): + return TokenizedExample( + guid=self.guid, + text=tokenizer.tokenize(self.text), + label_id=BaseAcceptabilityTask.LABEL_TO_ID[self.label], + ) + + +@dataclass +class TokenizedExample(BaseTokenizedExample): + guid: str + text: List + label_id: int + + def featurize(self, tokenizer, feat_spec): + return single_sentence_featurize( + guid=self.guid, + input_tokens=self.text, + label_id=self.label_id, + tokenizer=tokenizer, + feat_spec=feat_spec, + data_row_class=DataRow, + ) + + +@dataclass +class DataRow(BaseDataRow): + guid: str + input_ids: np.ndarray + input_mask: np.ndarray + segment_ids: np.ndarray + label_id: int + tokens: list + + +@dataclass +class Batch(BatchMixin): + input_ids: torch.LongTensor + input_mask: torch.LongTensor + segment_ids: torch.LongTensor + label_id: torch.LongTensor + tokens: list + + +class BaseAcceptabilityTask(Task): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + TASK_TYPE = TaskTypes.CLASSIFICATION + LABELS = ["acceptable", "unacceptable"] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) + DATA_PHASE_MAP = {"train": "train", "dev": "val", "test": "test"} + + def __init__(self, name, path_dict, fold: str): + # Fold should be a string like "fold1" + super().__init__(name=name, path_dict=path_dict) + self.fold = fold + + def get_train_examples(self): + return self._create_examples(set_type="train") + + def get_val_examples(self): + return self._create_examples(set_type="val") + + def get_test_examples(self): + return self._create_examples(set_type="test") + + def _create_examples(self, set_type): + data = read_json(self.path_dict["data"]) + metadata = read_json(self.path_dict["metadata"]) + assert len(data) == len(metadata) + examples = [] + for data_row, metadata_row in zip(data, metadata): + row_phase = self.DATA_PHASE_MAP[metadata_row["misc"][self.fold]] + if row_phase != set_type: + continue + examples.append( + Example( + guid=data_row["pair-id"], text=data_row["context"], label=data_row["label"], + ) + ) + return examples diff --git a/jiant/tasks/lib/acceptability_judgement/coord.py b/jiant/tasks/lib/acceptability_judgement/coord.py new file mode 100644 index 000000000..3f4e29b57 --- /dev/null +++ b/jiant/tasks/lib/acceptability_judgement/coord.py @@ -0,0 +1,26 @@ +from dataclasses import dataclass +import jiant.tasks.lib.acceptability_judgement.base as base + + +@dataclass +class Example(base.Example): + pass + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class AcceptabilityCoordTask(base.BaseAcceptabilityTask): + pass diff --git a/jiant/tasks/lib/acceptability_judgement/definiteness.py b/jiant/tasks/lib/acceptability_judgement/definiteness.py index 0232d817c..499ee2b2c 100644 --- a/jiant/tasks/lib/acceptability_judgement/definiteness.py +++ b/jiant/tasks/lib/acceptability_judgement/definiteness.py @@ -1,99 +1,26 @@ -import numpy as np -import pandas as pd -import torch from dataclasses import dataclass -from typing import List - -from jiant.tasks.core import ( - BaseExample, - BaseTokenizedExample, - BaseDataRow, - BatchMixin, - Task, - TaskTypes, -) -from jiant.tasks.lib.templates.shared import single_sentence_featurize, labels_to_bimap +import jiant.tasks.lib.acceptability_judgement.base as base @dataclass -class Example(BaseExample): - guid: str - text: str - label: str - - def tokenize(self, tokenizer): - return TokenizedExample( - guid=self.guid, - text=tokenizer.tokenize(self.text), - label_id=AcceptabilityDefinitenessTask.LABEL_TO_ID[self.label], - ) +class Example(base.Example): + pass @dataclass -class TokenizedExample(BaseTokenizedExample): - guid: str - text: List - label_id: int - - def featurize(self, tokenizer, feat_spec): - return single_sentence_featurize( - guid=self.guid, - input_tokens=self.text, - label_id=self.label_id, - tokenizer=tokenizer, - feat_spec=feat_spec, - data_row_class=DataRow, - ) +class TokenizedExample(base.TokenizedExample): + pass @dataclass -class DataRow(BaseDataRow): - guid: str - input_ids: np.ndarray - input_mask: np.ndarray - segment_ids: np.ndarray - label_id: int - tokens: list +class DataRow(base.DataRow): + pass @dataclass -class Batch(BatchMixin): - input_ids: torch.LongTensor - input_mask: torch.LongTensor - segment_ids: torch.LongTensor - label_id: torch.LongTensor - tokens: list - - -class AcceptabilityDefinitenessTask(Task): - Example = Example - TokenizedExample = TokenizedExample - DataRow = DataRow - Batch = Batch - - TASK_TYPE = TaskTypes.CLASSIFICATION - LABELS = ["acceptable", "unacceptable"] - LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) - - def get_train_examples(self): - return self._create_examples(path=self.train_path, set_type="train") - - def get_val_examples(self): - return self._create_examples(path=self.val_path, set_type="val") +class Batch(base.Batch): + pass - def get_test_examples(self): - return self._create_examples(path=self.test_path, set_type="test") - @classmethod - def _create_examples(cls, path, set_type): - examples = [] - df = pd.read_csv(path, sep="\t", index_col=0, names=["text", "label"]) - for i, row in df.iterrows(): - examples.append( - Example( - guid="%s-%s" % (set_type, i), - text=row.text, - label=row.label if set_type != "test" else cls.LABELS[-1], - ) - ) - return examples +class AcceptabilityDefinitenessTask(base.BaseAcceptabilityTask): + pass diff --git a/jiant/tasks/lib/acceptability_judgement/eos.py b/jiant/tasks/lib/acceptability_judgement/eos.py new file mode 100644 index 000000000..2fd83daf6 --- /dev/null +++ b/jiant/tasks/lib/acceptability_judgement/eos.py @@ -0,0 +1,26 @@ +from dataclasses import dataclass +import jiant.tasks.lib.acceptability_judgement.base as base + + +@dataclass +class Example(base.Example): + pass + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class AcceptabilityEOSTask(base.BaseAcceptabilityTask): + pass diff --git a/jiant/tasks/lib/acceptability_judgement/whwords.py b/jiant/tasks/lib/acceptability_judgement/whwords.py new file mode 100644 index 000000000..c1be84118 --- /dev/null +++ b/jiant/tasks/lib/acceptability_judgement/whwords.py @@ -0,0 +1,26 @@ +from dataclasses import dataclass +import jiant.tasks.lib.acceptability_judgement.base as base + + +@dataclass +class Example(base.Example): + pass + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class AcceptabilityWHwordsTask(base.BaseAcceptabilityTask): + pass diff --git a/jiant/tasks/lib/ropes.py b/jiant/tasks/lib/ropes.py index 74c823ad7..8c022bf0e 100644 --- a/jiant/tasks/lib/ropes.py +++ b/jiant/tasks/lib/ropes.py @@ -90,7 +90,9 @@ def to_feature_list( # (This may not apply for future added models that don't start with a CLS token, # such as XLNet/GPT-2) sequence_added_tokens = 1 - sequence_pair_added_tokens = tokenizer.max_len - tokenizer.max_len_sentences_pair + sequence_pair_added_tokens = ( + tokenizer.model_max_length - tokenizer.model_max_length_sentences_pair + ) span_doc_tokens = all_doc_tokens while len(spans) * doc_stride < len(all_doc_tokens): diff --git a/jiant/tasks/lib/senteval/tense.py b/jiant/tasks/lib/senteval/base.py similarity index 68% rename from jiant/tasks/lib/senteval/tense.py rename to jiant/tasks/lib/senteval/base.py index 96d77cc79..54c5c4067 100644 --- a/jiant/tasks/lib/senteval/tense.py +++ b/jiant/tasks/lib/senteval/base.py @@ -12,7 +12,7 @@ Task, TaskTypes, ) -from jiant.tasks.lib.templates.shared import single_sentence_featurize, labels_to_bimap +from jiant.tasks.lib.templates.shared import single_sentence_featurize @dataclass @@ -21,11 +21,15 @@ class Example(BaseExample): text: str label: str + @property + def label_to_id(self): + raise NotImplementedError() + def tokenize(self, tokenizer): return TokenizedExample( guid=self.guid, text=tokenizer.tokenize(self.text), - label_id=SentevalTenseTask.LABEL_TO_ID[self.label], + label_id=self.label_to_id[self.label], ) @@ -65,35 +69,36 @@ class Batch(BatchMixin): tokens: list -class SentevalTenseTask(Task): +class BaseSentEvalTask(Task): Example = Example TokenizedExample = TokenizedExample DataRow = DataRow Batch = Batch TASK_TYPE = TaskTypes.CLASSIFICATION - LABELS = ["PAST", "PRES"] - LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) + LABELS = None # Override this def get_train_examples(self): - return self._create_examples(path=self.train_path, set_type="train") + return self._create_examples(set_type="train") def get_val_examples(self): - return self._create_examples(path=self.val_path, set_type="val") + return self._create_examples(set_type="val") def get_test_examples(self): - return self._create_examples(path=self.test_path, set_type="test") + return self._create_examples(set_type="test") - @classmethod - def _create_examples(cls, path, set_type): + def _create_examples(self, set_type): examples = [] - df = pd.read_csv(path, index_col=0, names=["split", "label", "text", "unk_1", "unk_2"]) - for i, row in df.iterrows(): + df = pd.read_csv(self.path_dict["data"], sep="\t", names=["phase", "label", "text"]) + phase_key = {"train": "tr", "val": "va", "test": "te"}[set_type] + sub_df = df[df["phase"] == phase_key] + for i, row in sub_df.iterrows(): + # noinspection PyArgumentList examples.append( - Example( + self.Example( guid="%s-%s" % (set_type, i), text=row.text, - label=row.label if set_type != "test" else cls.LABELS[-1], + label=row.label if set_type != "test" else self.LABELS[-1], ) ) return examples diff --git a/jiant/tasks/lib/senteval/bigram_shift.py b/jiant/tasks/lib/senteval/bigram_shift.py new file mode 100644 index 000000000..b212b54cd --- /dev/null +++ b/jiant/tasks/lib/senteval/bigram_shift.py @@ -0,0 +1,35 @@ +from dataclasses import dataclass +import jiant.tasks.lib.senteval.base as base +from jiant.tasks.lib.templates.shared import labels_to_bimap + + +@dataclass +class Example(base.Example): + @property + def label_to_id(self): + return SentEvalBigramShiftTask.LABEL_TO_ID + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class SentEvalBigramShiftTask(base.BaseSentEvalTask): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + LABELS = ["I", "O"] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) diff --git a/jiant/tasks/lib/senteval/coordination_inversion.py b/jiant/tasks/lib/senteval/coordination_inversion.py new file mode 100644 index 000000000..b4cae4a05 --- /dev/null +++ b/jiant/tasks/lib/senteval/coordination_inversion.py @@ -0,0 +1,35 @@ +from dataclasses import dataclass +import jiant.tasks.lib.senteval.base as base +from jiant.tasks.lib.templates.shared import labels_to_bimap + + +@dataclass +class Example(base.Example): + @property + def label_to_id(self): + return SentEvalCoordinationInversionTask.LABEL_TO_ID + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class SentEvalCoordinationInversionTask(base.BaseSentEvalTask): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + LABELS = ["I", "O"] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) diff --git a/jiant/tasks/lib/senteval/obj_number.py b/jiant/tasks/lib/senteval/obj_number.py new file mode 100644 index 000000000..3d187f7fd --- /dev/null +++ b/jiant/tasks/lib/senteval/obj_number.py @@ -0,0 +1,35 @@ +from dataclasses import dataclass +import jiant.tasks.lib.senteval.base as base +from jiant.tasks.lib.templates.shared import labels_to_bimap + + +@dataclass +class Example(base.Example): + @property + def label_to_id(self): + return SentEvalObjNumberTask.LABEL_TO_ID + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class SentEvalObjNumberTask(base.BaseSentEvalTask): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + LABELS = ["NN", "NNS"] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) diff --git a/jiant/tasks/lib/senteval/odd_man_out.py b/jiant/tasks/lib/senteval/odd_man_out.py new file mode 100644 index 000000000..926f2f2a9 --- /dev/null +++ b/jiant/tasks/lib/senteval/odd_man_out.py @@ -0,0 +1,35 @@ +from dataclasses import dataclass +import jiant.tasks.lib.senteval.base as base +from jiant.tasks.lib.templates.shared import labels_to_bimap + + +@dataclass +class Example(base.Example): + @property + def label_to_id(self): + return SentEvalOddManOutTask.LABEL_TO_ID + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class SentEvalOddManOutTask(base.BaseSentEvalTask): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + LABELS = ["C", "O"] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) diff --git a/jiant/tasks/lib/senteval/past_present.py b/jiant/tasks/lib/senteval/past_present.py new file mode 100644 index 000000000..5b09de51f --- /dev/null +++ b/jiant/tasks/lib/senteval/past_present.py @@ -0,0 +1,35 @@ +from dataclasses import dataclass +import jiant.tasks.lib.senteval.base as base +from jiant.tasks.lib.templates.shared import labels_to_bimap + + +@dataclass +class Example(base.Example): + @property + def label_to_id(self): + return SentEvalPastPresentTask.LABEL_TO_ID + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class SentEvalPastPresentTask(base.BaseSentEvalTask): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + LABELS = ["PAST", "PRES"] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) diff --git a/jiant/tasks/lib/senteval/sentence_length.py b/jiant/tasks/lib/senteval/sentence_length.py new file mode 100644 index 000000000..e8d3759e1 --- /dev/null +++ b/jiant/tasks/lib/senteval/sentence_length.py @@ -0,0 +1,35 @@ +from dataclasses import dataclass +import jiant.tasks.lib.senteval.base as base +from jiant.tasks.lib.templates.shared import labels_to_bimap + + +@dataclass +class Example(base.Example): + @property + def label_to_id(self): + return SentEvalSentenceLengthTask.LABEL_TO_ID + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class SentEvalSentenceLengthTask(base.BaseSentEvalTask): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + LABELS = [0, 1, 2, 3, 4, 5, 6] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) diff --git a/jiant/tasks/lib/senteval/subj_number.py b/jiant/tasks/lib/senteval/subj_number.py new file mode 100644 index 000000000..f96e95866 --- /dev/null +++ b/jiant/tasks/lib/senteval/subj_number.py @@ -0,0 +1,35 @@ +from dataclasses import dataclass +import jiant.tasks.lib.senteval.base as base +from jiant.tasks.lib.templates.shared import labels_to_bimap + + +@dataclass +class Example(base.Example): + @property + def label_to_id(self): + return SentEvalSubjNumberTask.LABEL_TO_ID + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class SentEvalSubjNumberTask(base.BaseSentEvalTask): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + LABELS = ["NN", "NNS"] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) diff --git a/jiant/tasks/lib/senteval/top_constituents.py b/jiant/tasks/lib/senteval/top_constituents.py new file mode 100644 index 000000000..29123fb38 --- /dev/null +++ b/jiant/tasks/lib/senteval/top_constituents.py @@ -0,0 +1,56 @@ +from dataclasses import dataclass +import jiant.tasks.lib.senteval.base as base +from jiant.tasks.lib.templates.shared import labels_to_bimap + + +@dataclass +class Example(base.Example): + @property + def label_to_id(self): + return SentEvalTopConstituentsTask.LABEL_TO_ID + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class SentEvalTopConstituentsTask(base.BaseSentEvalTask): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + LABELS = [ + "ADVP_NP_VP_.", + "CC_ADVP_NP_VP_.", + "CC_NP_VP_.", + "IN_NP_VP_.", + "NP_ADVP_VP_.", + "NP_NP_VP_.", + "NP_PP_.", + "NP_VP_.", + "OTHER", + "PP_NP_VP_.", + "RB_NP_VP_.", + "SBAR_NP_VP_.", + "SBAR_VP_.", + "S_CC_S_.", + "S_NP_VP_.", + "S_VP_.", + "VBD_NP_VP_.", + "VP_.", + "WHADVP_SQ_.", + "WHNP_SQ_.", + ] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) diff --git a/jiant/tasks/lib/senteval/tree_depth.py b/jiant/tasks/lib/senteval/tree_depth.py new file mode 100644 index 000000000..ba00dd183 --- /dev/null +++ b/jiant/tasks/lib/senteval/tree_depth.py @@ -0,0 +1,35 @@ +from dataclasses import dataclass +import jiant.tasks.lib.senteval.base as base +from jiant.tasks.lib.templates.shared import labels_to_bimap + + +@dataclass +class Example(base.Example): + @property + def label_to_id(self): + return SentEvalTreeDepthTask.LABEL_TO_ID + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class SentEvalTreeDepthTask(base.BaseSentEvalTask): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + LABELS = [5, 6, 7, 8, 9, 10, 11] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) diff --git a/jiant/tasks/lib/senteval/word_content.py b/jiant/tasks/lib/senteval/word_content.py new file mode 100644 index 000000000..4ec253588 --- /dev/null +++ b/jiant/tasks/lib/senteval/word_content.py @@ -0,0 +1,1039 @@ +from dataclasses import dataclass +import jiant.tasks.lib.senteval.base as base +from jiant.tasks.lib.templates.shared import labels_to_bimap + + +@dataclass +class Example(base.Example): + @property + def label_to_id(self): + return SentEvalWordContentTask.LABEL_TO_ID + + +@dataclass +class TokenizedExample(base.TokenizedExample): + pass + + +@dataclass +class DataRow(base.DataRow): + pass + + +@dataclass +class Batch(base.Batch): + pass + + +class SentEvalWordContentTask(base.BaseSentEvalTask): + Example = Example + TokenizedExample = TokenizedExample + DataRow = DataRow + Batch = Batch + + # SentEval predicts the presence of words in a sentence with 1k-way classification. + # All examples satisfy: + # word in text.lower() + LABELS = [ + "abandoned", + "abruptly", + "accent", + "access", + "according", + "account", + "ache", + "ached", + "acted", + "acting", + "actions", + "actual", + "address", + "advantage", + "advice", + "afford", + "agent", + "agreement", + "aiden", + "airport", + "alarm", + "albert", + "alert", + "alexander", + "alice", + "alley", + "allowing", + "aloud", + "amanda", + "amber", + "american", + "amused", + "amusement", + "ancient", + "andy", + "annie", + "announced", + "annoyed", + "answering", + "anticipation", + "anxious", + "anybody", + "apologize", + "appearance", + "appears", + "approach", + "approaching", + "arched", + "argue", + "argument", + "aria", + "arrive", + "ashe", + "assume", + "assured", + "attached", + "attacked", + "attempted", + "audience", + "available", + "awful", + "awkward", + "background", + "backpack", + "backward", + "backwards", + "bags", + "balance", + "bank", + "barn", + "bars", + "bastard", + "bath", + "beating", + "begged", + "begins", + "begun", + "behavior", + "bell", + "belly", + "belong", + "belonged", + "bench", + "biggest", + "bike", + "billy", + "bird", + "birds", + "birth", + "birthday", + "bitch", + "bitter", + "blank", + "blast", + "bleeding", + "blind", + "blocked", + "blond", + "blonde", + "bond", + "bone", + "bored", + "bothered", + "bound", + "bowed", + "bowl", + "boxes", + "branches", + "brave", + "bread", + "breast", + "breaths", + "brian", + "brick", + "brilliant", + "broad", + "brows", + "brush", + "brushing", + "buddy", + "build", + "buildings", + "bullet", + "bunch", + "butt", + "cage", + "cain", + "caleb", + "callum", + "calmly", + "cameron", + "capable", + "cards", + "career", + "carol", + "caroline", + "carriage", + "cash", + "cassidy", + "casual", + "catching", + "causing", + "centuries", + "chain", + "chairs", + "challenge", + "chamber", + "chances", + "changes", + "changing", + "charged", + "checking", + "chicken", + "chief", + "chill", + "chloe", + "chocolate", + "choked", + "chosen", + "christian", + "chuckle", + "cigarette", + "circles", + "circumstances", + "claim", + "claimed", + "clary", + "classes", + "claws", + "clay", + "cleaned", + "cleaning", + "clearing", + "clicked", + "cliff", + "climb", + "climbing", + "closely", + "closest", + "cloth", + "clothing", + "cloud", + "clue", + "clung", + "clutched", + "coach", + "cocked", + "code", + "colin", + "collapsed", + "collar", + "colors", + "commander", + "comment", + "complicated", + "concrete", + "condition", + "confidence", + "confident", + "confirmed", + "connected", + "connor", + "convince", + "convinced", + "cook", + "cops", + "copy", + "corners", + "correct", + "cost", + "courage", + "cousin", + "covering", + "covers", + "crack", + "cracked", + "crap", + "crash", + "crashed", + "crawled", + "cream", + "create", + "credit", + "crept", + "crime", + "crossing", + "crowded", + "cruel", + "crystal", + "cupped", + "curiosity", + "current", + "curse", + "cursed", + "cute", + "cutting", + "daemon", + "dagger", + "damned", + "damp", + "danced", + "danny", + "dante", + "darkened", + "darling", + "darted", + "dating", + "dave", + "dawn", + "dealing", + "delicate", + "delicious", + "della", + "demons", + "deny", + "department", + "desert", + "deserved", + "destroy", + "destroyed", + "detail", + "detective", + "devil", + "devon", + "digging", + "dining", + "direct", + "directions", + "disappear", + "disappointed", + "disappointment", + "disbelief", + "discuss", + "disgust", + "display", + "distant", + "distracted", + "dogs", + "dollars", + "double", + "doubted", + "dozen", + "drag", + "dragging", + "drake", + "drank", + "drawer", + "drinks", + "driveway", + "dropping", + "drops", + "drug", + "drugs", + "ducked", + "duke", + "dull", + "duncan", + "duty", + "dylan", + "eager", + "eased", + "east", + "eaten", + "echo", + "echoed", + "eddie", + "edges", + "elbow", + "elena", + "ellie", + "embarrassed", + "embrace", + "emerged", + "emergency", + "emotional", + "ends", + "enemies", + "enormous", + "envelope", + "equipment", + "evan", + "event", + "everybody", + "exact", + "exchange", + "exchanged", + "exclaimed", + "exhausted", + "exist", + "existed", + "existence", + "exit", + "expensive", + "experienced", + "explanation", + "exploded", + "exposed", + "extended", + "extremely", + "eyed", + "fabric", + "fade", + "fairly", + "faith", + "fake", + "falls", + "families", + "fangs", + "farm", + "farther", + "favor", + "feared", + "feed", + "fellow", + "fence", + "fierce", + "fifty", + "file", + "filling", + "fingertips", + "finn", + "fired", + "fixed", + "flame", + "flashlight", + "flicked", + "floating", + "flushed", + "foolish", + "football", + "footsteps", + "forcing", + "formed", + "frame", + "freedom", + "french", + "friday", + "friendly", + "frightened", + "frown", + "frowning", + "froze", + "frozen", + "frustrated", + "fuck", + "fucking", + "furious", + "furniture", + "fury", + "gabe", + "games", + "garage", + "garrett", + "gary", + "gasp", + "gates", + "gather", + "gathering", + "gavin", + "gear", + "gesture", + "gestured", + "ghost", + "girlfriend", + "glances", + "glare", + "glowing", + "goodbye", + "gorgeous", + "government", + "gown", + "grabbing", + "graham", + "grand", + "grandfather", + "grandma", + "grant", + "grasp", + "grave", + "greeted", + "grief", + "grinning", + "groan", + "growl", + "guessed", + "guest", + "guests", + "guns", + "gwen", + "halfway", + "hank", + "hanna", + "happily", + "happiness", + "harry", + "harsh", + "heal", + "heartbeat", + "heaven", + "height", + "hero", + "hesitation", + "hissed", + "hitting", + "holds", + "holiday", + "holly", + "holy", + "honor", + "hopefully", + "horizon", + "houses", + "humor", + "hundreds", + "hunger", + "hunt", + "hunting", + "hurting", + "ideas", + "idiot", + "ignoring", + "images", + "imagination", + "impressed", + "impression", + "inches", + "including", + "incredible", + "incredibly", + "informed", + "injured", + "inner", + "insane", + "intended", + "intensity", + "invisible", + "invited", + "iron", + "isaac", + "issue", + "items", + "jamie", + "jared", + "jealous", + "jeremy", + "jerk", + "jess", + "jesus", + "jimmy", + "joey", + "johnny", + "jonas", + "jordan", + "joseph", + "joshua", + "josie", + "journey", + "judge", + "jumping", + "kane", + "karen", + "katherine", + "katie", + "keeps", + "kevin", + "kicking", + "kidding", + "killer", + "kisses", + "knelt", + "knocking", + "ladies", + "landing", + "language", + "larger", + "lately", + "laura", + "lauren", + "lawyer", + "lean", + "leapt", + "learning", + "lesson", + "letters", + "licked", + "lies", + "lifting", + "lightning", + "likes", + "lined", + "liquid", + "lobby", + "location", + "london", + "lonely", + "louder", + "lover", + "loves", + "loving", + "lucien", + "lucy", + "major", + "mama", + "manner", + "marks", + "martin", + "mask", + "mason", + "mass", + "massive", + "mate", + "material", + "mattered", + "matters", + "meaning", + "meat", + "medical", + "melissa", + "member", + "members", + "mental", + "mere", + "merely", + "midnight", + "military", + "minds", + "miranda", + "mist", + "mixed", + "moaned", + "monday", + "moonlight", + "morgan", + "mortal", + "motioned", + "mountains", + "movements", + "moves", + "movies", + "mumbled", + "muscle", + "mystery", + "nails", + "named", + "nathan", + "nearest", + "necklace", + "needing", + "nerves", + "nervously", + "nicolas", + "nicole", + "nightmare", + "nights", + "nina", + "nodding", + "nods", + "nora", + "noted", + "notes", + "numbers", + "object", + "occurred", + "offering", + "officers", + "oliver", + "opens", + "opinion", + "option", + "orange", + "ordinary", + "original", + "ourselves", + "overhead", + "owner", + "packed", + "pages", + "painful", + "paint", + "painted", + "painting", + "palace", + "palms", + "paris", + "parted", + "particularly", + "partner", + "parts", + "passenger", + "passion", + "patch", + "patience", + "patient", + "patrick", + "patted", + "paying", + "period", + "permission", + "pete", + "photo", + "pile", + "pillow", + "pissed", + "pity", + "placing", + "plain", + "planet", + "plastic", + "pleasant", + "plus", + "pockets", + "points", + "polite", + "popped", + "positive", + "possibility", + "potential", + "pounded", + "powers", + "precious", + "prefer", + "prepare", + "president", + "preston", + "pretend", + "pretending", + "previous", + "price", + "pride", + "princess", + "prison", + "professor", + "program", + "progress", + "project", + "proof", + "proper", + "property", + "protection", + "protest", + "provide", + "provided", + "pulse", + "punch", + "punched", + "pure", + "purple", + "puts", + "quinn", + "quit", + "racing", + "radio", + "rafe", + "raise", + "raising", + "rapidly", + "rare", + "rarely", + "reaches", + "react", + "realizing", + "rear", + "rebecca", + "recall", + "received", + "recently", + "record", + "reflection", + "refuse", + "regular", + "reluctantly", + "remaining", + "remains", + "remembering", + "remind", + "remove", + "replaced", + "request", + "required", + "rescue", + "research", + "resist", + "responsibility", + "responsible", + "result", + "returning", + "reveal", + "revealed", + "revealing", + "ribs", + "riding", + "rifle", + "roar", + "robe", + "robert", + "rode", + "rope", + "rubbing", + "ruin", + "ruined", + "rule", + "runs", + "rushing", + "sadly", + "sadness", + "sake", + "sally", + "satisfaction", + "satisfied", + "saturday", + "savannah", + "saving", + "scanned", + "scar", + "scare", + "scattered", + "scott", + "scrambled", + "screams", + "seated", + "seats", + "secrets", + "section", + "sees", + "self", + "sell", + "sensation", + "sensed", + "senses", + "sentence", + "separate", + "serena", + "series", + "serve", + "served", + "settle", + "sexy", + "shade", + "shakes", + "shame", + "sharply", + "shattered", + "sheet", + "sheets", + "sheriff", + "shield", + "shining", + "shiver", + "shivered", + "shooting", + "shopping", + "shore", + "shortly", + "shorts", + "shout", + "shouting", + "shown", + "shrug", + "shuddered", + "sidewalk", + "sideways", + "signal", + "signs", + "silk", + "silly", + "similar", + "sisters", + "site", + "sits", + "skills", + "skirt", + "skull", + "slapped", + "sleeve", + "slide", + "slipping", + "slowed", + "slumped", + "smaller", + "smith", + "snap", + "social", + "society", + "sofa", + "somewhat", + "sooner", + "sophia", + "sophie", + "souls", + "sounding", + "source", + "spare", + "speech", + "spencer", + "spending", + "spinning", + "split", + "spring", + "squeeze", + "stands", + "stated", + "statement", + "states", + "steal", + "stepping", + "stiff", + "stirred", + "stole", + "stones", + "stops", + "straightened", + "stream", + "stretch", + "strike", + "strode", + "stroked", + "struggle", + "struggling", + "student", + "students", + "studying", + "stuffed", + "style", + "success", + "suggest", + "sunday", + "sunlight", + "supplies", + "surprisingly", + "surrounding", + "survived", + "suspect", + "suspected", + "suspicious", + "swallow", + "sweetheart", + "swiftly", + "swing", + "switch", + "t-shirt", + "tables", + "tail", + "tapped", + "tara", + "target", + "task", + "tasted", + "taught", + "taylor", + "teach", + "teacher", + "teased", + "teasing", + "television", + "tells", + "temper", + "temple", + "tense", + "tent", + "terms", + "terrified", + "terror", + "tessa", + "text", + "thigh", + "thighs", + "thousands", + "threatened", + "threatening", + "throughout", + "thrown", + "thrust", + "tighter", + "till", + "tipped", + "toby", + "toes", + "tony", + "tore", + "torn", + "total", + "tough", + "towel", + "tower", + "trace", + "tracks", + "traffic", + "trailed", + "trained", + "trap", + "trapped", + "traveled", + "travis", + "tray", + "treat", + "treated", + "trembled", + "trevor", + "trick", + "tristan", + "trunk", + "trusted", + "twelve", + "ugly", + "unconscious", + "unexpected", + "uniform", + "universe", + "unknown", + "unlike", + "unsure", + "unusual", + "upper", + "upright", + "upward", + "useful", + "useless", + "valley", + "vanished", + "various", + "vehicle", + "veins", + "victor", + "video", + "vincent", + "violet", + "visible", + "vulnerable", + "walks", + "wandered", + "warrior", + "wash", + "washed", + "waving", + "weather", + "werewolf", + "whipped", + "whispers", + "whom", + "willow", + "winced", + "wings", + "winked", + "wise", + "wishing", + "witch", + "wolves", + "worn", + "wounded", + "wounds", + "wrap", + "wrapping", + "wrists", + "wrote", + "xavier", + "yanked", + "yard", + "yards", + "yelling", + "zach", + ] + LABEL_TO_ID, ID_TO_LABEL = labels_to_bimap(LABELS) diff --git a/jiant/tasks/lib/templates/squad_style/core.py b/jiant/tasks/lib/templates/squad_style/core.py index b19e216f1..b57167e2b 100644 --- a/jiant/tasks/lib/templates/squad_style/core.py +++ b/jiant/tasks/lib/templates/squad_style/core.py @@ -5,7 +5,7 @@ from dataclasses import dataclass from typing import Union, List, Dict, Optional -from transformers.tokenization_bert import whitespace_tokenize +from transformers.models.bert.tokenization_bert import whitespace_tokenize from jiant.tasks.lib.templates.squad_style import utils as squad_utils from jiant.shared.constants import PHASE @@ -144,11 +144,13 @@ def to_feature_list( # in the way they compute mask of added tokens. tokenizer_type = type(tokenizer).__name__.replace("Tokenizer", "").lower() sequence_added_tokens = ( - tokenizer.max_len - tokenizer.max_len_single_sentence + 1 + tokenizer.model_max_length - tokenizer.model_max_length_single_sentence + 1 if tokenizer_type in MULTI_SEP_TOKENS_TOKENIZERS_SET - else tokenizer.max_len - tokenizer.max_len_single_sentence + else tokenizer.model_max_length - tokenizer.model_max_length_single_sentence + ) + sequence_pair_added_tokens = ( + tokenizer.model_max_length - tokenizer.model_max_length_sentences_pair ) - sequence_pair_added_tokens = tokenizer.max_len - tokenizer.max_len_sentences_pair span_doc_tokens = all_doc_tokens while len(spans) * doc_stride < len(all_doc_tokens): diff --git a/jiant/tasks/lib/templates/squad_style/utils.py b/jiant/tasks/lib/templates/squad_style/utils.py index bc84fc9eb..9cd35daa0 100644 --- a/jiant/tasks/lib/templates/squad_style/utils.py +++ b/jiant/tasks/lib/templates/squad_style/utils.py @@ -6,7 +6,7 @@ from dataclasses import dataclass from typing import List, Dict -from transformers.tokenization_bert import BasicTokenizer +from transformers.models.bert.tokenization_bert import BasicTokenizer from jiant.utils.display import maybe_tqdm diff --git a/jiant/tasks/retrieval.py b/jiant/tasks/retrieval.py index a4b378587..79719320d 100644 --- a/jiant/tasks/retrieval.py +++ b/jiant/tasks/retrieval.py @@ -3,6 +3,9 @@ from jiant.tasks.lib.abductive_nli import AbductiveNliTask from jiant.tasks.lib.acceptability_judgement.definiteness import AcceptabilityDefinitenessTask +from jiant.tasks.lib.acceptability_judgement.coord import AcceptabilityCoordTask +from jiant.tasks.lib.acceptability_judgement.eos import AcceptabilityEOSTask +from jiant.tasks.lib.acceptability_judgement.whwords import AcceptabilityWHwordsTask from jiant.tasks.lib.adversarial_nli import AdversarialNliTask from jiant.tasks.lib.arc_easy import ArcEasyTask from jiant.tasks.lib.arc_challenge import ArcChallengeTask @@ -50,7 +53,6 @@ from jiant.tasks.lib.rte import RteTask from jiant.tasks.lib.ropes import RopesTask from jiant.tasks.lib.scitail import SciTailTask -from jiant.tasks.lib.senteval.tense import SentevalTenseTask from jiant.tasks.lib.edge_probing.semeval import SemevalTask from jiant.tasks.lib.snli import SnliTask from jiant.tasks.lib.socialiqa import SocialIQATask @@ -58,6 +60,16 @@ from jiant.tasks.lib.edge_probing.spr2 import Spr2Task from jiant.tasks.lib.squad import SquadTask from jiant.tasks.lib.edge_probing.srl import SrlTask +from jiant.tasks.lib.senteval.bigram_shift import SentEvalBigramShiftTask +from jiant.tasks.lib.senteval.coordination_inversion import SentEvalCoordinationInversionTask +from jiant.tasks.lib.senteval.obj_number import SentEvalObjNumberTask +from jiant.tasks.lib.senteval.odd_man_out import SentEvalOddManOutTask +from jiant.tasks.lib.senteval.past_present import SentEvalPastPresentTask +from jiant.tasks.lib.senteval.sentence_length import SentEvalSentenceLengthTask +from jiant.tasks.lib.senteval.subj_number import SentEvalSubjNumberTask +from jiant.tasks.lib.senteval.top_constituents import SentEvalTopConstituentsTask +from jiant.tasks.lib.senteval.tree_depth import SentEvalTreeDepthTask +from jiant.tasks.lib.senteval.word_content import SentEvalWordContentTask from jiant.tasks.lib.sst import SstTask from jiant.tasks.lib.stsb import StsbTask from jiant.tasks.lib.superglue_axg import SuperglueWinogenderDiagnosticsTask @@ -86,6 +98,9 @@ "arc_challenge": ArcChallengeTask, "superglue_axg": SuperglueWinogenderDiagnosticsTask, "acceptability_definiteness": AcceptabilityDefinitenessTask, + "acceptability_coord": AcceptabilityCoordTask, + "acceptability_eos": AcceptabilityEOSTask, + "acceptability_whwords": AcceptabilityWHwordsTask, "adversarial_nli": AdversarialNliTask, "boolq": BoolQTask, "bucc2018": Bucc2018Task, @@ -131,8 +146,17 @@ "ropes": RopesTask, "rte": RteTask, "scitail": SciTailTask, - "senteval_tense": SentevalTenseTask, "semeval": SemevalTask, + "senteval_bigram_shift": SentEvalBigramShiftTask, + "senteval_coordination_inversion": SentEvalCoordinationInversionTask, + "senteval_obj_number": SentEvalObjNumberTask, + "senteval_odd_man_out": SentEvalOddManOutTask, + "senteval_past_present": SentEvalPastPresentTask, + "senteval_sentence_length": SentEvalSentenceLengthTask, + "senteval_subj_number": SentEvalSubjNumberTask, + "senteval_top_constituents": SentEvalTopConstituentsTask, + "senteval_tree_depth": SentEvalTreeDepthTask, + "senteval_word_content": SentEvalWordContentTask, "snli": SnliTask, "socialiqa": SocialIQATask, "spr1": Spr1Task, diff --git a/jiant/utils/transformer_utils.py b/jiant/utils/transformer_utils.py deleted file mode 100644 index 844b6c368..000000000 --- a/jiant/utils/transformer_utils.py +++ /dev/null @@ -1,32 +0,0 @@ -import contextlib - -from jiant.shared.model_resolution import ModelArchitectures - - -@contextlib.contextmanager -def output_hidden_states_context(encoder): - model_arch = ModelArchitectures.from_encoder(encoder) - if model_arch in ( - ModelArchitectures.BERT, - ModelArchitectures.ROBERTA, - ModelArchitectures.ALBERT, - ModelArchitectures.XLM_ROBERTA, - ModelArchitectures.ELECTRA, - ): - if hasattr(encoder.encoder, "output_hidden_states"): - # Transformers < v2 - modified_obj = encoder.encoder - elif hasattr(encoder.encoder.config, "output_hidden_states"): - # Transformers >= v3 - modified_obj = encoder.encoder.config - else: - raise RuntimeError(f"Failed to convert model {type(encoder)} to output hidden states") - old_value = modified_obj.output_hidden_states - modified_obj.output_hidden_states = True - yield - modified_obj.output_hidden_states = old_value - elif model_arch in (ModelArchitectures.BART, ModelArchitectures.MBART): - yield - return - else: - raise KeyError(model_arch) diff --git a/requirements-no-torch.txt b/requirements-no-torch.txt index 43b9b2bd2..c9257de9f 100644 --- a/requirements-no-torch.txt +++ b/requirements-no-torch.txt @@ -13,6 +13,6 @@ seqeval==0.0.12 scikit-learn==0.22.2.post1 scipy==1.4.1 sentencepiece==0.1.86 -tokenizers==0.8.1.rc2 +tokenizers==0.9.4 tqdm==4.46.0 -transformers==3.1.0 +transformers==4.3.3 diff --git a/setup.py b/setup.py index ed46c0070..31f16f366 100644 --- a/setup.py +++ b/setup.py @@ -72,10 +72,10 @@ "scikit-learn == 0.22.2.post1", "scipy == 1.4.1", "sentencepiece == 0.1.86", - "tokenizers == 0.8.1.rc2", + "tokenizers == 0.9.4", "torch >= 1.5.0", "tqdm == 4.46.0", - "transformers == 3.1.0", + "transformers == 4.3.3", "torchvision == 0.6.0", ], extras_require=extras, diff --git a/tests/proj/simple/test_runscript.py b/tests/proj/simple/test_runscript.py index a17da99f2..a79a975b3 100644 --- a/tests/proj/simple/test_runscript.py +++ b/tests/proj/simple/test_runscript.py @@ -8,6 +8,7 @@ import jiant.utils.torch_utils as torch_utils +@pytest.mark.gpu @pytest.mark.parametrize("task_name", ["copa"]) @pytest.mark.parametrize("model_type", ["bert-base-cased"]) def test_simple_runscript(tmpdir, task_name, model_type):