Abstract
We explore the benefit that users in several application areas can experience from a "tab-complete" editing assistance function. We develop an evaluation metric and adapt N-gram language models to the problem of predicting the subsequent words, given an initial text fragment. Using an instance-based method as baseline, we empirically study the predictability of call-center emails, personal emails, weather reports, and cooking recipes.
Introduction
In the context of modern writing assistance, predicting the remainder of a sentence remains a significant challenge. This paper explores the feasibility of "tab-complete" functionality for full sentences, aiming to help users speed up repetitive writing tasks like answering customer emails. The core challenge lies in the user experience trade-off: while accurate suggestions save time, incorrect ones distract the writer and incur a time penalty for rejection. We bridge the gap between raw language modeling and practical assistance by developing evaluation metrics that quantify the trade-off between keystroke savings and unnecessary distractions.
Methodology
We compared two primary approaches for sentence completion:
- Interpolated N-Gram Models: A mixture of N-gram models (up to $N=5$) was used, with weights optimized via an Expectation-Maximization (EM) algorithm. To find the most likely completion efficiently, we implemented a Viterbi beam search, allowing for real-time decoding.
- Instance-Based Baseline: A "nearest neighbor" approach that finds the most similar fragment in the training data using TFIDF and cosine similarity, suggesting the remainder of that historical sentence.
A critical component of our system is the confidence threshold ($\theta$). Suggestions are only presented if their probability exceeds this threshold. Furthermore, we employed a "harsh" evaluation metric: if any part of a suggested sentence is incorrect, the entire suggestion is treated as a failure, reflecting the reality that editing a bad suggestion often takes longer than typing from scratch.
Experimental Setup
The study evaluated four distinct document collections to test how domain-specific repetitiveness affects performance:
- Service Center Emails: Highly repetitive German-language customer service replies.
- Enron Emails: Highly idiosyncratic English-language personal emails.
- Weather Reports: Thematically consistent German-language reports.
- Cooking Recipes: Thematically related but diverse German-language recipes.
Results and Analysis
Our findings reveal a direct inverse relationship between a dataset's entropy (unpredictability) and system performance. The service center emails, having the lowest entropy (1.41 bits), yielded the best results. In contrast, the high-entropy Enron emails (7.17 bits) were nearly impossible to predict accurately.
In the service center domain, the N-gram model achieved 60% keystroke savings at 85% precision. Even with a demand for 95% precision, the system still saved 40% of keystrokes. The N-gram model consistently outperformed the instance-based method, which saw sharp precision drops as suggested completions grew longer. For personal emails, the benefit was marginal, with less than 1% keystroke savings at 60% precision, highlighting that "tab-complete" is most effective for professional, repetitive tasks.
Conclusion and Future Work
While N-gram models with Viterbi decoding provide an efficient and high-precision solution for predictable domains, several limitations remain. Our evaluation assumes uniform user behavior, whereas actual benefit is subjective. Future work should explore adaptive models that learn a user's specific style in real-time and investigate the UI/UX implications of how suggestions are presented to the writer.
Summary updated