# Wikipedia dataset Wikipedia dataset from HTML. ## Process and load the dataset Process and load the dataset using streaming: ```python from datasets import load_dataset ds = load_dataset( "wikimedia/wikipedia", revision="script-html", language="ca", split="train", trust_remote_code=True, storage_options={"https": {"client_kwargs": {"headers": {"Authorization": f"Bearer {auth['access_token']}"}}}}, streaming=True, ) item = next(iter(ds)) item ``` Note that you need to authenticate first. See Authentication section below. ## Authentication Wikimedia Enterprise API requires authentication credentials. See information here: https://enterprise.wikimedia.com/docs/#getting-started 1. If you do not already have an account, signup: https://enterprise.wikimedia.com/signup/ 2. Write your Wikimedia Enterprise username and password in the `.env` file: ``` WME_USERNAME= WME_PASSWORD= ``` 3. Get your authentication tokens: ```python import requests from dotenv import dotenv_values config = dotenv_values(".env") r = requests.post( "https://auth.enterprise.wikimedia.com/v1/login", headers={"Content-Type": "application/json"}, json={ "username": config["WME_USERNAME"], "password": config["WME_PASSWORD"], } ) auth = r.json() ``` 4. Now you can use your access token (`auth["access_token"]`) to authenticate: ```python storage_options={ "https": { "client_kwargs": { "headers": { "Authorization": f"Bearer {auth['access_token']}" } } } } ```