Add keep_linebreaks parameter to text loader
{'login': 'lhoestq', 'id': 42851186, 'node_id': 'MDQ6VXNlcjQyODUxMTg2', 'avatar_url': 'https://avatars.githubusercontent.com/u/42851186?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/lhoestq', 'html_url': 'https://github.com/lhoestq', 'followers_url': 'https://api.github.com/users/lhoestq/followers', 'following_url': 'https://api.github.com/users/lhoestq/following{/other_user}', 'gists_url': 'https://api.github.com/users/lhoestq/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/lhoestq/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/lhoestq/subscriptions', 'organizations_url': 'https://api.github.com/users/lhoestq/orgs', 'repos_url': 'https://api.github.com/users/lhoestq/repos', 'events_url': 'https://api.github.com/users/lhoestq/events{/privacy}', 'received_events_url': 'https://api.github.com/users/lhoestq/received_events', 'type': 'User', 'site_admin': False}
[]
[]
['Just so I understand how it can be used in practice, do you have an example showing how to load a text dataset with this option?'
 'Sure ! Here is an example:\r\n```python\r\nfrom datasets import load_dataset\r\n\r\nload_dataset("text", keep_linebreaks=True, data_files=...)\r\n```\r\n\r\nI\'ll update the documentation to explain this'
 'Perfect!']
{'url': 'https://api.github.com/repos/huggingface/datasets/pulls/1913', 'html_url': 'https://github.com/huggingface/datasets/pull/1913', 'diff_url': 'https://github.com/huggingface/datasets/pull/1913.diff', 'patch_url': 'https://github.com/huggingface/datasets/pull/1913.patch', 'merged_at': datetime.datetime(2021, 2, 19, 18, 36, 11)}
As asked in #870 and https://github.com/huggingface/transformers/issues/10269 there should be a parameter to keep the linebreaks when loading a text dataset.
cc @sgugger @jncasey
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/1913/reactions', 'total_count': 1, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 1, 'rocket': 0, 'eyes': 0}