2547 lines
104 KiB
Plaintext
2547 lines
104 KiB
Plaintext
{
|
||
"nbformat": 4,
|
||
"nbformat_minor": 0,
|
||
"metadata": {
|
||
"colab": {
|
||
"provenance": []
|
||
},
|
||
"kernelspec": {
|
||
"name": "python3",
|
||
"display_name": "Python 3"
|
||
},
|
||
"language_info": {
|
||
"name": "python"
|
||
},
|
||
"widgets": {
|
||
"application/vnd.jupyter.widget-state+json": {
|
||
"version_major": 2,
|
||
"version_minor": 0,
|
||
"state": {
|
||
"17b9474f79034385a89897499533063b": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "HBoxModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "HBoxModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "HBoxView",
|
||
"box_style": "",
|
||
"children": [
|
||
"IPY_MODEL_d9ab537b954d4fcdae8a7cb95ab5f26b",
|
||
"IPY_MODEL_5907888b3a8e46648f3ab2c0e7780d70",
|
||
"IPY_MODEL_3faed7bcfa104073bd843ad5081cef39"
|
||
],
|
||
"layout": "IPY_MODEL_20c14d2e8aa649789f914b3dbbc2032b"
|
||
}
|
||
},
|
||
"d9ab537b954d4fcdae8a7cb95ab5f26b": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "HTMLModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "HTMLModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "HTMLView",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"layout": "IPY_MODEL_a311c909c8284916bd17b1d79812d022",
|
||
"placeholder": "",
|
||
"style": "IPY_MODEL_74129ea9231247719ad8bf23ec6faaf7",
|
||
"value": "Downloading https://raw.githubusercontent.com/stanfordnlp/stanza-resources/main/resources_1.15.0.json: "
|
||
}
|
||
},
|
||
"5907888b3a8e46648f3ab2c0e7780d70": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "FloatProgressModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "FloatProgressModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "ProgressView",
|
||
"bar_style": "success",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"layout": "IPY_MODEL_8e2adb7cc4474ead808af9c3ef565463",
|
||
"max": 66336,
|
||
"min": 0,
|
||
"orientation": "horizontal",
|
||
"style": "IPY_MODEL_3d4946f06c1448d18a1e6cc22c3ead46",
|
||
"value": 66336
|
||
}
|
||
},
|
||
"3faed7bcfa104073bd843ad5081cef39": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "HTMLModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "HTMLModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "HTMLView",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"layout": "IPY_MODEL_e61f7870540a412eabda614be460ec23",
|
||
"placeholder": "",
|
||
"style": "IPY_MODEL_0d4d88a50a054275968d609ee1186a3a",
|
||
"value": " 535k/? [00:00<00:00, 17.7MB/s]"
|
||
}
|
||
},
|
||
"20c14d2e8aa649789f914b3dbbc2032b": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"a311c909c8284916bd17b1d79812d022": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"74129ea9231247719ad8bf23ec6faaf7": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "DescriptionStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "DescriptionStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"description_width": ""
|
||
}
|
||
},
|
||
"8e2adb7cc4474ead808af9c3ef565463": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"3d4946f06c1448d18a1e6cc22c3ead46": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "ProgressStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "ProgressStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"bar_color": null,
|
||
"description_width": ""
|
||
}
|
||
},
|
||
"e61f7870540a412eabda614be460ec23": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"0d4d88a50a054275968d609ee1186a3a": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "DescriptionStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "DescriptionStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"description_width": ""
|
||
}
|
||
},
|
||
"a6d358077a174721969e2b2d6e91e58f": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "HBoxModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "HBoxModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "HBoxView",
|
||
"box_style": "",
|
||
"children": [
|
||
"IPY_MODEL_c49dccf55ca64b1da4008a6356ca0402",
|
||
"IPY_MODEL_77c3abf5a21940598d6ff90445d77987",
|
||
"IPY_MODEL_54ecef9065a94182b45e917106d52a8f"
|
||
],
|
||
"layout": "IPY_MODEL_0f06e8e04a164d8eb4de201505fc883c"
|
||
}
|
||
},
|
||
"c49dccf55ca64b1da4008a6356ca0402": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "HTMLModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "HTMLModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "HTMLView",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"layout": "IPY_MODEL_263841fa3b8f4e41a91e8f74b586dc66",
|
||
"placeholder": "",
|
||
"style": "IPY_MODEL_d3fdd1e0694b4d5884b2b9ccff6ca274",
|
||
"value": "models/default.zip: reconstructing file: 100%"
|
||
}
|
||
},
|
||
"77c3abf5a21940598d6ff90445d77987": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "FloatProgressModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "FloatProgressModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "ProgressView",
|
||
"bar_style": "success",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"layout": "IPY_MODEL_93b470ba983b49759f7dccdfead17e66",
|
||
"max": 394024071,
|
||
"min": 0,
|
||
"orientation": "horizontal",
|
||
"style": "IPY_MODEL_0f697eec321e4ddf9430d43c03638a3e",
|
||
"value": 394024071
|
||
}
|
||
},
|
||
"54ecef9065a94182b45e917106d52a8f": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "HTMLModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "HTMLModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "HTMLView",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"layout": "IPY_MODEL_e3cdd2c0f4734a94880296f7187fbdbf",
|
||
"placeholder": "",
|
||
"style": "IPY_MODEL_979f07c3c9b144b789abdc1c17a1df67",
|
||
"value": " 394MB / 394MB, 32.4MB/s "
|
||
}
|
||
},
|
||
"0f06e8e04a164d8eb4de201505fc883c": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"263841fa3b8f4e41a91e8f74b586dc66": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"d3fdd1e0694b4d5884b2b9ccff6ca274": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "DescriptionStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "DescriptionStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"description_width": ""
|
||
}
|
||
},
|
||
"93b470ba983b49759f7dccdfead17e66": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"0f697eec321e4ddf9430d43c03638a3e": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "ProgressStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "ProgressStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"bar_color": null,
|
||
"description_width": ""
|
||
}
|
||
},
|
||
"e3cdd2c0f4734a94880296f7187fbdbf": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"979f07c3c9b144b789abdc1c17a1df67": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "DescriptionStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "DescriptionStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"description_width": ""
|
||
}
|
||
},
|
||
"8986c74367554ac49cdb0471bc4186e2": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "HBoxModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "HBoxModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "HBoxView",
|
||
"box_style": "",
|
||
"children": [
|
||
"IPY_MODEL_55ae9e63388a40cea8f77214441b08c1",
|
||
"IPY_MODEL_bc8d1ec50d0a4f739e865b5b2c141f50",
|
||
"IPY_MODEL_b20ef2d996144b7bb7f4f95047995342"
|
||
],
|
||
"layout": "IPY_MODEL_fe863e9e46e9492cbff2670d2ddec132"
|
||
}
|
||
},
|
||
"55ae9e63388a40cea8f77214441b08c1": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "HTMLModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "HTMLModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "HTMLView",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"layout": "IPY_MODEL_069b90ed1e9f41a088dfef18e3ba52c2",
|
||
"placeholder": "",
|
||
"style": "IPY_MODEL_0aaaaead074a4a91b501dd04e8c482f8",
|
||
"value": "models/default.zip: downloading bytes: "
|
||
}
|
||
},
|
||
"bc8d1ec50d0a4f739e865b5b2c141f50": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "FloatProgressModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "FloatProgressModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "ProgressView",
|
||
"bar_style": "success",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"layout": "IPY_MODEL_bb37f7277845455b8a74a8988884485a",
|
||
"max": 394024071,
|
||
"min": 0,
|
||
"orientation": "horizontal",
|
||
"style": "IPY_MODEL_d4e0b05a386c41968d577436b8d902f8",
|
||
"value": 393470381
|
||
}
|
||
},
|
||
"b20ef2d996144b7bb7f4f95047995342": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "HTMLModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_dom_classes": [],
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "HTMLModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/controls",
|
||
"_view_module_version": "1.5.0",
|
||
"_view_name": "HTMLView",
|
||
"description": "",
|
||
"description_tooltip": null,
|
||
"layout": "IPY_MODEL_a1f4d99c24b84043ae0296612d4c7854",
|
||
"placeholder": "",
|
||
"style": "IPY_MODEL_981fc047830e482e8aeb9da25253b48f",
|
||
"value": " 393MB, 31.8MB/s "
|
||
}
|
||
},
|
||
"fe863e9e46e9492cbff2670d2ddec132": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"069b90ed1e9f41a088dfef18e3ba52c2": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"0aaaaead074a4a91b501dd04e8c482f8": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "DescriptionStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "DescriptionStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"description_width": ""
|
||
}
|
||
},
|
||
"bb37f7277845455b8a74a8988884485a": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"d4e0b05a386c41968d577436b8d902f8": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "ProgressStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "ProgressStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"bar_color": null,
|
||
"description_width": ""
|
||
}
|
||
},
|
||
"a1f4d99c24b84043ae0296612d4c7854": {
|
||
"model_module": "@jupyter-widgets/base",
|
||
"model_name": "LayoutModel",
|
||
"model_module_version": "1.2.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/base",
|
||
"_model_module_version": "1.2.0",
|
||
"_model_name": "LayoutModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "LayoutView",
|
||
"align_content": null,
|
||
"align_items": null,
|
||
"align_self": null,
|
||
"border": null,
|
||
"bottom": null,
|
||
"display": null,
|
||
"flex": null,
|
||
"flex_flow": null,
|
||
"grid_area": null,
|
||
"grid_auto_columns": null,
|
||
"grid_auto_flow": null,
|
||
"grid_auto_rows": null,
|
||
"grid_column": null,
|
||
"grid_gap": null,
|
||
"grid_row": null,
|
||
"grid_template_areas": null,
|
||
"grid_template_columns": null,
|
||
"grid_template_rows": null,
|
||
"height": null,
|
||
"justify_content": null,
|
||
"justify_items": null,
|
||
"left": null,
|
||
"margin": null,
|
||
"max_height": null,
|
||
"max_width": null,
|
||
"min_height": null,
|
||
"min_width": null,
|
||
"object_fit": null,
|
||
"object_position": null,
|
||
"order": null,
|
||
"overflow": null,
|
||
"overflow_x": null,
|
||
"overflow_y": null,
|
||
"padding": null,
|
||
"right": null,
|
||
"top": null,
|
||
"visibility": null,
|
||
"width": null
|
||
}
|
||
},
|
||
"981fc047830e482e8aeb9da25253b48f": {
|
||
"model_module": "@jupyter-widgets/controls",
|
||
"model_name": "DescriptionStyleModel",
|
||
"model_module_version": "1.5.0",
|
||
"state": {
|
||
"_model_module": "@jupyter-widgets/controls",
|
||
"_model_module_version": "1.5.0",
|
||
"_model_name": "DescriptionStyleModel",
|
||
"_view_count": null,
|
||
"_view_module": "@jupyter-widgets/base",
|
||
"_view_module_version": "1.2.0",
|
||
"_view_name": "StyleView",
|
||
"description_width": ""
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"cells": [
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 1,
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "hQAtXLliOJef",
|
||
"outputId": "134b5797-c249-4f51-b3c0-6a313edebff3"
|
||
},
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stdout",
|
||
"text": [
|
||
"\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/2.0 MB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[91m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[91m╸\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m74.6 MB/s\u001b[0m eta \u001b[36m0:00:01\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m34.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
||
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m794.2/794.2 kB\u001b[0m \u001b[31m19.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
||
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m610.9/610.9 kB\u001b[0m \u001b[31m14.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
||
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m418.7/418.7 kB\u001b[0m \u001b[31m19.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
||
"\u001b[?25h"
|
||
]
|
||
}
|
||
],
|
||
"source": [
|
||
"\n",
|
||
"!pip -q install stanza pandas\n"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"\n",
|
||
"import stanza\n",
|
||
"\n",
|
||
"# Mengunduh model Bahasa Indonesia\n",
|
||
"stanza.download(\"id\")\n",
|
||
"\n",
|
||
"# Membuat pipeline POS Tagging\n",
|
||
"nlp = stanza.Pipeline(\n",
|
||
" lang=\"id\",\n",
|
||
" processors=\"tokenize,pos\",\n",
|
||
" verbose=False\n",
|
||
")\n",
|
||
"\n",
|
||
"print(\"Model POS Tagging Bahasa Indonesia berhasil disiapkan!\")\n"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 254,
|
||
"referenced_widgets": [
|
||
"17b9474f79034385a89897499533063b",
|
||
"d9ab537b954d4fcdae8a7cb95ab5f26b",
|
||
"5907888b3a8e46648f3ab2c0e7780d70",
|
||
"3faed7bcfa104073bd843ad5081cef39",
|
||
"20c14d2e8aa649789f914b3dbbc2032b",
|
||
"a311c909c8284916bd17b1d79812d022",
|
||
"74129ea9231247719ad8bf23ec6faaf7",
|
||
"8e2adb7cc4474ead808af9c3ef565463",
|
||
"3d4946f06c1448d18a1e6cc22c3ead46",
|
||
"e61f7870540a412eabda614be460ec23",
|
||
"0d4d88a50a054275968d609ee1186a3a",
|
||
"a6d358077a174721969e2b2d6e91e58f",
|
||
"c49dccf55ca64b1da4008a6356ca0402",
|
||
"77c3abf5a21940598d6ff90445d77987",
|
||
"54ecef9065a94182b45e917106d52a8f",
|
||
"0f06e8e04a164d8eb4de201505fc883c",
|
||
"263841fa3b8f4e41a91e8f74b586dc66",
|
||
"d3fdd1e0694b4d5884b2b9ccff6ca274",
|
||
"93b470ba983b49759f7dccdfead17e66",
|
||
"0f697eec321e4ddf9430d43c03638a3e",
|
||
"e3cdd2c0f4734a94880296f7187fbdbf",
|
||
"979f07c3c9b144b789abdc1c17a1df67",
|
||
"8986c74367554ac49cdb0471bc4186e2",
|
||
"55ae9e63388a40cea8f77214441b08c1",
|
||
"bc8d1ec50d0a4f739e865b5b2c141f50",
|
||
"b20ef2d996144b7bb7f4f95047995342",
|
||
"fe863e9e46e9492cbff2670d2ddec132",
|
||
"069b90ed1e9f41a088dfef18e3ba52c2",
|
||
"0aaaaead074a4a91b501dd04e8c482f8",
|
||
"bb37f7277845455b8a74a8988884485a",
|
||
"d4e0b05a386c41968d577436b8d902f8",
|
||
"a1f4d99c24b84043ae0296612d4c7854",
|
||
"981fc047830e482e8aeb9da25253b48f"
|
||
]
|
||
},
|
||
"id": "p7R2HTvMOVYJ",
|
||
"outputId": "35991078-b89a-42aa-8938-65d719228519"
|
||
},
|
||
"execution_count": 2,
|
||
"outputs": [
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
"Downloading https://raw.githubusercontent.com/stanfordnlp/stanza-resources/main/resources_1.15.0.json: 0%| …"
|
||
],
|
||
"application/vnd.jupyter.widget-view+json": {
|
||
"version_major": 2,
|
||
"version_minor": 0,
|
||
"model_id": "17b9474f79034385a89897499533063b"
|
||
}
|
||
},
|
||
"metadata": {}
|
||
},
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stderr",
|
||
"text": [
|
||
"INFO:stanza:Downloaded file to /root/.cache/stanza/1.15.0/resources/resources.json\n",
|
||
"INFO:stanza:Downloading default packages for language: id (Indonesian) ...\n",
|
||
"Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.\n",
|
||
"WARNING:huggingface_hub.utils._http:Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.\n"
|
||
]
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
"models/default.zip: reconstructing file: 0%| | 0.00B / 394MB "
|
||
],
|
||
"application/vnd.jupyter.widget-view+json": {
|
||
"version_major": 2,
|
||
"version_minor": 0,
|
||
"model_id": "a6d358077a174721969e2b2d6e91e58f"
|
||
}
|
||
},
|
||
"metadata": {}
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
"models/default.zip: downloading bytes: | 0.00B "
|
||
],
|
||
"application/vnd.jupyter.widget-view+json": {
|
||
"version_major": 2,
|
||
"version_minor": 0,
|
||
"model_id": "8986c74367554ac49cdb0471bc4186e2"
|
||
}
|
||
},
|
||
"metadata": {}
|
||
},
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stderr",
|
||
"text": [
|
||
"INFO:stanza:Downloaded file to /root/.cache/stanza/1.15.0/resources/id/default.zip\n",
|
||
"INFO:stanza:Finished downloading models and saved to /root/.cache/stanza/1.15.0/resources\n"
|
||
]
|
||
},
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stdout",
|
||
"text": [
|
||
"Model POS Tagging Bahasa Indonesia berhasil disiapkan!\n"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"\n",
|
||
"import pandas as pd\n",
|
||
"\n",
|
||
"def pos_tagging(kalimat):\n",
|
||
" \"\"\"\n",
|
||
" Memberikan label kelas kata pada kalimat Bahasa Indonesia.\n",
|
||
" \"\"\"\n",
|
||
" doc = nlp(kalimat)\n",
|
||
" hasil = []\n",
|
||
"\n",
|
||
" for sentence in doc.sentences:\n",
|
||
" for word in sentence.words:\n",
|
||
" hasil.append({\n",
|
||
" \"Kata\": word.text,\n",
|
||
" \"POS Tag\": word.upos,\n",
|
||
" \"Penjelasan\": word.upos\n",
|
||
" })\n",
|
||
"\n",
|
||
" return pd.DataFrame(\n",
|
||
" hasil,\n",
|
||
" columns=[\"Kata\", \"POS Tag\", \"Penjelasan\"]\n",
|
||
" )\n",
|
||
"\n",
|
||
"print(\"Fungsi POS Tagging berhasil dibuat.\")\n"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "AYgpSkjnOhzj",
|
||
"outputId": "5ef399f2-307f-4de0-801c-d76f456869f5"
|
||
},
|
||
"execution_count": 3,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stdout",
|
||
"text": [
|
||
"Fungsi POS Tagging berhasil dibuat.\n"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"\n",
|
||
"kalimat = \"Mahasiswa Universitas Bhayangkara belajar Python di laboratorium.\"\n",
|
||
"\n",
|
||
"hasil = pos_tagging(kalimat)\n",
|
||
"\n",
|
||
"print(\"Kalimat:\", kalimat)\n",
|
||
"display(hasil)\n"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 317
|
||
},
|
||
"id": "Otgve225OkYs",
|
||
"outputId": "f88c62ff-dd4f-4577-a76b-e1168b605570"
|
||
},
|
||
"execution_count": 4,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stdout",
|
||
"text": [
|
||
"Kalimat: Mahasiswa Universitas Bhayangkara belajar Python di laboratorium.\n"
|
||
]
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
" Kata POS Tag Penjelasan\n",
|
||
"0 Mahasiswa PROPN PROPN\n",
|
||
"1 Universitas PROPN PROPN\n",
|
||
"2 Bhayangkara PROPN PROPN\n",
|
||
"3 belajar VERB VERB\n",
|
||
"4 Python PROPN PROPN\n",
|
||
"5 di ADP ADP\n",
|
||
"6 laboratorium NOUN NOUN\n",
|
||
"7 . PUNCT PUNCT"
|
||
],
|
||
"text/html": [
|
||
"\n",
|
||
" <div id=\"df-b8e12090-9d6e-445f-81e8-6e5ddcfefbf1\" class=\"colab-df-container\">\n",
|
||
" <div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>Kata</th>\n",
|
||
" <th>POS Tag</th>\n",
|
||
" <th>Penjelasan</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>Mahasiswa</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>Universitas</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>Bhayangkara</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>belajar</td>\n",
|
||
" <td>VERB</td>\n",
|
||
" <td>VERB</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>Python</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>5</th>\n",
|
||
" <td>di</td>\n",
|
||
" <td>ADP</td>\n",
|
||
" <td>ADP</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>6</th>\n",
|
||
" <td>laboratorium</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>7</th>\n",
|
||
" <td>.</td>\n",
|
||
" <td>PUNCT</td>\n",
|
||
" <td>PUNCT</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>\n",
|
||
" <div class=\"colab-df-buttons\">\n",
|
||
"\n",
|
||
" <div class=\"colab-df-container\">\n",
|
||
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-b8e12090-9d6e-445f-81e8-6e5ddcfefbf1')\"\n",
|
||
" title=\"Convert this dataframe to an interactive table.\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
|
||
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
|
||
" </svg>\n",
|
||
" </button>\n",
|
||
"\n",
|
||
" <style>\n",
|
||
" .colab-df-container {\n",
|
||
" display:flex;\n",
|
||
" gap: 12px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert {\n",
|
||
" background-color: #E8F0FE;\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: #1967D2;\n",
|
||
" height: 32px;\n",
|
||
" padding: 0 0 0 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert:hover {\n",
|
||
" background-color: #E2EBFA;\n",
|
||
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: #174EA6;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-buttons div {\n",
|
||
" margin-bottom: 4px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert {\n",
|
||
" background-color: #3B4455;\n",
|
||
" fill: #D2E3FC;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert:hover {\n",
|
||
" background-color: #434B5C;\n",
|
||
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
||
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
||
" fill: #FFFFFF;\n",
|
||
" }\n",
|
||
" </style>\n",
|
||
"\n",
|
||
" <script>\n",
|
||
" const buttonEl =\n",
|
||
" document.querySelector('#df-b8e12090-9d6e-445f-81e8-6e5ddcfefbf1 button.colab-df-convert');\n",
|
||
" buttonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
"\n",
|
||
" async function convertToInteractive(key) {\n",
|
||
" const element = document.querySelector('#df-b8e12090-9d6e-445f-81e8-6e5ddcfefbf1');\n",
|
||
" const dataTable =\n",
|
||
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
|
||
" [key], {});\n",
|
||
" if (!dataTable) return;\n",
|
||
"\n",
|
||
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
|
||
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
|
||
" + ' to learn more about interactive tables.';\n",
|
||
" element.innerHTML = '';\n",
|
||
" dataTable['output_type'] = 'display_data';\n",
|
||
" await google.colab.output.renderOutput(dataTable, element);\n",
|
||
" const docLink = document.createElement('div');\n",
|
||
" docLink.innerHTML = docLinkHtml;\n",
|
||
" element.appendChild(docLink);\n",
|
||
" }\n",
|
||
" </script>\n",
|
||
" </div>\n",
|
||
"\n",
|
||
"\n",
|
||
" <div id=\"id_cd967a48-c75b-46be-b48a-8ee744bba086\">\n",
|
||
" <style>\n",
|
||
" .colab-df-generate {\n",
|
||
" background-color: #E8F0FE;\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: #1967D2;\n",
|
||
" height: 32px;\n",
|
||
" padding: 0 0 0 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-generate:hover {\n",
|
||
" background-color: #E2EBFA;\n",
|
||
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: #174EA6;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-generate {\n",
|
||
" background-color: #3B4455;\n",
|
||
" fill: #D2E3FC;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-generate:hover {\n",
|
||
" background-color: #434B5C;\n",
|
||
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
||
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
||
" fill: #FFFFFF;\n",
|
||
" }\n",
|
||
" </style>\n",
|
||
" <button class=\"colab-df-generate\" onclick=\"generateWithVariable('hasil')\"\n",
|
||
" title=\"Generate code using this dataframe.\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
||
" width=\"24px\">\n",
|
||
" <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
|
||
" </svg>\n",
|
||
" </button>\n",
|
||
" <script>\n",
|
||
" (() => {\n",
|
||
" const buttonEl =\n",
|
||
" document.querySelector('#id_cd967a48-c75b-46be-b48a-8ee744bba086 button.colab-df-generate');\n",
|
||
" buttonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
"\n",
|
||
" buttonEl.onclick = () => {\n",
|
||
" google.colab.notebook.generateWithVariable('hasil');\n",
|
||
" }\n",
|
||
" })();\n",
|
||
" </script>\n",
|
||
" </div>\n",
|
||
"\n",
|
||
" </div>\n",
|
||
" </div>\n"
|
||
],
|
||
"application/vnd.google.colaboratory.intrinsic+json": {
|
||
"type": "dataframe",
|
||
"variable_name": "hasil",
|
||
"summary": "{\n \"name\": \"hasil\",\n \"rows\": 8,\n \"fields\": [\n {\n \"column\": \"Kata\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 8,\n \"samples\": [\n \"Universitas\",\n \"di\",\n \"Mahasiswa\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"POS Tag\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"VERB\",\n \"PUNCT\",\n \"ADP\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Penjelasan\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"VERB\",\n \"PUNCT\",\n \"ADP\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
|
||
}
|
||
},
|
||
"metadata": {}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"\n",
|
||
"daftar_kalimat = [\n",
|
||
" \"Saya sedang belajar pemrograman Python.\",\n",
|
||
" \"Mahasiswa membaca buku di perpustakaan.\",\n",
|
||
" \"Dosen menjelaskan materi kecerdasan buatan.\",\n",
|
||
" \"Indonesia memiliki banyak bahasa daerah.\",\n",
|
||
" \"Teknologi berkembang dengan sangat cepat.\"\n",
|
||
"]\n",
|
||
"\n",
|
||
"semua_hasil = []\n",
|
||
"\n",
|
||
"for nomor, kalimat in enumerate(daftar_kalimat, start=1):\n",
|
||
" doc = nlp(kalimat)\n",
|
||
"\n",
|
||
" for sentence in doc.sentences:\n",
|
||
" for word in sentence.words:\n",
|
||
" semua_hasil.append({\n",
|
||
" \"Nomor Kalimat\": nomor,\n",
|
||
" \"Kalimat\": kalimat,\n",
|
||
" \"Kata\": word.text,\n",
|
||
" \"POS Tag\": word.upos\n",
|
||
" })\n",
|
||
"\n",
|
||
"df_hasil = pd.DataFrame(semua_hasil)\n",
|
||
"\n",
|
||
"display(df_hasil)\n"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 990
|
||
},
|
||
"id": "y32aFxXPOoUo",
|
||
"outputId": "aedaa9f2-8172-4dfe-a59a-957352f75cb0"
|
||
},
|
||
"execution_count": 5,
|
||
"outputs": [
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
" Nomor Kalimat Kalimat Kata \\\n",
|
||
"0 1 Saya sedang belajar pemrograman Python. Saya \n",
|
||
"1 1 Saya sedang belajar pemrograman Python. sedang \n",
|
||
"2 1 Saya sedang belajar pemrograman Python. belajar \n",
|
||
"3 1 Saya sedang belajar pemrograman Python. pemrograman \n",
|
||
"4 1 Saya sedang belajar pemrograman Python. Python \n",
|
||
"5 1 Saya sedang belajar pemrograman Python. . \n",
|
||
"6 2 Mahasiswa membaca buku di perpustakaan. Mahasiswa \n",
|
||
"7 2 Mahasiswa membaca buku di perpustakaan. membaca \n",
|
||
"8 2 Mahasiswa membaca buku di perpustakaan. buku \n",
|
||
"9 2 Mahasiswa membaca buku di perpustakaan. di \n",
|
||
"10 2 Mahasiswa membaca buku di perpustakaan. perpustakaan \n",
|
||
"11 2 Mahasiswa membaca buku di perpustakaan. . \n",
|
||
"12 3 Dosen menjelaskan materi kecerdasan buatan. Dosen \n",
|
||
"13 3 Dosen menjelaskan materi kecerdasan buatan. menjelaskan \n",
|
||
"14 3 Dosen menjelaskan materi kecerdasan buatan. materi \n",
|
||
"15 3 Dosen menjelaskan materi kecerdasan buatan. kecerdasan \n",
|
||
"16 3 Dosen menjelaskan materi kecerdasan buatan. buatan \n",
|
||
"17 3 Dosen menjelaskan materi kecerdasan buatan. . \n",
|
||
"18 4 Indonesia memiliki banyak bahasa daerah. Indonesia \n",
|
||
"19 4 Indonesia memiliki banyak bahasa daerah. memiliki \n",
|
||
"20 4 Indonesia memiliki banyak bahasa daerah. banyak \n",
|
||
"21 4 Indonesia memiliki banyak bahasa daerah. bahasa \n",
|
||
"22 4 Indonesia memiliki banyak bahasa daerah. daerah \n",
|
||
"23 4 Indonesia memiliki banyak bahasa daerah. . \n",
|
||
"24 5 Teknologi berkembang dengan sangat cepat. Teknologi \n",
|
||
"25 5 Teknologi berkembang dengan sangat cepat. berkembang \n",
|
||
"26 5 Teknologi berkembang dengan sangat cepat. dengan \n",
|
||
"27 5 Teknologi berkembang dengan sangat cepat. sangat \n",
|
||
"28 5 Teknologi berkembang dengan sangat cepat. cepat \n",
|
||
"29 5 Teknologi berkembang dengan sangat cepat. . \n",
|
||
"\n",
|
||
" POS Tag \n",
|
||
"0 PRON \n",
|
||
"1 AUX \n",
|
||
"2 VERB \n",
|
||
"3 NOUN \n",
|
||
"4 PROPN \n",
|
||
"5 PUNCT \n",
|
||
"6 PROPN \n",
|
||
"7 VERB \n",
|
||
"8 NOUN \n",
|
||
"9 ADP \n",
|
||
"10 NOUN \n",
|
||
"11 PUNCT \n",
|
||
"12 PROPN \n",
|
||
"13 VERB \n",
|
||
"14 NOUN \n",
|
||
"15 NOUN \n",
|
||
"16 NOUN \n",
|
||
"17 PUNCT \n",
|
||
"18 PROPN \n",
|
||
"19 VERB \n",
|
||
"20 ADV \n",
|
||
"21 NOUN \n",
|
||
"22 NOUN \n",
|
||
"23 PUNCT \n",
|
||
"24 PROPN \n",
|
||
"25 VERB \n",
|
||
"26 ADP \n",
|
||
"27 ADV \n",
|
||
"28 ADJ \n",
|
||
"29 PUNCT "
|
||
],
|
||
"text/html": [
|
||
"\n",
|
||
" <div id=\"df-d067ba33-33cf-4395-9f46-f0392987020e\" class=\"colab-df-container\">\n",
|
||
" <div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>Nomor Kalimat</th>\n",
|
||
" <th>Kalimat</th>\n",
|
||
" <th>Kata</th>\n",
|
||
" <th>POS Tag</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>1</td>\n",
|
||
" <td>Saya sedang belajar pemrograman Python.</td>\n",
|
||
" <td>Saya</td>\n",
|
||
" <td>PRON</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>1</td>\n",
|
||
" <td>Saya sedang belajar pemrograman Python.</td>\n",
|
||
" <td>sedang</td>\n",
|
||
" <td>AUX</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>1</td>\n",
|
||
" <td>Saya sedang belajar pemrograman Python.</td>\n",
|
||
" <td>belajar</td>\n",
|
||
" <td>VERB</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>1</td>\n",
|
||
" <td>Saya sedang belajar pemrograman Python.</td>\n",
|
||
" <td>pemrograman</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>1</td>\n",
|
||
" <td>Saya sedang belajar pemrograman Python.</td>\n",
|
||
" <td>Python</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>5</th>\n",
|
||
" <td>1</td>\n",
|
||
" <td>Saya sedang belajar pemrograman Python.</td>\n",
|
||
" <td>.</td>\n",
|
||
" <td>PUNCT</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>6</th>\n",
|
||
" <td>2</td>\n",
|
||
" <td>Mahasiswa membaca buku di perpustakaan.</td>\n",
|
||
" <td>Mahasiswa</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>7</th>\n",
|
||
" <td>2</td>\n",
|
||
" <td>Mahasiswa membaca buku di perpustakaan.</td>\n",
|
||
" <td>membaca</td>\n",
|
||
" <td>VERB</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>8</th>\n",
|
||
" <td>2</td>\n",
|
||
" <td>Mahasiswa membaca buku di perpustakaan.</td>\n",
|
||
" <td>buku</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>9</th>\n",
|
||
" <td>2</td>\n",
|
||
" <td>Mahasiswa membaca buku di perpustakaan.</td>\n",
|
||
" <td>di</td>\n",
|
||
" <td>ADP</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>10</th>\n",
|
||
" <td>2</td>\n",
|
||
" <td>Mahasiswa membaca buku di perpustakaan.</td>\n",
|
||
" <td>perpustakaan</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>11</th>\n",
|
||
" <td>2</td>\n",
|
||
" <td>Mahasiswa membaca buku di perpustakaan.</td>\n",
|
||
" <td>.</td>\n",
|
||
" <td>PUNCT</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>12</th>\n",
|
||
" <td>3</td>\n",
|
||
" <td>Dosen menjelaskan materi kecerdasan buatan.</td>\n",
|
||
" <td>Dosen</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>13</th>\n",
|
||
" <td>3</td>\n",
|
||
" <td>Dosen menjelaskan materi kecerdasan buatan.</td>\n",
|
||
" <td>menjelaskan</td>\n",
|
||
" <td>VERB</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>14</th>\n",
|
||
" <td>3</td>\n",
|
||
" <td>Dosen menjelaskan materi kecerdasan buatan.</td>\n",
|
||
" <td>materi</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>15</th>\n",
|
||
" <td>3</td>\n",
|
||
" <td>Dosen menjelaskan materi kecerdasan buatan.</td>\n",
|
||
" <td>kecerdasan</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>16</th>\n",
|
||
" <td>3</td>\n",
|
||
" <td>Dosen menjelaskan materi kecerdasan buatan.</td>\n",
|
||
" <td>buatan</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>17</th>\n",
|
||
" <td>3</td>\n",
|
||
" <td>Dosen menjelaskan materi kecerdasan buatan.</td>\n",
|
||
" <td>.</td>\n",
|
||
" <td>PUNCT</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>18</th>\n",
|
||
" <td>4</td>\n",
|
||
" <td>Indonesia memiliki banyak bahasa daerah.</td>\n",
|
||
" <td>Indonesia</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>19</th>\n",
|
||
" <td>4</td>\n",
|
||
" <td>Indonesia memiliki banyak bahasa daerah.</td>\n",
|
||
" <td>memiliki</td>\n",
|
||
" <td>VERB</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>20</th>\n",
|
||
" <td>4</td>\n",
|
||
" <td>Indonesia memiliki banyak bahasa daerah.</td>\n",
|
||
" <td>banyak</td>\n",
|
||
" <td>ADV</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>21</th>\n",
|
||
" <td>4</td>\n",
|
||
" <td>Indonesia memiliki banyak bahasa daerah.</td>\n",
|
||
" <td>bahasa</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>22</th>\n",
|
||
" <td>4</td>\n",
|
||
" <td>Indonesia memiliki banyak bahasa daerah.</td>\n",
|
||
" <td>daerah</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>23</th>\n",
|
||
" <td>4</td>\n",
|
||
" <td>Indonesia memiliki banyak bahasa daerah.</td>\n",
|
||
" <td>.</td>\n",
|
||
" <td>PUNCT</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>24</th>\n",
|
||
" <td>5</td>\n",
|
||
" <td>Teknologi berkembang dengan sangat cepat.</td>\n",
|
||
" <td>Teknologi</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>25</th>\n",
|
||
" <td>5</td>\n",
|
||
" <td>Teknologi berkembang dengan sangat cepat.</td>\n",
|
||
" <td>berkembang</td>\n",
|
||
" <td>VERB</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>26</th>\n",
|
||
" <td>5</td>\n",
|
||
" <td>Teknologi berkembang dengan sangat cepat.</td>\n",
|
||
" <td>dengan</td>\n",
|
||
" <td>ADP</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>27</th>\n",
|
||
" <td>5</td>\n",
|
||
" <td>Teknologi berkembang dengan sangat cepat.</td>\n",
|
||
" <td>sangat</td>\n",
|
||
" <td>ADV</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>28</th>\n",
|
||
" <td>5</td>\n",
|
||
" <td>Teknologi berkembang dengan sangat cepat.</td>\n",
|
||
" <td>cepat</td>\n",
|
||
" <td>ADJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>29</th>\n",
|
||
" <td>5</td>\n",
|
||
" <td>Teknologi berkembang dengan sangat cepat.</td>\n",
|
||
" <td>.</td>\n",
|
||
" <td>PUNCT</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>\n",
|
||
" <div class=\"colab-df-buttons\">\n",
|
||
"\n",
|
||
" <div class=\"colab-df-container\">\n",
|
||
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-d067ba33-33cf-4395-9f46-f0392987020e')\"\n",
|
||
" title=\"Convert this dataframe to an interactive table.\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
|
||
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
|
||
" </svg>\n",
|
||
" </button>\n",
|
||
"\n",
|
||
" <style>\n",
|
||
" .colab-df-container {\n",
|
||
" display:flex;\n",
|
||
" gap: 12px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert {\n",
|
||
" background-color: #E8F0FE;\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: #1967D2;\n",
|
||
" height: 32px;\n",
|
||
" padding: 0 0 0 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert:hover {\n",
|
||
" background-color: #E2EBFA;\n",
|
||
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: #174EA6;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-buttons div {\n",
|
||
" margin-bottom: 4px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert {\n",
|
||
" background-color: #3B4455;\n",
|
||
" fill: #D2E3FC;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert:hover {\n",
|
||
" background-color: #434B5C;\n",
|
||
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
||
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
||
" fill: #FFFFFF;\n",
|
||
" }\n",
|
||
" </style>\n",
|
||
"\n",
|
||
" <script>\n",
|
||
" const buttonEl =\n",
|
||
" document.querySelector('#df-d067ba33-33cf-4395-9f46-f0392987020e button.colab-df-convert');\n",
|
||
" buttonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
"\n",
|
||
" async function convertToInteractive(key) {\n",
|
||
" const element = document.querySelector('#df-d067ba33-33cf-4395-9f46-f0392987020e');\n",
|
||
" const dataTable =\n",
|
||
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
|
||
" [key], {});\n",
|
||
" if (!dataTable) return;\n",
|
||
"\n",
|
||
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
|
||
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
|
||
" + ' to learn more about interactive tables.';\n",
|
||
" element.innerHTML = '';\n",
|
||
" dataTable['output_type'] = 'display_data';\n",
|
||
" await google.colab.output.renderOutput(dataTable, element);\n",
|
||
" const docLink = document.createElement('div');\n",
|
||
" docLink.innerHTML = docLinkHtml;\n",
|
||
" element.appendChild(docLink);\n",
|
||
" }\n",
|
||
" </script>\n",
|
||
" </div>\n",
|
||
"\n",
|
||
"\n",
|
||
" <div id=\"id_5a1b3ebd-b7f6-458b-bc66-1d1f1db97a42\">\n",
|
||
" <style>\n",
|
||
" .colab-df-generate {\n",
|
||
" background-color: #E8F0FE;\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: #1967D2;\n",
|
||
" height: 32px;\n",
|
||
" padding: 0 0 0 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-generate:hover {\n",
|
||
" background-color: #E2EBFA;\n",
|
||
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: #174EA6;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-generate {\n",
|
||
" background-color: #3B4455;\n",
|
||
" fill: #D2E3FC;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-generate:hover {\n",
|
||
" background-color: #434B5C;\n",
|
||
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
||
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
||
" fill: #FFFFFF;\n",
|
||
" }\n",
|
||
" </style>\n",
|
||
" <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df_hasil')\"\n",
|
||
" title=\"Generate code using this dataframe.\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
||
" width=\"24px\">\n",
|
||
" <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
|
||
" </svg>\n",
|
||
" </button>\n",
|
||
" <script>\n",
|
||
" (() => {\n",
|
||
" const buttonEl =\n",
|
||
" document.querySelector('#id_5a1b3ebd-b7f6-458b-bc66-1d1f1db97a42 button.colab-df-generate');\n",
|
||
" buttonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
"\n",
|
||
" buttonEl.onclick = () => {\n",
|
||
" google.colab.notebook.generateWithVariable('df_hasil');\n",
|
||
" }\n",
|
||
" })();\n",
|
||
" </script>\n",
|
||
" </div>\n",
|
||
"\n",
|
||
" </div>\n",
|
||
" </div>\n"
|
||
],
|
||
"application/vnd.google.colaboratory.intrinsic+json": {
|
||
"type": "dataframe",
|
||
"variable_name": "df_hasil",
|
||
"summary": "{\n \"name\": \"df_hasil\",\n \"rows\": 30,\n \"fields\": [\n {\n \"column\": \"Nomor Kalimat\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1,\n \"min\": 1,\n \"max\": 5,\n \"num_unique_values\": 5,\n \"samples\": [\n 2,\n 5,\n 3\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Kalimat\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Mahasiswa membaca buku di perpustakaan.\",\n \"Teknologi berkembang dengan sangat cepat.\",\n \"Dosen menjelaskan materi kecerdasan buatan.\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Kata\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 26,\n \"samples\": [\n \"buku\",\n \"Indonesia\",\n \"Saya\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"POS Tag\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 9,\n \"samples\": [\n \"ADV\",\n \"AUX\",\n \"PUNCT\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
|
||
}
|
||
},
|
||
"metadata": {}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"\n",
|
||
"nama_file = \"hasil_pos_tagging.csv\"\n",
|
||
"\n",
|
||
"df_hasil.to_csv(\n",
|
||
" nama_file,\n",
|
||
" index=False,\n",
|
||
" encoding=\"utf-8-sig\"\n",
|
||
")\n",
|
||
"\n",
|
||
"print(f\"Hasil berhasil disimpan ke {nama_file}\")\n"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "HnjeYxDPOs02",
|
||
"outputId": "50be2668-aa51-4feb-d948-9c8c6aad012e"
|
||
},
|
||
"execution_count": 6,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stdout",
|
||
"text": [
|
||
"Hasil berhasil disimpan ke hasil_pos_tagging.csv\n"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"\n",
|
||
"from google.colab import files\n",
|
||
"\n",
|
||
"files.download(\"hasil_pos_tagging.csv\")\n"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 17
|
||
},
|
||
"id": "d404yo_OOv8U",
|
||
"outputId": "504764be-b7cc-47f2-b315-ac20f33c14e4"
|
||
},
|
||
"execution_count": 7,
|
||
"outputs": [
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
"<IPython.core.display.Javascript object>"
|
||
],
|
||
"application/javascript": [
|
||
"\n",
|
||
" async function download(id, filename, size) {\n",
|
||
" if (!google.colab.kernel.accessAllowed) {\n",
|
||
" return;\n",
|
||
" }\n",
|
||
" const div = document.createElement('div');\n",
|
||
" const label = document.createElement('label');\n",
|
||
" label.textContent = `Downloading \"${filename}\": `;\n",
|
||
" div.appendChild(label);\n",
|
||
" const progress = document.createElement('progress');\n",
|
||
" progress.max = size;\n",
|
||
" div.appendChild(progress);\n",
|
||
" document.body.appendChild(div);\n",
|
||
"\n",
|
||
" const buffers = [];\n",
|
||
" let downloaded = 0;\n",
|
||
"\n",
|
||
" const channel = await google.colab.kernel.comms.open(id);\n",
|
||
" // Send a message to notify the kernel that we're ready.\n",
|
||
" channel.send({})\n",
|
||
"\n",
|
||
" for await (const message of channel.messages) {\n",
|
||
" // Send a message to notify the kernel that we're ready.\n",
|
||
" channel.send({})\n",
|
||
" if (message.buffers) {\n",
|
||
" for (const buffer of message.buffers) {\n",
|
||
" buffers.push(buffer);\n",
|
||
" downloaded += buffer.byteLength;\n",
|
||
" progress.value = downloaded;\n",
|
||
" }\n",
|
||
" }\n",
|
||
" }\n",
|
||
" const blob = new Blob(buffers, {type: 'application/binary'});\n",
|
||
" const a = document.createElement('a');\n",
|
||
" a.href = window.URL.createObjectURL(blob);\n",
|
||
" a.download = filename;\n",
|
||
" div.appendChild(a);\n",
|
||
" a.click();\n",
|
||
" div.remove();\n",
|
||
" }\n",
|
||
" "
|
||
]
|
||
},
|
||
"metadata": {}
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
"<IPython.core.display.Javascript object>"
|
||
],
|
||
"application/javascript": [
|
||
"download(\"download_22138e6d-ea8b-4dbf-8dcd-72079babbd1e\", \"hasil_pos_tagging.csv\", 1706)"
|
||
]
|
||
},
|
||
"metadata": {}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"\n",
|
||
"kalimat_input = input(\"Masukkan kalimat Bahasa Indonesia: \")\n",
|
||
"\n",
|
||
"hasil_input = pos_tagging(kalimat_input)\n",
|
||
"\n",
|
||
"print(\"\\nHasil POS Tagging:\")\n",
|
||
"display(hasil_input)\n"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/",
|
||
"height": 321
|
||
},
|
||
"id": "yj5DsDgLOzg1",
|
||
"outputId": "6d7c2fc1-190b-48a7-80b0-f596f7a29e1b"
|
||
},
|
||
"execution_count": 9,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stdout",
|
||
"text": [
|
||
"Masukkan kalimat Bahasa Indonesia: Sistem komputer memproses data dengan cepat.\n",
|
||
"\n",
|
||
"Hasil POS Tagging:\n"
|
||
]
|
||
},
|
||
{
|
||
"output_type": "display_data",
|
||
"data": {
|
||
"text/plain": [
|
||
" Kata POS Tag Penjelasan\n",
|
||
"0 Sistem PROPN PROPN\n",
|
||
"1 komputer NOUN NOUN\n",
|
||
"2 memproses VERB VERB\n",
|
||
"3 data NOUN NOUN\n",
|
||
"4 dengan SCONJ SCONJ\n",
|
||
"5 cepat ADJ ADJ\n",
|
||
"6 . PUNCT PUNCT"
|
||
],
|
||
"text/html": [
|
||
"\n",
|
||
" <div id=\"df-ec29a3bd-70d0-42cb-86d9-4f4fb6e0c698\" class=\"colab-df-container\">\n",
|
||
" <div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>Kata</th>\n",
|
||
" <th>POS Tag</th>\n",
|
||
" <th>Penjelasan</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>Sistem</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" <td>PROPN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>komputer</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>memproses</td>\n",
|
||
" <td>VERB</td>\n",
|
||
" <td>VERB</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>data</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" <td>NOUN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>dengan</td>\n",
|
||
" <td>SCONJ</td>\n",
|
||
" <td>SCONJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>5</th>\n",
|
||
" <td>cepat</td>\n",
|
||
" <td>ADJ</td>\n",
|
||
" <td>ADJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>6</th>\n",
|
||
" <td>.</td>\n",
|
||
" <td>PUNCT</td>\n",
|
||
" <td>PUNCT</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>\n",
|
||
" <div class=\"colab-df-buttons\">\n",
|
||
"\n",
|
||
" <div class=\"colab-df-container\">\n",
|
||
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-ec29a3bd-70d0-42cb-86d9-4f4fb6e0c698')\"\n",
|
||
" title=\"Convert this dataframe to an interactive table.\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
|
||
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
|
||
" </svg>\n",
|
||
" </button>\n",
|
||
"\n",
|
||
" <style>\n",
|
||
" .colab-df-container {\n",
|
||
" display:flex;\n",
|
||
" gap: 12px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert {\n",
|
||
" background-color: #E8F0FE;\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: #1967D2;\n",
|
||
" height: 32px;\n",
|
||
" padding: 0 0 0 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-convert:hover {\n",
|
||
" background-color: #E2EBFA;\n",
|
||
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: #174EA6;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-buttons div {\n",
|
||
" margin-bottom: 4px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert {\n",
|
||
" background-color: #3B4455;\n",
|
||
" fill: #D2E3FC;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-convert:hover {\n",
|
||
" background-color: #434B5C;\n",
|
||
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
||
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
||
" fill: #FFFFFF;\n",
|
||
" }\n",
|
||
" </style>\n",
|
||
"\n",
|
||
" <script>\n",
|
||
" const buttonEl =\n",
|
||
" document.querySelector('#df-ec29a3bd-70d0-42cb-86d9-4f4fb6e0c698 button.colab-df-convert');\n",
|
||
" buttonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
"\n",
|
||
" async function convertToInteractive(key) {\n",
|
||
" const element = document.querySelector('#df-ec29a3bd-70d0-42cb-86d9-4f4fb6e0c698');\n",
|
||
" const dataTable =\n",
|
||
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
|
||
" [key], {});\n",
|
||
" if (!dataTable) return;\n",
|
||
"\n",
|
||
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
|
||
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
|
||
" + ' to learn more about interactive tables.';\n",
|
||
" element.innerHTML = '';\n",
|
||
" dataTable['output_type'] = 'display_data';\n",
|
||
" await google.colab.output.renderOutput(dataTable, element);\n",
|
||
" const docLink = document.createElement('div');\n",
|
||
" docLink.innerHTML = docLinkHtml;\n",
|
||
" element.appendChild(docLink);\n",
|
||
" }\n",
|
||
" </script>\n",
|
||
" </div>\n",
|
||
"\n",
|
||
"\n",
|
||
" <div id=\"id_a084ce90-6076-4e4f-8d89-848ef5dcceb4\">\n",
|
||
" <style>\n",
|
||
" .colab-df-generate {\n",
|
||
" background-color: #E8F0FE;\n",
|
||
" border: none;\n",
|
||
" border-radius: 50%;\n",
|
||
" cursor: pointer;\n",
|
||
" display: none;\n",
|
||
" fill: #1967D2;\n",
|
||
" height: 32px;\n",
|
||
" padding: 0 0 0 0;\n",
|
||
" width: 32px;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .colab-df-generate:hover {\n",
|
||
" background-color: #E2EBFA;\n",
|
||
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
||
" fill: #174EA6;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-generate {\n",
|
||
" background-color: #3B4455;\n",
|
||
" fill: #D2E3FC;\n",
|
||
" }\n",
|
||
"\n",
|
||
" [theme=dark] .colab-df-generate:hover {\n",
|
||
" background-color: #434B5C;\n",
|
||
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
||
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
||
" fill: #FFFFFF;\n",
|
||
" }\n",
|
||
" </style>\n",
|
||
" <button class=\"colab-df-generate\" onclick=\"generateWithVariable('hasil_input')\"\n",
|
||
" title=\"Generate code using this dataframe.\"\n",
|
||
" style=\"display:none;\">\n",
|
||
"\n",
|
||
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
||
" width=\"24px\">\n",
|
||
" <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
|
||
" </svg>\n",
|
||
" </button>\n",
|
||
" <script>\n",
|
||
" (() => {\n",
|
||
" const buttonEl =\n",
|
||
" document.querySelector('#id_a084ce90-6076-4e4f-8d89-848ef5dcceb4 button.colab-df-generate');\n",
|
||
" buttonEl.style.display =\n",
|
||
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
||
"\n",
|
||
" buttonEl.onclick = () => {\n",
|
||
" google.colab.notebook.generateWithVariable('hasil_input');\n",
|
||
" }\n",
|
||
" })();\n",
|
||
" </script>\n",
|
||
" </div>\n",
|
||
"\n",
|
||
" </div>\n",
|
||
" </div>\n"
|
||
],
|
||
"application/vnd.google.colaboratory.intrinsic+json": {
|
||
"type": "dataframe",
|
||
"variable_name": "hasil_input",
|
||
"summary": "{\n \"name\": \"hasil_input\",\n \"rows\": 7,\n \"fields\": [\n {\n \"column\": \"Kata\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 7,\n \"samples\": [\n \"Sistem\",\n \"komputer\",\n \"cepat\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"POS Tag\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"PROPN\",\n \"NOUN\",\n \"PUNCT\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Penjelasan\",\n \"properties\": {\n \"dtype\": \"string\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"PROPN\",\n \"NOUN\",\n \"PUNCT\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
|
||
}
|
||
},
|
||
"metadata": {}
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"source": [
|
||
"\n",
|
||
"import os\n",
|
||
"import urllib.request\n",
|
||
"\n",
|
||
"os.makedirs(\"dataset\", exist_ok=True)\n",
|
||
"\n",
|
||
"base_url = (\n",
|
||
" \"https://raw.githubusercontent.com/\"\n",
|
||
" \"UniversalDependencies/UD_Indonesian-GSD/master/\"\n",
|
||
")\n",
|
||
"\n",
|
||
"file_dataset = [\n",
|
||
" \"id_gsd-ud-train.conllu\",\n",
|
||
" \"id_gsd-ud-dev.conllu\",\n",
|
||
" \"id_gsd-ud-test.conllu\"\n",
|
||
"]\n",
|
||
"\n",
|
||
"for nama_file in file_dataset:\n",
|
||
" url = base_url + nama_file\n",
|
||
" lokasi = os.path.join(\"dataset\", nama_file)\n",
|
||
"\n",
|
||
" urllib.request.urlretrieve(url, lokasi)\n",
|
||
"\n",
|
||
" print(f\"Berhasil mengunduh: {nama_file}\")\n",
|
||
"\n",
|
||
"print(\"\\nDataset selesai diunduh.\")\n"
|
||
],
|
||
"metadata": {
|
||
"colab": {
|
||
"base_uri": "https://localhost:8080/"
|
||
},
|
||
"id": "jVp8v8uaO5Zg",
|
||
"outputId": "e670380f-4d5b-4973-b9fd-5f460e4a4572"
|
||
},
|
||
"execution_count": 10,
|
||
"outputs": [
|
||
{
|
||
"output_type": "stream",
|
||
"name": "stdout",
|
||
"text": [
|
||
"Berhasil mengunduh: id_gsd-ud-train.conllu\n",
|
||
"Berhasil mengunduh: id_gsd-ud-dev.conllu\n",
|
||
"Berhasil mengunduh: id_gsd-ud-test.conllu\n",
|
||
"\n",
|
||
"Dataset selesai diunduh.\n"
|
||
]
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"source": [
|
||
"\n",
|
||
"# POS Tagging Bahasa Indonesia\n",
|
||
"\n",
|
||
"## Mata Kuliah\n",
|
||
"Natural Language Processing (NLP)\n",
|
||
"\n",
|
||
"## Identitas Mahasiswa\n",
|
||
"- Nama: Awang Andriansyah Hermawan\n",
|
||
"- NPM: 202310715155\n",
|
||
"- Program Studi: Informatika\n",
|
||
"- Universitas: Universitas Bhayangkara Jakarta Raya\n",
|
||
"\n",
|
||
"## Deskripsi\n",
|
||
"Proyek ini dibuat untuk memenuhi tugas mata kuliah\n",
|
||
"Natural Language Processing (NLP). Proyek ini\n",
|
||
"mengimplementasikan Part-of-Speech (POS) Tagging\n",
|
||
"pada teks Bahasa Indonesia menggunakan Python dan\n",
|
||
"library Stanza.\n",
|
||
"\n",
|
||
"POS Tagging merupakan proses pemberian label kelas\n",
|
||
"kata pada setiap kata dalam kalimat, seperti kata\n",
|
||
"benda, kata kerja, kata sifat, dan kata keterangan.\n",
|
||
"\n",
|
||
"## Tujuan\n",
|
||
"1. Memahami konsep POS Tagging dalam NLP.\n",
|
||
"2. Mengidentifikasi kelas kata dalam kalimat Bahasa Indonesia.\n",
|
||
"3. Mengimplementasikan POS Tagging menggunakan Python.\n",
|
||
"4. Menampilkan hasil pelabelan kelas kata dalam tabel.\n",
|
||
"5. Menyimpan hasil pemrosesan ke dalam file CSV.\n",
|
||
"\n",
|
||
"## Teknologi yang Digunakan\n",
|
||
"- Python\n",
|
||
"- Google Colab\n",
|
||
"- Stanza\n",
|
||
"- Pandas\n",
|
||
"- GitLab\n",
|
||
"\n",
|
||
"## Dataset\n",
|
||
"Proyek ini menggunakan model Bahasa Indonesia dari\n",
|
||
"Stanza untuk melakukan prediksi POS Tagging.\n",
|
||
"\n",
|
||
"Sebagai sumber korpus berlabel, proyek ini juga\n",
|
||
"menggunakan dataset Universal Dependencies Indonesian-GSD.\n",
|
||
"\n",
|
||
"Repository dataset:\n",
|
||
"https://github.com/UniversalDependencies/UD_Indonesian-GSD\n",
|
||
"\n",
|
||
"## Metode\n",
|
||
"1. Menyiapkan lingkungan Python.\n",
|
||
"2. Menginstal library Stanza dan Pandas.\n",
|
||
"3. Mengunduh model Bahasa Indonesia.\n",
|
||
"4. Memproses kalimat dan melakukan POS Tagging.\n",
|
||
"5. Menampilkan kata beserta label kelas katanya.\n",
|
||
"6. Menyimpan hasil pemrosesan ke CSV.\n",
|
||
"\n",
|
||
"Catatan: model Stanza yang digunakan pada implementasi\n",
|
||
"awal merupakan model yang telah dilatih sebelumnya.\n",
|
||
"Dataset Indonesian-GSD diunduh sebagai sumber korpus\n",
|
||
"dan belum berarti digunakan untuk melatih ulang model.\n",
|
||
"\n",
|
||
"## Struktur Repository\n",
|
||
"- POS_Tagging_Bahasa_Indonesia.ipynb\n",
|
||
"- README.md\n",
|
||
"- hasil_pos_tagging.csv\n",
|
||
"\n",
|
||
"## Cara Menjalankan\n",
|
||
"1. Buka file notebook di Google Colab.\n",
|
||
"2. Jalankan sel kode secara berurutan.\n",
|
||
"3. Tunggu proses instalasi dan pengunduhan model.\n",
|
||
"4. Masukkan kalimat Bahasa Indonesia.\n",
|
||
"5. Periksa hasil POS Tagging.\n",
|
||
"6. Unduh hasil dalam format CSV.\n",
|
||
"\n",
|
||
"## Batasan\n",
|
||
"Hasil prediksi dapat mengandung kesalahan, khususnya\n",
|
||
"pada kata ambigu, nama khusus, atau kalimat informal.\n",
|
||
"Hasil perlu diperiksa kembali untuk memastikan\n",
|
||
"ketepatan pelabelan kelas kata.\n",
|
||
"\n",
|
||
"## Sumber Referensi\n",
|
||
"- Stanza: https://stanfordnlp.github.io/stanza/\n",
|
||
"- Universal Dependencies:\n",
|
||
" https://universaldependencies.org/\n",
|
||
"- UD Indonesian-GSD:\n",
|
||
" https://github.com/UniversalDependencies/UD_Indonesian-GSD\n"
|
||
],
|
||
"metadata": {
|
||
"id": "AvAKlJNFPZsz"
|
||
}
|
||
}
|
||
]
|
||
} |