from prepline_sec_filings.sec_document import SECDocument, SECSection
from prepline_sec_filings.fetch import get_form_by_ticker
text = get_form_by_ticker(
'rgld',
'10-K',
company='<your-name-or-org>',
email='<your-email>'
)
doc = SECDocument.from_string(text)
risk_section = doc.get_section_narrative(SECSection.RISK_FACTORS)
Next, we’ll use the stage_for_label_studio staging brick to get the data ready for upload.
import json
from unstructured.staging.label_studio import stage_for_label_studio
label_studio_data = stage_for_label_studio(risk_section, text_field="text", id_field="id")
# The resulting JSON file is ready to be uploaded to LabelStudio
with open("label_studio.json", "w") as f:
json.dump(label_studio_data, f, indent=4)
Upload Data
choose text classification
Now you are ready to label data!