system HF staff commited on
Commit
f9a5834
1 Parent(s): f70275a

Update files from the datasets library (from 1.3.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.3.0

Files changed (3) hide show
  1. README.md +5 -0
  2. dataset_infos.json +1 -1
  3. open_subtitles.py +41 -2
README.md CHANGED
@@ -104,6 +104,7 @@ task_ids:
104
  - [Dataset Curators](#dataset-curators)
105
  - [Licensing Information](#licensing-information)
106
  - [Citation Information](#citation-information)
 
107
 
108
  ## Dataset Description
109
 
@@ -206,3 +207,7 @@ Here are some examples of questions and facts:
206
  ### Citation Information
207
 
208
  [More Information Needed]
 
 
 
 
104
  - [Dataset Curators](#dataset-curators)
105
  - [Licensing Information](#licensing-information)
106
  - [Citation Information](#citation-information)
107
+ - [Contributions](#contributions)
108
 
109
  ## Dataset Description
110
 
207
  ### Citation Information
208
 
209
  [More Information Needed]
210
+
211
+ ### Contributions
212
+
213
+ Thanks to [@abhishekkrthakur](https://github.com/abhishekkrthakur) for adding this dataset.
dataset_infos.json CHANGED
@@ -1 +1 @@
1
- {"de-en": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["de", "en"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "de-en", "version": {"version_str": "2018.0.0", "description": "", "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1960641457, "num_examples": 22512639, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/de-en.txt.zip": {"num_bytes": 710557991, "checksum": "b1bdd09f3667a85ba9fd0688c8a943c710317e11e5f0f722b7f0f3f0bc38300c"}}, "download_size": 710557991, "post_processing_size": null, "dataset_size": 1960641457, "size_in_bytes": 2671199448}, "en-fr": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["en", "fr"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "en-fr", "version": {"version_str": "2018.0.0", "description": "", "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3644573238, "num_examples": 41763488, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/en-fr.txt.zip": {"num_bytes": 1296192799, "checksum": "96e547fe3f710c444639bbf594569634931c46ffdbeb7b3e0766cb2c72171240"}}, "download_size": 1296192799, "post_processing_size": null, "dataset_size": 3644573238, "size_in_bytes": 4940766037}, "en-es": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["en", "es"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "en-es", "version": {"version_str": "2018.0.0", "description": "", "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 5281909678, "num_examples": 61434251, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/en-es.txt.zip": {"num_bytes": 1888798249, "checksum": "e35e174b135b0fe2d48a0c9275dc456babd9732529e8de3d80141d241704e983"}}, "download_size": 1888798249, "post_processing_size": null, "dataset_size": 5281909678, "size_in_bytes": 7170707927}, "bs-eo": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["bs", "eo"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "bs-eo", "version": {"version_str": "2018.0.0", "description": "", "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 840882, "num_examples": 10989, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/bs-eo.txt.zip": {"num_bytes": 333050, "checksum": "47bad0c4bc1d63d10d601708ffaf637ee3eef1e289521cd009812e84ef338fbc"}}, "download_size": 333050, "post_processing_size": null, "dataset_size": 840882, "size_in_bytes": 1173932}, "fr-hy": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["fr", "hy"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "fr-hy", "version": {"version_str": "2018.0.0", "description": "", "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 109834, "num_examples": 668, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/fr-hy.txt.zip": {"num_bytes": 41861, "checksum": "2f1b42fc7b7856b466b73b02860f68e90ee4a12f3327e9114e87d26a9b5e77cd"}}, "download_size": 41861, "post_processing_size": null, "dataset_size": 109834, "size_in_bytes": 151695}, "da-ru": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["da", "ru"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "da-ru", "version": {"version_str": "2018.0.0", "description": "", "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 833254549, "num_examples": 7543012, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/da-ru.txt.zip": {"num_bytes": 267995167, "checksum": "c9fae94d519a6bd6374f1dea8550ba535cabfb3a4e8b92eeb5921e8981bde98a"}}, "download_size": 267995167, "post_processing_size": null, "dataset_size": 833254549, "size_in_bytes": 1101249716}, "en-hi": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["en", "hi"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "en-hi", "version": {"version_str": "2018.0.0", "description": "", "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 10820088, "num_examples": 93016, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/en-hi.txt.zip": {"num_bytes": 2967295, "checksum": "3e099b7738ec2fdcf47e6d7a4363b6435bf63a34f703168b086e742a8bc9f4ed"}}, "download_size": 2967295, "post_processing_size": null, "dataset_size": 10820088, "size_in_bytes": 13787383}, "bn-is": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "translation": {"languages": ["bn", "is"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "bn-is", "version": {"version_str": "2018.0.0", "description": "", "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 5096887, "num_examples": 38272, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/bn-is.txt.zip": {"num_bytes": 1411625, "checksum": "06ff1ed8e20cee1123046accb7e99f40ecf0263c2677b371a04ee80951c5a23f"}}, "download_size": 1411625, "post_processing_size": null, "dataset_size": 5096887, "size_in_bytes": 6508512}}
1
+ {"bs-eo": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "meta": {"year": {"dtype": "uint32", "id": null, "_type": "Value"}, "imdbId": {"dtype": "uint32", "id": null, "_type": "Value"}, "subtitleId": {"bs": {"dtype": "uint32", "id": null, "_type": "Value"}, "eo": {"dtype": "uint32", "id": null, "_type": "Value"}}, "sentenceIds": {"bs": {"feature": {"dtype": "uint32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "eo": {"feature": {"dtype": "uint32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}}, "translation": {"languages": ["bs", "eo"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "bs-eo", "version": {"version_str": "2018.0.0", "description": null, "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1204266, "num_examples": 10989, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/bs-eo.txt.zip": {"num_bytes": 333050, "checksum": "47bad0c4bc1d63d10d601708ffaf637ee3eef1e289521cd009812e84ef338fbc"}}, "download_size": 333050, "post_processing_size": null, "dataset_size": 1204266, "size_in_bytes": 1537316}, "fr-hy": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "meta": {"year": {"dtype": "uint32", "id": null, "_type": "Value"}, "imdbId": {"dtype": "uint32", "id": null, "_type": "Value"}, "subtitleId": {"fr": {"dtype": "uint32", "id": null, "_type": "Value"}, "hy": {"dtype": "uint32", "id": null, "_type": "Value"}}, "sentenceIds": {"fr": {"feature": {"dtype": "uint32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "hy": {"feature": {"dtype": "uint32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}}, "translation": {"languages": ["fr", "hy"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "fr-hy", "version": {"version_str": "2018.0.0", "description": null, "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 132450, "num_examples": 668, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/fr-hy.txt.zip": {"num_bytes": 41861, "checksum": "2f1b42fc7b7856b466b73b02860f68e90ee4a12f3327e9114e87d26a9b5e77cd"}}, "download_size": 41861, "post_processing_size": null, "dataset_size": 132450, "size_in_bytes": 174311}, "da-ru": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "meta": {"year": {"dtype": "uint32", "id": null, "_type": "Value"}, "imdbId": {"dtype": "uint32", "id": null, "_type": "Value"}, "subtitleId": {"da": {"dtype": "uint32", "id": null, "_type": "Value"}, "ru": {"dtype": "uint32", "id": null, "_type": "Value"}}, "sentenceIds": {"da": {"feature": {"dtype": "uint32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ru": {"feature": {"dtype": "uint32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}}, "translation": {"languages": ["da", "ru"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "da-ru", "version": {"version_str": "2018.0.0", "description": null, "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1082649105, "num_examples": 7543012, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/da-ru.txt.zip": {"num_bytes": 267995167, "checksum": "c9fae94d519a6bd6374f1dea8550ba535cabfb3a4e8b92eeb5921e8981bde98a"}}, "download_size": 267995167, "post_processing_size": null, "dataset_size": 1082649105, "size_in_bytes": 1350644272}, "en-hi": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "meta": {"year": {"dtype": "uint32", "id": null, "_type": "Value"}, "imdbId": {"dtype": "uint32", "id": null, "_type": "Value"}, "subtitleId": {"en": {"dtype": "uint32", "id": null, "_type": "Value"}, "hi": {"dtype": "uint32", "id": null, "_type": "Value"}}, "sentenceIds": {"en": {"feature": {"dtype": "uint32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "hi": {"feature": {"dtype": "uint32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}}, "translation": {"languages": ["en", "hi"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "en-hi", "version": {"version_str": "2018.0.0", "description": null, "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 13845544, "num_examples": 93016, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/en-hi.txt.zip": {"num_bytes": 2967295, "checksum": "3e099b7738ec2fdcf47e6d7a4363b6435bf63a34f703168b086e742a8bc9f4ed"}}, "download_size": 2967295, "post_processing_size": null, "dataset_size": 13845544, "size_in_bytes": 16812839}, "bn-is": {"description": "This is a new collection of translated movie subtitles from http://www.opensubtitles.org/.\n\nIMPORTANT: If you use the OpenSubtitle corpus: Please, add a link to http://www.opensubtitles.org/ to your website and to your reports and publications produced with the data!\n\nThis is a slightly cleaner version of the subtitle collection using improved sentence alignment and better language checking.\n\n62 languages, 1,782 bitexts\ntotal number of files: 3,735,070\ntotal number of tokens: 22.10G\ntotal number of sentence fragments: 3.35G\n", "citation": "P. Lison and J. Tiedemann, 2016, OpenSubtitles2016: Extracting Large Parallel Corpora from Movie and TV Subtitles. In Proceedings of the 10th International Conference on Language Resources and Evaluation (LREC 2016)\n", "homepage": "http://opus.nlpl.eu/OpenSubtitles.php", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "meta": {"year": {"dtype": "uint32", "id": null, "_type": "Value"}, "imdbId": {"dtype": "uint32", "id": null, "_type": "Value"}, "subtitleId": {"bn": {"dtype": "uint32", "id": null, "_type": "Value"}, "is": {"dtype": "uint32", "id": null, "_type": "Value"}}, "sentenceIds": {"bn": {"feature": {"dtype": "uint32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "is": {"feature": {"dtype": "uint32", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}}, "translation": {"languages": ["bn", "is"], "id": null, "_type": "Translation"}}, "post_processed": null, "supervised_keys": null, "builder_name": "open_subtitles", "config_name": "bn-is", "version": {"version_str": "2018.0.0", "description": null, "major": 2018, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 6371251, "num_examples": 38272, "dataset_name": "open_subtitles"}}, "download_checksums": {"https://object.pouta.csc.fi/OPUS-OpenSubtitles/v2018/moses/bn-is.txt.zip": {"num_bytes": 1411625, "checksum": "06ff1ed8e20cee1123046accb7e99f40ecf0263c2677b371a04ee80951c5a23f"}}, "download_size": 1411625, "post_processing_size": null, "dataset_size": 6371251, "size_in_bytes": 7782876}}
open_subtitles.py CHANGED
@@ -79,6 +79,18 @@ class OpenSubtitles(datasets.GeneratorBasedBuilder):
79
  features=datasets.Features(
80
  {
81
  "id": datasets.Value("string"),
 
 
 
 
 
 
 
 
 
 
 
 
82
  "translation": datasets.Translation(languages=(self.config.lang1, self.config.lang2)),
83
  },
84
  ),
@@ -100,21 +112,48 @@ class OpenSubtitles(datasets.GeneratorBasedBuilder):
100
  )
101
  ]
102
 
 
 
 
 
 
 
 
 
 
 
 
103
  def _generate_examples(self, datapath):
104
  l1, l2 = self.config.lang1, self.config.lang2
105
  folder = l1 + "-" + l2
106
  l1_file = _BASE_NAME.format(folder, l1)
107
  l2_file = _BASE_NAME.format(folder, l2)
 
108
  l1_path = os.path.join(datapath, l1_file)
109
  l2_path = os.path.join(datapath, l2_file)
110
- with open(l1_path, encoding="utf-8") as f1, open(l2_path, encoding="utf-8") as f2:
111
- for sentence_counter, (x, y) in enumerate(zip(f1, f2)):
 
 
 
112
  x = x.strip()
113
  y = y.strip()
 
 
 
 
 
 
114
  result = (
115
  sentence_counter,
116
  {
117
  "id": str(sentence_counter),
 
 
 
 
 
 
118
  "translation": {l1: x, l2: y},
119
  },
120
  )
79
  features=datasets.Features(
80
  {
81
  "id": datasets.Value("string"),
82
+ "meta": {
83
+ "year": datasets.Value("uint32"),
84
+ "imdbId": datasets.Value("uint32"),
85
+ "subtitleId": {
86
+ self.config.lang1: datasets.Value("uint32"),
87
+ self.config.lang2: datasets.Value("uint32"),
88
+ },
89
+ "sentenceIds": {
90
+ self.config.lang1: datasets.Sequence(datasets.Value("uint32")),
91
+ self.config.lang2: datasets.Sequence(datasets.Value("uint32")),
92
+ },
93
+ },
94
  "translation": datasets.Translation(languages=(self.config.lang1, self.config.lang2)),
95
  },
96
  ),
112
  )
113
  ]
114
 
115
+ @classmethod
116
+ def _extract_info(cls, sentence_id):
117
+ # see https://github.com/huggingface/datasets/issues/1844
118
+ # sentence ids have the following format: en/2017/7006210/7050201.xml.gz
119
+ # lang/year/imdb_id/opensubtitles_id.xml.gz
120
+ parts = sentence_id[: -len(".xml.gz")].split("/")
121
+ parts.pop(0) # remove lang, we do not need it
122
+
123
+ # returns year, imdb_id, opensubtitles_id
124
+ return tuple(map(int, parts))
125
+
126
  def _generate_examples(self, datapath):
127
  l1, l2 = self.config.lang1, self.config.lang2
128
  folder = l1 + "-" + l2
129
  l1_file = _BASE_NAME.format(folder, l1)
130
  l2_file = _BASE_NAME.format(folder, l2)
131
+ ids_file = _BASE_NAME.format(folder, "ids")
132
  l1_path = os.path.join(datapath, l1_file)
133
  l2_path = os.path.join(datapath, l2_file)
134
+ ids_path = os.path.join(datapath, ids_file)
135
+ with open(l1_path, encoding="utf-8") as f1, open(l2_path, encoding="utf-8") as f2, open(
136
+ ids_path, encoding="utf-8"
137
+ ) as f3:
138
+ for sentence_counter, (x, y, _id) in enumerate(zip(f1, f2, f3)):
139
  x = x.strip()
140
  y = y.strip()
141
+ l1_id, l2_id, l1_sid, l2_sid = _id.split("\t")
142
+ year, imdb_id, l1_subtitle_id = self._extract_info(l1_id)
143
+ _, _, l2_subtitle_id = self._extract_info(l2_id)
144
+ l1_sentence_ids = list(map(int, l1_sid.split(" ")))
145
+ l2_sentence_ids = list(map(int, l2_sid.split(" ")))
146
+
147
  result = (
148
  sentence_counter,
149
  {
150
  "id": str(sentence_counter),
151
+ "meta": {
152
+ "year": year,
153
+ "imdbId": imdb_id,
154
+ "subtitleId": {l1: l1_subtitle_id, l2: l2_subtitle_id},
155
+ "sentenceIds": {l1: l1_sentence_ids, l2: l2_sentence_ids},
156
+ },
157
  "translation": {l1: x, l2: y},
158
  },
159
  )