Stream Doc objects from DocBin.
(path: Path, vocab: Vocab)
| 35 | |
| 36 | |
| 37 | def _stream_docbin(path: Path, vocab: Vocab) -> Iterable[Doc]: |
| 38 | """ |
| 39 | Stream Doc objects from DocBin. |
| 40 | """ |
| 41 | docbin = DocBin().from_disk(path) |
| 42 | for doc in docbin.get_docs(vocab): |
| 43 | yield doc |
| 44 | |
| 45 | |
| 46 | def _stream_jsonl(path: Path, field: str) -> Iterable[str]: |