Semantic analysis of assurance standards
Finding semantic overlap across standards, before ChatGPT.
Topic models showed that a set of assurance frameworks shared themes. Stakeholders needed to know which passages overlapped. Hamza moved the analysis to passage-level semantic matching with open-source transformer models, and delivered it as reports people could check line by line.
- Role
- Data scientist, natural language processing
- Engagement
- GoSource Australia, through Upwork · Jun 2021 – Jan 2022
- Stack
- Python · LDA topic modelling · Sentence-transformers · PyTorch · pandas · Google Colab · Google Drive · Excel · Matplotlib · Plotly
The problem
Assurance frameworks and standards often cover the same ground in different words, and sometimes in nearly the same words. Stakeholders needed to see where those overlaps were. Comparing documents by hand, passage against passage, was slow and painstaking.
First attempt: topic modelling
The first approach used classical topic modelling, including Latent Dirichlet Allocation (LDA). It surfaced the themes the documents shared.
But a theme is not an answer. Stakeholders could see that topics overlapped and still could not tell which requirement in one standard corresponded to which in another. The presentation drew little actionable feedback.
The decision: compare meaning, passage by passage
In 2021, before ChatGPT’s public release, open-source transformer models could already represent the meaning of a passage as a vector, a sentence embedding, on modest hardware.
Hamza adapted existing sentence-transformer models to the problem, so passages could be matched by meaning even when their wording differed. The models were applied and adapted, not trained from scratch.
First attemptThemes, not passages
Documents
Assurance frameworks
LDA
Topic modelling
Result
Shared themes
But which passages overlap?
Compare meaning, passage by passage
Passage-level semantic matchingOpen-source transformer models, applied and adapted
Google Drive
Documents
Extract
Text
Segment
Passages
Source and position kept
Embed
Sentence-transformers
Match
Similar meaning
Excel
Matched-passage reports
Report layoutSchematic, not project output
Passage in standard A
Closest passages in standard B
The pipeline
Ingest
Framework documents were loaded from the team’s Google Drive workspace and their text extracted.
Segment
Each document was split into paragraphs or passages, keeping the source document and position of every passage.
Embed
Sentence-transformer models turned each passage into an embedding, handled as tensors with PyTorch-based tooling.
Match
Embeddings were compared across standards to find candidate passages with related meaning, including passages phrased quite differently.
Report
Results were written to Excel workbooks in the same Drive workspace, showing each passage beside its closest counterparts in the other standards.
The breakthrough was the report
Abstract topics had asked stakeholders to trust the model. The workbooks let them read the matching language themselves and judge whether an overlap was significant.
In some cases the matches revealed very similar, apparently repeated wording across standards. Similarity marks passages for a person to compare; it does not by itself establish where wording came from.
The outcome
- An inspectable, repeatable comparison workflow, run from a Google Colab notebook
- Hamza recalls a run taking roughly 15 to 30 minutes for a directory of documents, depending on the dataset
- Results stakeholders could read and act on, where the topic-model presentation had drawn little feedback
What it shows
Machine-learning output becomes valuable when the people it serves can read it, check it and act on it. The same principle runs through source-verifiable AI at CaseOps.
Client reviews
The client’s review of the engagement, in full.
Data Scientist for Computational Linguistics / NLP of Assurance Frameworks
Upwork contract · Jun 2021 – Jan 2022
- Contract earnings
- $45.7K ($45,708.32 earned)
- Hours worked
- 874
- Engagement
- 7 months
“Everything you want from a technologist.”