4. Learning Embedded Classifiers

5. Contextual Prompting

In the prompting mode, the software continuously predicts a likely completion as the user writes out a note. It presents this as a default next to the completion button. The button's saturation ranges from white to green in proportion to the confidence of the prediction. If the user taps the completion button, the prompt text is inserted at the end of the current note.

A completion is generated by parsing the tokens already written by the user, finding the last state visited in the FSM, and predicting the next most likely transition (or termination). This process is repeated until a stopping criterion is satisfied, which is discussed below. If the last token written by the user is incomplete, matching only a prefix of a state's transition, then the remainder of that transition is predicted. If the last token matches more than one transition, a generalized string is predicted using special characters to indicate the type and number of characters expected. If a digit is expected, a "#" is included; if a letter, an "a" is included; if either are possible, a "?" is included; and if some transition's tokens are longer than others, a "..." is appended to the end. For example, if the user has written "4096K PowerBook 1", the possible values for PowerBook models of "100", "140", "160C", and "170" are generalized, and the prompt is "#0...".

A simple calculation is used to compute the confidence of the prediction and set the button's color saturation. It is the simple ratio

f(prediction) / [ f(total) * (1 + skipped) ]

where f(prediction) is the frequency of the predicted arc (or terminate) [i.e., the number of times this choice was taken while parsing previously observed notes], f(total) is the total frequency of all arcs (and terminate), and skipped is the number of tokens skipped during heuristic parsing (cf. Section 3.3, Parsing). Confidence is directly proportional to the simple likelihood of the prediction and is degraded in proportion to the number of tokens the FSM had to skip to get to this point. This information is used in a simple way, so it is unclear if more sophisticated measures are needed.

The stopping criterion is used to determine how much of a prompt to offer the user. At one extreme, only a single token can be predicted. This gives the user little context and may not provide much assistance. At the other extreme, a sequence of tokens that completes the note can be predicted. This may be too lengthy, and the user would have to edit the prompt if selected. The stopping criterion in Table 4 balances these two extremes and attempts to limit prompts to a consistent set of tokens. In particular, Condition 3 stops expanding the prompt upon reaching a syntactic boundary (leading punctuation) or upon reaching a semantic boundary (falling confidence).


Stop expanding the prompt if any of the following are true:
  1. The next prediction is to terminate; or
  2. The next prediction is a generalized string; or
  3. At least one token has already been predicted and
     a. The prediction starts with punctuation, or
     b. The confidence of the prediction is lower; or
  4. The next prediction is the same as the last prediction; or
  5. More than 10 tokens have already been predicted.

Table 4: Stopping criterion for contextual prompting.

6. Constructing a Button-Box Interface