Datasets:
Tasks:
Text Classification
Modalities:
Text
Sub-tasks:
sentiment-classification
Languages:
Polish
Size:
100K - 1M
License:
Add loading script and dataset_infos.json
Browse files- dataset_infos.json +1 -0
- polemo2-official.py +173 -0
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"all_text": {"description": "PolEmo2 dataset.", "citation": "\n@inproceedings{kocon-etal-2019-multi,\n title = \"Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews\",\n author = \"Koco{'n}, Jan and\n Mi{\\l}kowski, Piotr and\n Za{'s}ko-Zieli{'n}ska, Monika\",\n booktitle = \"Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/K19-1092\",\n doi = \"10.18653/v1/K19-1092\",\n pages = \"980--991\",}\n", "homepage": "https://clarin-pl.eu/dspace/handle/11321/710", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"num_classes": 4, "names": ["zero", "minus", "plus", "amb"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "pol_emo2", "config_name": "all_text", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 5310044, "num_examples": 6573, "dataset_name": "pol_emo2"}, "validation": {"name": "validation", "num_bytes": 655645, "num_examples": 823, "dataset_name": "pol_emo2"}, "test": {"name": "test", "num_bytes": 640867, "num_examples": 820, "dataset_name": "pol_emo2"}}, "download_checksums": {"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/all.text.train.txt": {"num_bytes": 5372370, "checksum": "03b9908ba4662b81879c719ae7d19e72ff8c705eb7dc127450bc232810068bae"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/all.text.dev.txt": {"num_bytes": 663454, "checksum": "1d92db1b0b76f7c4787cbc1492f68be55c762deae0d6c6a0e5359748de7f4c47"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/all.text.test.txt": {"num_bytes": 648758, "checksum": "153ca33789f9b5bc5c8a7661bb13861a5c714b915b4f9969ae9901bee116d4c7"}}, "download_size": 6684582, "post_processing_size": null, "dataset_size": 6606556, "size_in_bytes": 13291138}, "all_sentence": {"description": "PolEmo2 dataset.", "citation": "\n@inproceedings{kocon-etal-2019-multi,\n title = \"Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews\",\n author = \"Koco{'n}, Jan and\n Mi{\\l}kowski, Piotr and\n Za{'s}ko-Zieli{'n}ska, Monika\",\n booktitle = \"Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/K19-1092\",\n doi = \"10.18653/v1/K19-1092\",\n pages = \"980--991\",}\n", "homepage": "https://clarin-pl.eu/dspace/handle/11321/710", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"num_classes": 4, "names": ["zero", "minus", "plus", "amb"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "pol_emo2", "config_name": "all_sentence", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 5422812, "num_examples": 45974, "dataset_name": "pol_emo2"}, "validation": {"name": "validation", "num_bytes": 688210, "num_examples": 5747, "dataset_name": "pol_emo2"}, "test": {"name": "test", "num_bytes": 678962, "num_examples": 5745, "dataset_name": "pol_emo2"}}, "download_checksums": {"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/all.sentence.train.txt": {"num_bytes": 5722466, "checksum": "e9b242f410e1c3e32892162293a4cbea772a4a490b80806e8510192665db4536"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/all.sentence.dev.txt": {"num_bytes": 725636, "checksum": "0a46a067854b3fd5ea40b9001d55b47310b1c249bdd19ac15f86685703c45051"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/all.sentence.test.txt": {"num_bytes": 716415, "checksum": "c359b426f7aba6f16a77c5a6a0284ddaa9bb4611ccb5897ebe4cc332edaf5fff"}}, "download_size": 7164517, "post_processing_size": null, "dataset_size": 6789984, "size_in_bytes": 13954501}, "hotels_text": {"description": "PolEmo2 dataset.", "citation": "\n@inproceedings{kocon-etal-2019-multi,\n title = \"Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews\",\n author = \"Koco{'n}, Jan and\n Mi{\\l}kowski, Piotr and\n Za{'s}ko-Zieli{'n}ska, Monika\",\n booktitle = \"Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/K19-1092\",\n doi = \"10.18653/v1/K19-1092\",\n pages = \"980--991\",}\n", "homepage": "https://clarin-pl.eu/dspace/handle/11321/710", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"num_classes": 4, "names": ["zero", "minus", "plus", "amb"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "pol_emo2", "config_name": "hotels_text", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2631434, "num_examples": 3165, "dataset_name": "pol_emo2"}, "validation": {"name": "validation", "num_bytes": 315872, "num_examples": 396, "dataset_name": "pol_emo2"}, "test": {"name": "test", "num_bytes": 305237, "num_examples": 395, "dataset_name": "pol_emo2"}}, "download_checksums": {"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/hotels.text.train.txt": {"num_bytes": 2661279, "checksum": "b84368ee95fc109bd9ff6044c2a7ef0973257a0a5d9d118eeb07d00aaec0efc5"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/hotels.text.dev.txt": {"num_bytes": 319625, "checksum": "1cd423189430b93587d64563c5c2287d70f799ef6af266d5756c281b65d82e07"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/hotels.text.test.txt": {"num_bytes": 309008, "checksum": "4ed729987dbed64ac5f3b2ada48524c4f6caed5845930b9a5ba04469bb438890"}}, "download_size": 3289912, "post_processing_size": null, "dataset_size": 3252543, "size_in_bytes": 6542455}, "hotels_sentence": {"description": "PolEmo2 dataset.", "citation": "\n@inproceedings{kocon-etal-2019-multi,\n title = \"Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews\",\n author = \"Koco{'n}, Jan and\n Mi{\\l}kowski, Piotr and\n Za{'s}ko-Zieli{'n}ska, Monika\",\n booktitle = \"Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/K19-1092\",\n doi = \"10.18653/v1/K19-1092\",\n pages = \"980--991\",}\n", "homepage": "https://clarin-pl.eu/dspace/handle/11321/710", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"num_classes": 4, "names": ["zero", "minus", "plus", "amb"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "pol_emo2", "config_name": "hotels_sentence", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2148908, "num_examples": 19881, "dataset_name": "pol_emo2"}, "validation": {"name": "validation", "num_bytes": 277861, "num_examples": 2485, "dataset_name": "pol_emo2"}, "test": {"name": "test", "num_bytes": 268453, "num_examples": 2485, "dataset_name": "pol_emo2"}}, "download_checksums": {"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/hotels.sentence.train.txt": {"num_bytes": 2282109, "checksum": "dcff8e61d166d90be40d28cea6dd4632879232eab0dee8eae0ae74fd595ebc28"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/hotels.sentence.dev.txt": {"num_bytes": 294536, "checksum": "20031ce694af034095ed181f9dca2d0c636db5bd9ecf450da1c29b2d3a724609"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/hotels.sentence.test.txt": {"num_bytes": 285134, "checksum": "6a6422a9763441695adcb3c12224789168ec5e1eea3d7b1b04a59ece4bebbb50"}}, "download_size": 2861779, "post_processing_size": null, "dataset_size": 2695222, "size_in_bytes": 5557001}, "medicine_text": {"description": "PolEmo2 dataset.", "citation": "\n@inproceedings{kocon-etal-2019-multi,\n title = \"Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews\",\n author = \"Koco{'n}, Jan and\n Mi{\\l}kowski, Piotr and\n Za{'s}ko-Zieli{'n}ska, Monika\",\n booktitle = \"Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/K19-1092\",\n doi = \"10.18653/v1/K19-1092\",\n pages = \"980--991\",}\n", "homepage": "https://clarin-pl.eu/dspace/handle/11321/710", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"num_classes": 4, "names": ["zero", "minus", "plus", "amb"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "pol_emo2", "config_name": "medicine_text", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2178785, "num_examples": 2618, "dataset_name": "pol_emo2"}, "validation": {"name": "validation", "num_bytes": 277662, "num_examples": 327, "dataset_name": "pol_emo2"}, "test": {"name": "test", "num_bytes": 276819, "num_examples": 327, "dataset_name": "pol_emo2"}}, "download_checksums": {"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/medicine.text.train.txt": {"num_bytes": 2203864, "checksum": "dc6ec05cf2f9537b31d82ef9bdd548ae56caaae25233a962ec12b14ec72a9c89"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/medicine.text.dev.txt": {"num_bytes": 280800, "checksum": "aa17a4a22173cae5f081fae4a127415b35990afe31068de14ad8408aef01e945"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/medicine.text.test.txt": {"num_bytes": 280002, "checksum": "aa7c2f894fe44dc6abe3e2c503c2c656c1aa0f22cf7a33143fa1bc47fc53f702"}}, "download_size": 2764666, "post_processing_size": null, "dataset_size": 2733266, "size_in_bytes": 5497932}, "medicine_sentence": {"description": "PolEmo2 dataset.", "citation": "\n@inproceedings{kocon-etal-2019-multi,\n title = \"Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews\",\n author = \"Koco{'n}, Jan and\n Mi{\\l}kowski, Piotr and\n Za{'s}ko-Zieli{'n}ska, Monika\",\n booktitle = \"Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/K19-1092\",\n doi = \"10.18653/v1/K19-1092\",\n pages = \"980--991\",}\n", "homepage": "https://clarin-pl.eu/dspace/handle/11321/710", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"num_classes": 4, "names": ["zero", "minus", "plus", "amb"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "pol_emo2", "config_name": "medicine_sentence", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2334949, "num_examples": 18126, "dataset_name": "pol_emo2"}, "validation": {"name": "validation", "num_bytes": 291410, "num_examples": 2266, "dataset_name": "pol_emo2"}, "test": {"name": "test", "num_bytes": 292239, "num_examples": 2265, "dataset_name": "pol_emo2"}}, "download_checksums": {"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/medicine.sentence.train.txt": {"num_bytes": 2449813, "checksum": "83021c5763d2111593563a9af5070dcae84a7762a6215b1b5eadb48daed70e97"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/medicine.sentence.dev.txt": {"num_bytes": 305704, "checksum": "2be6db1625cc975ae83cd91fe9ce02deed45afc24023ef62f15fd6f9f225007d"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/medicine.sentence.test.txt": {"num_bytes": 306561, "checksum": "7f14cb7251c64f40b388187f47d928c15850bc9d41efeda29e46b4be277914b5"}}, "download_size": 3062078, "post_processing_size": null, "dataset_size": 2918598, "size_in_bytes": 5980676}, "products_text": {"description": "PolEmo2 dataset.", "citation": "\n@inproceedings{kocon-etal-2019-multi,\n title = \"Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews\",\n author = \"Koco{'n}, Jan and\n Mi{\\l}kowski, Piotr and\n Za{'s}ko-Zieli{'n}ska, Monika\",\n booktitle = \"Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/K19-1092\",\n doi = \"10.18653/v1/K19-1092\",\n pages = \"980--991\",}\n", "homepage": "https://clarin-pl.eu/dspace/handle/11321/710", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"num_classes": 4, "names": ["zero", "minus", "plus", "amb"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "pol_emo2", "config_name": "products_text", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 314465, "num_examples": 387, "dataset_name": "pol_emo2"}, "validation": {"name": "validation", "num_bytes": 39190, "num_examples": 49, "dataset_name": "pol_emo2"}, "test": {"name": "test", "num_bytes": 38149, "num_examples": 48, "dataset_name": "pol_emo2"}}, "download_checksums": {"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/products.text.train.txt": {"num_bytes": 318245, "checksum": "0769fa52b863dcf06ec583060681639046c04648dc382907a72bf1c43ccef5f0"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/products.text.dev.txt": {"num_bytes": 39651, "checksum": "b0d5da94aaf33179e7b7396c78e198b558883e9fd0f1b321c0aabaf472a40a96"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/products.text.test.txt": {"num_bytes": 38628, "checksum": "cd837925da8ad894b4b96241e34ae12d8bfbd75ab218e761c3ed9106ccc08c69"}}, "download_size": 396524, "post_processing_size": null, "dataset_size": 391804, "size_in_bytes": 788328}, "products_sentence": {"description": "PolEmo2 dataset.", "citation": "\n@inproceedings{kocon-etal-2019-multi,\n title = \"Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews\",\n author = \"Koco{'n}, Jan and\n Mi{\\l}kowski, Piotr and\n Za{'s}ko-Zieli{'n}ska, Monika\",\n booktitle = \"Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/K19-1092\",\n doi = \"10.18653/v1/K19-1092\",\n pages = \"980--991\",}\n", "homepage": "https://clarin-pl.eu/dspace/handle/11321/710", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"num_classes": 4, "names": ["zero", "minus", "plus", "amb"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "pol_emo2", "config_name": "products_sentence", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 684607, "num_examples": 5942, "dataset_name": "pol_emo2"}, "validation": {"name": "validation", "num_bytes": 86435, "num_examples": 743, "dataset_name": "pol_emo2"}, "test": {"name": "test", "num_bytes": 85566, "num_examples": 742, "dataset_name": "pol_emo2"}}, "download_checksums": {"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/products.sentence.train.txt": {"num_bytes": 724260, "checksum": "b19ffdd9ca8877e65372e4f9802146a3c4e6d7715f06ac28b6115ff00ea51691"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/products.sentence.dev.txt": {"num_bytes": 91378, "checksum": "5894275714ae406a99cd121a37024c6850940085464ff6b1e734465346beb50f"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/products.sentence.test.txt": {"num_bytes": 90561, "checksum": "4773de89df8de19c077169c5dbe84d2cddb0c702854753655211376c9b58180d"}}, "download_size": 906199, "post_processing_size": null, "dataset_size": 856608, "size_in_bytes": 1762807}, "reviews_text": {"description": "PolEmo2 dataset.", "citation": "\n@inproceedings{kocon-etal-2019-multi,\n title = \"Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews\",\n author = \"Koco{'n}, Jan and\n Mi{\\l}kowski, Piotr and\n Za{'s}ko-Zieli{'n}ska, Monika\",\n booktitle = \"Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/K19-1092\",\n doi = \"10.18653/v1/K19-1092\",\n pages = \"980--991\",}\n", "homepage": "https://clarin-pl.eu/dspace/handle/11321/710", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"num_classes": 4, "names": ["zero", "minus", "plus", "amb"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "pol_emo2", "config_name": "reviews_text", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 185372, "num_examples": 403, "dataset_name": "pol_emo2"}, "validation": {"name": "validation", "num_bytes": 22933, "num_examples": 51, "dataset_name": "pol_emo2"}, "test": {"name": "test", "num_bytes": 20674, "num_examples": 50, "dataset_name": "pol_emo2"}}, "download_checksums": {"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/reviews.text.train.txt": {"num_bytes": 188982, "checksum": "1b4addad5e608b182d9d81311e216696f7fc37a4619c983013d0c047fd385bb2"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/reviews.text.dev.txt": {"num_bytes": 23378, "checksum": "d29cd3da6b943e7e8112c4c3b5f23f58105ed8be5f8c3763b979e41a1820f65c"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/reviews.text.test.txt": {"num_bytes": 21120, "checksum": "f7a71a534f85d4439d5f04cb3b6dba5add48f23aa47f33edefd43825625457c1"}}, "download_size": 233480, "post_processing_size": null, "dataset_size": 228979, "size_in_bytes": 462459}, "reviews_sentence": {"description": "PolEmo2 dataset.", "citation": "\n@inproceedings{kocon-etal-2019-multi,\n title = \"Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews\",\n author = \"Koco{'n}, Jan and\n Mi{\\l}kowski, Piotr and\n Za{'s}ko-Zieli{'n}ska, Monika\",\n booktitle = \"Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)\",\n month = nov,\n year = \"2019\",\n address = \"Hong Kong, China\",\n publisher = \"Association for Computational Linguistics\",\n url = \"https://www.aclweb.org/anthology/K19-1092\",\n doi = \"10.18653/v1/K19-1092\",\n pages = \"980--991\",}\n", "homepage": "https://clarin-pl.eu/dspace/handle/11321/710", "license": "", "features": {"text": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"num_classes": 4, "names": ["zero", "minus", "plus", "amb"], "names_file": null, "id": null, "_type": "ClassLabel"}}, "post_processed": null, "supervised_keys": null, "builder_name": "pol_emo2", "config_name": "reviews_sentence", "version": "0.0.0", "splits": {"train": {"name": "train", "num_bytes": 254352, "num_examples": 2025, "dataset_name": "pol_emo2"}, "validation": {"name": "validation", "num_bytes": 32516, "num_examples": 253, "dataset_name": "pol_emo2"}, "test": {"name": "test", "num_bytes": 32716, "num_examples": 253, "dataset_name": "pol_emo2"}}, "download_checksums": {"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/reviews.sentence.train.txt": {"num_bytes": 266284, "checksum": "fb52184a32b84d321001641b7c3f5d99e6ffbc3ecce5d6c5f0037e8e16d7a24a"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/reviews.sentence.dev.txt": {"num_bytes": 34018, "checksum": "fef72f390cf78f072e6c32d17660510375df8bf670cb75bec81aa4400303a43c"}, "https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data/reviews.sentence.test.txt": {"num_bytes": 34159, "checksum": "1785c7e2ebfe55e1b8d9e1fffb3c04b5ffd565c131b71c0ef387528a60e829ff"}}, "download_size": 334461, "post_processing_size": null, "dataset_size": 319584, "size_in_bytes": 654045}}
|
polemo2-official.py
ADDED
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2021 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
|
16 |
+
# Lint as: python3
|
17 |
+
"""PolEmo2 dataset."""
|
18 |
+
from dataclasses import dataclass
|
19 |
+
from typing import List, Dict, Generator, Union, Optional, Tuple
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
_DESCRIPTION = """PolEmo2 dataset."""
|
24 |
+
_CITATION = """
|
25 |
+
@inproceedings{kocon-etal-2019-multi,
|
26 |
+
title = "Multi-Level Sentiment Analysis of {P}ol{E}mo 2.0: Extended Corpus of Multi-Domain Consumer Reviews",
|
27 |
+
author = "Koco{\'n}, Jan and
|
28 |
+
Mi{\l}kowski, Piotr and
|
29 |
+
Za{\'s}ko-Zieli{\'n}ska, Monika",
|
30 |
+
booktitle = "Proceedings of the 23rd Conference on Computational Natural Language Learning (CoNLL)",
|
31 |
+
month = nov,
|
32 |
+
year = "2019",
|
33 |
+
address = "Hong Kong, China",
|
34 |
+
publisher = "Association for Computational Linguistics",
|
35 |
+
url = "https://www.aclweb.org/anthology/K19-1092",
|
36 |
+
doi = "10.18653/v1/K19-1092",
|
37 |
+
pages = "980--991",}
|
38 |
+
"""
|
39 |
+
_HOMEPAGE = "https://clarin-pl.eu/dspace/handle/11321/710"
|
40 |
+
|
41 |
+
_DOMAINS = [
|
42 |
+
"all",
|
43 |
+
"hotels",
|
44 |
+
"medicine",
|
45 |
+
"products",
|
46 |
+
"reviews",
|
47 |
+
]
|
48 |
+
_OUT_DOMAINS = ["Nhotels", "Nmedicine", "Nproducts", "Nreviews"]
|
49 |
+
_CONFIGS_TEXT = ["text", "sentence"]
|
50 |
+
|
51 |
+
_LABELS = ["zero", "minus", "plus", "amb"]
|
52 |
+
|
53 |
+
URL_PATH = (
|
54 |
+
"https://huggingface.co/datasets/clarin-pl/polemo2-official/resolve/main/data"
|
55 |
+
)
|
56 |
+
_URLS = {
|
57 |
+
cfg: {
|
58 |
+
**{
|
59 |
+
domain: {
|
60 |
+
split_type: f"{URL_PATH}/{domain}.{cfg}.{split_type}.txt"
|
61 |
+
for split_type in ["train", "dev", "test"]
|
62 |
+
}
|
63 |
+
for domain in _DOMAINS
|
64 |
+
},
|
65 |
+
**{
|
66 |
+
domain: {
|
67 |
+
split_type: f"{URL_PATH}/{domain}.{cfg}.{split_type}.txt"
|
68 |
+
for split_type in ["train", "dev"]
|
69 |
+
}
|
70 |
+
for domain in _OUT_DOMAINS
|
71 |
+
},
|
72 |
+
}
|
73 |
+
for cfg in _CONFIGS_TEXT
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
@dataclass
|
78 |
+
class PolEmo2Config(datasets.BuilderConfig):
|
79 |
+
text_cfg: Optional[str] = None
|
80 |
+
domain: Optional[str] = None
|
81 |
+
train_domains: Optional[List[str]] = None
|
82 |
+
dev_domains: Optional[List[str]] = None
|
83 |
+
test_domains: Optional[List[str]] = None
|
84 |
+
|
85 |
+
|
86 |
+
class PolEmo2(datasets.GeneratorBasedBuilder):
|
87 |
+
BUILDER_CONFIG_CLASS = PolEmo2Config
|
88 |
+
BUILDER_CONFIGS = [
|
89 |
+
*[
|
90 |
+
PolEmo2Config(
|
91 |
+
name=f"{domain}_{text_type}",
|
92 |
+
domain=domain,
|
93 |
+
text_cfg=text_type,
|
94 |
+
train_domains=[domain],
|
95 |
+
dev_domains=[domain],
|
96 |
+
test_domains=[domain],
|
97 |
+
)
|
98 |
+
for domain in _DOMAINS
|
99 |
+
for text_type in _CONFIGS_TEXT
|
100 |
+
]
|
101 |
+
]
|
102 |
+
|
103 |
+
def _info(self) -> datasets.DatasetInfo:
|
104 |
+
return datasets.DatasetInfo(
|
105 |
+
description=_DESCRIPTION,
|
106 |
+
features=datasets.Features(
|
107 |
+
{
|
108 |
+
"text": datasets.Value("string"),
|
109 |
+
"target": datasets.features.ClassLabel(
|
110 |
+
names=_LABELS, num_classes=len(_LABELS)
|
111 |
+
),
|
112 |
+
}
|
113 |
+
),
|
114 |
+
homepage=_HOMEPAGE,
|
115 |
+
citation=_CITATION,
|
116 |
+
)
|
117 |
+
|
118 |
+
def _get_files_by_domains(self, domains: List[str], split: str) -> List[str]:
|
119 |
+
return [_URLS[self.config.text_cfg][domain][split] for domain in domains]
|
120 |
+
|
121 |
+
def _split_generators(
|
122 |
+
self, dl_manager: datasets.DownloadManager
|
123 |
+
) -> List[datasets.SplitGenerator]:
|
124 |
+
files = {
|
125 |
+
"train": dl_manager.download_and_extract(
|
126 |
+
self._get_files_by_domains(
|
127 |
+
domains=self.config.train_domains, split="train"
|
128 |
+
)
|
129 |
+
),
|
130 |
+
"dev": dl_manager.download_and_extract(
|
131 |
+
self._get_files_by_domains(domains=self.config.dev_domains, split="dev")
|
132 |
+
),
|
133 |
+
"test": dl_manager.download_and_extract(
|
134 |
+
self._get_files_by_domains(
|
135 |
+
domains=self.config.test_domains, split="test"
|
136 |
+
)
|
137 |
+
),
|
138 |
+
}
|
139 |
+
return [
|
140 |
+
datasets.SplitGenerator(
|
141 |
+
name=datasets.Split.TRAIN,
|
142 |
+
gen_kwargs={"filepath": files["train"]},
|
143 |
+
),
|
144 |
+
datasets.SplitGenerator(
|
145 |
+
name=datasets.Split.VALIDATION,
|
146 |
+
gen_kwargs={"filepath": files["dev"]},
|
147 |
+
),
|
148 |
+
datasets.SplitGenerator(
|
149 |
+
name=datasets.Split.TEST,
|
150 |
+
gen_kwargs={"filepath": files["test"]},
|
151 |
+
),
|
152 |
+
]
|
153 |
+
|
154 |
+
def _generate_examples(
|
155 |
+
self, filepath: Union[str, List[str]]
|
156 |
+
) -> Generator[Tuple[int, Dict[str, str]], None, None]:
|
157 |
+
|
158 |
+
gid = 0
|
159 |
+
for path in filepath:
|
160 |
+
with open(path, "r") as f:
|
161 |
+
for line in f:
|
162 |
+
splitted_line = line.split(" ")
|
163 |
+
yield gid, {
|
164 |
+
"text": " ".join(splitted_line[:-1]),
|
165 |
+
"target": (
|
166 |
+
splitted_line[-1]
|
167 |
+
.strip()
|
168 |
+
.replace("minus_m", "minus")
|
169 |
+
.replace("plus_m", "plus")
|
170 |
+
.split("_")[-1]
|
171 |
+
),
|
172 |
+
}
|
173 |
+
gid += 1
|