This doc to instance conversion happens both here and in the training loop. If you refactor it into a function, you're able to give it a name like `extract_instance(doc, positive_class)`, and avoid potential bugs due to discrepancies between train and test implementations.

Also, it allows you to use:
```python
test_examples = [extract_instance(doc, positive_class)
                 for doc in islice(data_streamer, N_TEST)
                 if validate_doc(doc)]
```
which I find much more straightforward to read.