Pharmex Walkthrough

This is a walk through the Pharmex Red-Pencil Inspector. I'll explain the controls as we come to them. You can open the Inspector in another tab and try things for yourself. Following the walkthrough is a good way to explain the Inspector to someone else.

On this page

The red-pencil metaphor

Imagine an editor sitting at a desk with an advertisement and a red pencil. They circle an extravagant claim, perhaps draw a line to an annotation in tiny print at the bottom, and write a note explaining the problem. That is the idea behind Pharmex. The notes and annotations might be particular kinds of problem, such as misleading science or unsafe-sounding ingredients; how these relate to regulatory compliance; or recommendations on how to resolve matters.

Projects, adverts, and images

Like many interfaces, Pharmex is organised around projects. Each project contains related adverts, stored as PNG or JPG images in their own directory. We use images because we want to examine pictures, layout and typography as well as words. In this prototype, I have provided the images; where text files were to be examined, I converted them. In a commercial product, we would automate the conversion.

Current projects

There are eleven at present, containing 48 images in all. Some are ordinary-looking adverts; others are deliberately peculiar test cases.

ProjectContents
arthrinovaTwo versions of a mock advert, testing the Inspector's treatment of scientific claims, evidence and safety concerns.
bluenovaA supplement mock advert with elaborate but dubious biology.
cattoMock cat-food adverts. How will the Inspector handle claims about non-human nutrition and safety?
clientPairs of mock adverts, based on material provided by the client. I prepared versions with and without additional disclosures, so we can compare how the analysis responds to their presence.
latinLorem Ipsum, and two paragraphs from a Latin medical text. Tests how the Inspector handles gibberish, edge-case documents, and foreign-language text.
megavitSeveral versions of the same supplement mock advert. Their text varies in quality, testing the Inspector's responses to both acceptable and unacceptable claims and warnings.
miscMiscellaneous material, including an image called airmail_news and the NovaRex example.
serenitolA mock mood-support supplement advert.
tokalonA genuine cosmetics advert from a 1949 leisure magazine, making remarkable claims.
van_kleurSome of my political cartoons. These test the Inspector's handling of non-pharmaceutical material, some of which portrays viruses and other objects associated with Covid. One cartoon depicts a chef sneezing into a pan of soup: the analysis recognises that it is not a pharmaceutical advert, but identifies a safety concern in the depicted situation. The cartoons are almost entirely drawing rather than text, so also check the Inspector's image comprehension.
vitalinSupplement mock adverts, one very extravagant, with a mixture of sound and unsound claims.

Why this mixture? Some projects test what the Inspector can find. The cartoons, Latin and other items test whether it knows when not to find anything. A system which objects to every picture or sentence is not useful.

Choosing a project

Open the Inspector. At the top is a Project menu. Choose a project, or choose All projects to see the full collection. Small pictures with filenames then appear. This is the project's gallery.

Opening an advert

Click one of the pictures. The advert appears bigger, with the analysis alongside it. The page also shows the document's title or product name, a short summary where one is available, and a list of findings.

Moving between adverts

← Gallery returns to the thumbnails. ← Previous and Next → move between images. Open original opens the unmarked image in another browser tab.

Enlarging an image

Enlarge marked image ↗ opens a larger view showing the Inspector's markings. In the separate original-image tab, most browsers also let you click to zoom in or out.

Our analyses

The analysis treats the advert as a surface on which our editor can mark regions and write comments. It records what is questionable, where to look, and what might be changed. It is an aid to editorial and regulatory review, not a legal verdict. If any legal action is contemplated as a result, discuss it with a legal professional.

Now walk through the projects, looking at each advert, and skim its findings. This will give you a good idea of what material the Inspector is intended for, what it will report, and how it does so.

Findings

We call each issue a finding. Choose one from the Findings list. Its marked locations are outlined on the advert, and its description, scores and recommendation appear in the detail panel.

One finding may have several marked locations. For example, an impressive promise at the top and a half-hidden qualification at the bottom may be parts of the same problem. A finding is an editorial issue, not merely a rectangle.

If an image has no findings, that is worth noticing too: it may be one of our negative controls.

The six scores

Each finding is assessed on whichever of six characteristics are relevant. Scores run from 0 to 1, indicating how strongly the characteristic is present. They do not by themselves measure illegality, danger, or overall seriousness.

