# tff.simulation.datasets.stackoverflow.load_word_counts

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |

Loads the word counts for the Stack Overflow dataset.

    tff.simulation.datasets.stackoverflow.load_word_counts(
        cache_dir=None, vocab_size: Optional[int] = None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `cache_dir` | (Optional) directory to cache the downloaded file. If `None`, caches in Keras' default cache directory. |
| `vocab_size` | (Optional) when specified, only load the first `vocab_size` unique words in the vocab file (i.e. the most frequent `vocab_size` words). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A collections.OrderedDict where the keys are string tokens, and the values are the counts of unique users who have at least one example in the training set containing that token in the body text. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| TypeError if vocab_size is not None or int. ValueError if vocab_size is not None but \<= 0. ||

<br />