Overview

Autocomplete suggestions (beta) was rolled out as a part of the WebSpellChecker v5.15.0 release. The feature automatically completes the user’s thought by suggesting the next word or a short phrase based on the context. 

The brand new functionality is implemented and added to WProofreader-based products (on-premise and cloud versions) in the turned OFF state. In the WProofreader browser extension, the feature is enabled by default.

Autocomplete suggestions while typing are available only for English dialects (en_AU, en_CA, en_GB, en_NZ, en_US, en_ZA, en_AI)  for now. 

Developers can update the configuration and turn ON the autocomplete by default for all users. Also, there is a toggle setting on the UI allowing end users to enable or disable text prediction.

Autocomplete mechanism

Autocomplete is based on the GPT2 (small) model pre-trained on a very large corpus of English data.

The autocomplete suggests the next word or a short phrase based on the context. For example, the user writes “thank”, the autocomplete suggests “you”. Autocomplete suggestions are highlighted in gray. To accept the suggestion, the user clicks the right arrow key . To ignore/refuse the suggestion, the user should continue writing. To “undo” the autocomplete suggestion, the user should use the native revert mechanism of the browser or editor (for instance, click Ctrl+Z).

The functionality is disabled for input fields and tables due to the lack of space to show autocomplete suggestions. The feature works in textareas if the cursor is at the end of the text.

The user is typing a word, after 300ms the request for the autocomplete command is sent. If the text is smaller or equals 200 characters, then the request includes the whole text. If the text is larger than 200 characters, then the autocomplete request includes only the last 200 characters. If the text is too large, it will be limited to 32 tokens on the server/network side.

Configuration

Admins can enable autocomplete by adding autocomplete:true, option to WEBSPELLCHECKER_CONFIG. End users will still have an option to disable autocomplete suggestions from the UI of the Settings dialog.

<script>
    window.WEBSPELLCHECKER_CONFIG = {
        ...
        autocomplete: true,
        ...
    }
</script>

Admins can hide the autocomplete section from the settings, so users can’t enable or disable this feature by removing 'general' value from settingsSections option. Please note that in this case the option to enable/disable Spelling autocorrect won’t be available as well.

<script>
    window.WEBSPELLCHECKER_CONFIG = {
        ...
   		settingsSections: ['dictionaries', 'languages', 'general', 'options'],
        ...
    }
</script>

This option as well as all other options for WProofreader are available in the WProofreader API options