To generate the suggestions there's an active learner with an underlying random forest classifier, that has been fed ~60 seed sentences [1], to classify positive sentences (e.g. contains a prescription) and negative sentences (e.g. doesn't contain a prescription).
All positive sentences are fed into a sequence-to-sequence RNN, that has been trained on ~50k synthetic rows of data [2] which maps unstructured sentences (e.g. patient is on pheneturide 250mg twice a day) to a structured output with the desired features (e.g. name: pheneturide; dose: 250; unit: mg; frequency: 2). The synthetic data was generated using Markup's in-built data generator [3].
The outputs of the RNN are validated to ensure they meet the expected structure and are valid for the sentence (e.g. the predicted drug name must exist somewhere within the original sentence).
All non-junk predictions are shown to the user who can accept, edit, or reject each. Based on the users' response, the active learner is refined (currently nothing is fed back into the RNN).
[1] https://github.com/samueldobbie/markup/blob/master/data/text...
[2] https://raw.githubusercontent.com/samueldobbie/markup/master...