The word dodginess is deliberate. Imagine an enthusiastic salesman whose claims have run ahead of his evidence. British readers should think of Del Boy or Steptoe and Son. For Canadians, I am told that the word may best translate as sketchiness.

Science and evidence

SD — Scientific Dodginess. Is the science itself implausible or wrong? A supposed biological mechanism may sound wonderful without having much connection to biology.

TATD — Testing and Trialling Dodginess. Even when the underlying science is respectable, has this particular product been tested adequately? A claim about an ingredient is not automatically evidence about every product containing it.

CD — Teilhard de Chardin Dodginess. This is named after Peter Medawar's criticism of Pierre Teilhard de Chardin’s book The Phenomenon of Man. Words such as energy, force and dimension can be borrowed from science, used loosely, but still retain a (misleading) air of scientific authority.

Pictures

VP — Vitality Projection. Sunlight, greenery, smiling athletes and mountains may suggest health and renewal without saying so explicitly. That isn't automatically a problem, but it may contribute to one.

Safety

SC — Safety Concern. Possible adverse effects, unsafe combinations, contraindications and similar matters. A concern is a reason to investigate, not necessarily a proven hazard.

RM — Risk Minimisation. Does the advert play down a risk? The problem might lie in tiny print, reassuring words, an inconspicuous warning, or the relationship between passages far apart.

BlueNova

As an example of scores, go to the BlueNova project. Click the project selector to get there, then click on the image. This project has only one.

Then, if you need to see the image larger, press the button beneath it, or the Open Original button above. Take a good look at the text and pictures.

What's in a finding?

After that, focus on the reporting to the right of the advert. Scroll through the list of findings. There are currently eight. Click each item in the list, and see the text that appears to its right.

Notice that, for instance, finding m01 says "MOPS UP FREE RADICALS". It has been given an SD of 0.7 and a TATD of 0.88.

Description

The right-hand column gives more information. It starts with a detailed description:

The advertisement presents free-radical neutralisation as a demonstrated protective effect inside the consumer's body. Anthocyanins can exhibit antioxidant activity, but laboratory antioxidant behaviour does not by itself establish that consuming this particular supplement will intercept harmful radicals before cellular damage occurs.

Marked locations

After this are the texts from three locations. They demonstrate our point made earlier that an impressive promise at the top and a qualification at the bottom may be parts of the same problem. A finding is an editorial issue that may span several regions, not merely a rectangle.

Our texts for finding m01 are:

Assessments: scores and reasons

Under this list of marked locations are the scores for this finding, and the reasons for them.

Thus, the finding is given:

These are the AI's assessments of the material, not the results of an independent search of the clinical literature.

Review indicators: Fuzzy logic for regulatory compliance

Having assessed a finding on the six characteristics, we want to see how its scores might relate to regulatory compliance. We use fuzzy-logic rules for this. The concept is explained in our About fuzzy logic page. The fuzzy-logic output, where available, appears under the heading Review indicators in the right-hand column. The following explains how to read the inference display. The precalculated results are being integrated and tested in the release.

Briefly stated, fuzzy logic is a way to reason with variables that are vague, imprecise, or without sharp boundaries. In the everyday world, examples include "tall", "young", "high", "round", "aquatic". A hippo may not be 100% aquatic, but it's more aquatic than a seagull, and less aquatic than a cod.

Cartoon of a hippo, cod and seagull comparing how aquatic they are.

Fuzzy logic's results

In the pharmaceutical world, scientific dodginess and our other scoring variables are likewise vague, imprecise, or without sharp boundaries. Indeed, this is why we use fuzzy logic. As About fuzzy logic explains, we use fuzzy-logic rules as a "quick start" or "agile" rule-scripting language. Our prototype contains a knowledge base that uses a finding’s scores to infer three new variables. These variables are: misleading_claim_concern; risk_minimisation_concern; and review_priority.

The knowledge base

At this stage, you may want to read our knowledge base, in conjunction with About fuzzy logic.

You do not need to understand these rules in full detail to use the system. Reading them as if they were English will give sufficient idea of what they do.

How we handle missing scores

Not every characteristic is relevant to every finding, so the analysis need not supply all six scores. For example, the BlueNova lady, glowing in the mountain sunlight, has a high VP (Vitality Projection), but no SD (Scientific Dodginess) rating.

