medspacy.io.pipeline
Pipeline
The Pipeline class executes a batch process of reading texts, processing them with a spaCy model, and writing the results back to a database.
Source code in medspacy/io/pipeline.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
__init__(nlp, reader, writer, name='medspacy_pipeline', dtype='ent')
Create a new Pipeline object. Args: reader: A DbReader object writer: A Dbwriter object nlp: A spaCy model dtype: The DocConsumer data type to write to a database. Default "ent Valid options are ("ent", "section", "context", "doc")
Source code in medspacy/io/pipeline.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
process()
Run a pipeline by reading a set of texts from a source table, processing them with nlp, and writing doc._.data back to the destination table.
Source code in medspacy/io/pipeline.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |