sparknlp.pretrained.utils#

Contains utilities for pretrained annotators and pipelines.

Module Contents#

Classes#

DownloadProgress

Draws progress for one pretrained download by polling the JVM's byte counters.

Functions#

printProgress(stop)

Prints a spinner until stop() returns True.

printProgress(stop)[source]#

Prints a spinner until stop() returns True.

Deprecated: downloads report byte-accurate progress through DownloadProgress. Kept so code that imports it from earlier releases keeps working.

class DownloadProgress(spark_context, stream=None, tracker=None)[source]#

Draws progress for one pretrained download by polling the JVM’s byte counters.

pyspark starts the JVM with a piped stdin, so the JVM never detects a terminal and cannot pick a style for the user’s screen. Python can, so in a Python session Python draws and asks the JVM to stay quiet until the download ends.

Degrades to silence rather than failing: an older jar without these methods, or any py4j error, just means no progress. It is decoration and must never break a download.