How do I ner.print-stream on synthetic training data?

Thanks. I ended up writing this.

import prodigy
from prodigy.components.printers import pretty_print_ner
from prodigy.core import recipe, recipe_args
from prodigy.components.loaders import get_stream

@prodigy.recipe('ner.print-stream')
def print_stream(source=recipe_args['source']):
    stream = get_stream(source, rehash=True, input_key='text')
    pretty_print_ner(stream)
1 Like