One way that analysts handle this is to impute values, using — say — a default of 0. This is a quick fix, but not obviously correct. Other methods exist, but can be equally misleading. In general, handling missing values needs careful statistical analysis, and demands close analysis of the problem. It is important to know which variables are causally related, and which may merely be correlated for other reasons.

For the prototype, I use a simple form of sensitivity analysis. We can think of the fuzzy rules as taking six scores and producing three review indicators. The numerical inputs and outputs range from 0 to 1, though some outputs may be unavailable.

If one of the inputs is missing, rather than guessing its value, we try several possibilities: 0, 0.5, and 1. We run the rules once for each possibility. With two missing inputs, we try all 9 combinations; with three, all 27. We call these complete sets of inputs completions. If no scores have been supplied at all, we do not run the rules.

For each regulatory indicator, we calculate the minimum, maximum and average of the available numerical results. This doesn't tell us what the missing scores really were. But it gives us an idea of how much difference they could make to the conclusions. The minimum and maximum are over the sampled combinations that produce numerical results, and the average is not a probability-weighted estimate.

Sometimes the rules cannot produce a numerical result for one of the indicators. We keep any valid results for the other indicators. The revised display is designed to show how many results are available, and to distinguish unavailable results from calculations not yet attempted. If there are no numerical results for an indicator, the revised display shows it as unavailable, rather than zero. The fewer results we have, the more cautiously we should interpret the statistics.

Rule traces

As we said several sections back, the fuzzy-logic results, when available, appear in the Review indicators section of the right-hand column. This is the one we are currently explaining, under the headings for Finding, Marked locations, and Assessments. It has subsections for the three output variables: Misleading-claim concern, Risk-minimisation concern, and Review priority. Each subsection reports the minimum, maximum and average of its results.

Under these subsections is a disclosure control labelled Input completions and inference traces. This shows which rules fired for each combination of inputs.

For example, in the first recorded Version 2 completion for BlueNova finding m01, SD is 0.7, TATD is 0.88, and the four unassessed inputs are set to zero. The non-zero rule firings for Misleading-claim concern are:

SD medium → medium concern (strength 0.33)
TATD high → high concern (strength 0.60)
CD low → low concern (strength 1.00)

The key point here is that the trace explains the inference results. One of the product's selling points is that the rule-based part of its reasoning can be inspected. An editor or manager can examine which rules contributed to a result, and question the assessments and rules themselves. A trace explains a calculation; it does not in itself establish that a conclusion is correct.

Recommendations

This has been a long section on fuzzy logic and its outputs. To recap, we have worked through the details of BlueNova finding m01, looking, in the finding's right-hand column, at the headings for Finding, Marked locations, Assessments, and Review Indicators. Under this appears the subsection Recommendation, which is where we look now.

A recommendation is what our imaginary editor would write with their red pencil. Perhaps the claim needs supporting evidence, a warning needs to be more prominent, or a sentence needs rewriting. In our m01 case, the recommendation is:

Replace the asserted bodily protection mechanism with a narrower, scientifically supportable statement about anthocyanins. Retain any product-specific protective claim only if appropriately substantiated in humans.

More on BlueNova, and Vitalin

This has been a long trek through one particular finding. We recommend that you take a break, then check the other BlueNova findings. Once you've done that, do the same with the first, extravagant, Vitalin advert.

After that, try with some of the other projects. I recommend Megavit, because it gives a series of adverts with the same picture and layout, but texts deliberately designed to evoke low versus high scores. All the adverts mentioned in this section are useful when demonstrating the system to other people, as they don't need much specialist knowledge.

Exporting data

There are four more controls to mention. The first two are Download readable CSV and Download complete CSV. They generate CSV files which can be opened in Excel or used for other automated processing.

Download readable CSV produces a CSV or comma-separated values file which can be read into Excel, summarising the findings and assessments. A finding with several assessments appears on several rows.

Download complete CSV produces a more technical table including data paths, types and values. The complete export traverses the analysis data. It is intended for automated processing; the readable export is intended as a more concise account.

Exporting a report

Export HTML report saves a report which can be opened in a browser and passed to somebody else. It includes the advert and its recorded red-pencil analysis, without requiring the recipient to navigate the Inspector.

Export Word report saves a Word document containing the advert and its analysis, for reading, editing or circulation. The report exports contain the red-pencil analysis. The addition of formatted inference summaries to the readable CSV, HTML and Word reports is a further integration step.