🧾 Extract Structured Transition Triplets from DOCX Files
We are hiring a developer to build a Streamlit application that extracts structured examples of transition phrases from .docx documents containing regional French news articles. These transitions are short, context-appropriate phrases that connect ideas between paragraphs. The goal is to automatically extract them along with their surrounding context and format them as clean, structured datasets for downstream analysis and AI fine-tuning.
Each article follows a consistent and predictable structure:
A header line (number and date)
Title and a short blurb
A marker line: "À savoir également dans votre département"
One long narrative paragraph containing embedded transitions
A final list of 2–3 transitions used within that paragraph
Your task is to focus only on the long narrative paragraph (step 4) and extract 2–3 clean triplets formatted as:
paragraph_a (text before the transition)
transition (the phrase as it appears in the list)
paragraph_b (text following the transition)
This structure will be used to build:
fewshot_examples.json (with paragraph_a, transition, paragraph_b objects, capped at 3 uses per transition)
transitions_only.txt (unique transitions only)
fewshot_examples.jsonl (fine-tuning format with role:user, role:assistant style entries)
and additional .txt files that list duplicates beyond the usage cap
The app must allow:
Upload of a .docx file
Selection of which outputs to generate (not all at once)
Local saving of the output files
Display of how many valid examples were extracted
To guide your implementation, you are provided with two reference files:
word10.docx: a sample input with ~10 articles and 24 expected examples
ccm_raw_paragraphs_dump.txt: a structured version of the same document, where every paragraph is numbered. This helps clarify how the transitions in paragraphs 7–10 relate to the narrative block in paragraph 6, then 17–20 to 16, and so on. This pattern remains consistent across all documents in the project.
Application Requirements:
To be considered for this job, please submit the following:
A working Streamlit demo (link or .py file)
At least 20 extracted examples from word10.docx showing clean paragraph-transition-paragraph triplets
A clear UI that allows output selection
Confirmation that outputs are saved locally as described
This project is the foundation for a much larger AI-based system we are developing for editorial automation. A successful result here could lead to multiple follow-on projects.
A full job description with more detailed formatting rules and two example outputs (from paragraph 6 and 16) is included in the attached PDF: this document outlines exactly what is expected in terms of logic, layout, and transition matching.
We look forward to reviewing your application.