flow_inference.write_inference_to_raw_xml.InferenceToRawXMLWriter
- class flow_inference.write_inference_to_raw_xml.InferenceToRawXMLWriter(raw_xml_repo, inference_repo, token, allow_source_repo_update=False)[source]
Write inference output into raw XML records and upload the result.
The writer downloads a raw XML dataset and an inference result dataset from the Hugging Face Hub, builds a lookup from line identifiers to inferred text, inserts the text into matching XML records, and writes the updated data to a new or existing target dataset repository.
- __init__(raw_xml_repo, inference_repo, token, allow_source_repo_update=False)[source]
Initialize the raw XML writeback pipeline.
- Parameters:
raw_xml_repo (
str) – Source Hugging Face dataset repository containing raw XML records.inference_repo (
str) – Source Hugging Face dataset repository containing inference results.token (
str) – Hugging Face token used for downloading and uploading datasets.allow_source_repo_update (
bool) – Whether writing back into the raw XML source repository is allowed.
Methods
__init__(raw_xml_repo, inference_repo, token)Initialize the raw XML writeback pipeline.
process_and_upload([output_repo, ...])Run the raw XML writeback pipeline and upload the result.