Skip to content

Commit 9b2fb97

Browse files
authored
Merge pull request #3 from tomayac/patch-2
Correct casing of Proofreader
2 parents 4fe81eb + 2d2832f commit 9b2fb97

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
*This proposal is an early design sketch by ODML and Chrome built-in AI team to describe the problem below and solicit
44
feedback on the proposed solution. It has not been approved to ship in Chrome.*
55

6-
Proofreading is the process of examining a text carefully to find and correct errors such as grammar, spelling, and punctuation to generate an error-free text before it is published or shared. Browsers and operating systems are increasingly offering proofreading capability to help their users compose (examples: [Example](https://chrome.googleblog.com/2013/03/oodles-of-improvements-to-chromes-spell.html), [Example](https://support.apple.com/guide/mac-help/use-writing-tools-mchldcd6c260/mac)).
6+
Proofreading is the process of examining a text carefully to find and correct errors such as grammar, spelling, and punctuation to generate an error-free text before it is published or shared. Browsers and operating systems are increasingly offering proofreading capability to help their users compose (examples: [Example](https://chrome.googleblog.com/2013/03/oodles-of-improvements-to-chromes-spell.html), [Example](https://support.apple.com/guide/mac-help/use-writing-tools-mchldcd6c260/mac)).
77

8-
Web applications can also benefit from such proofreading capability. This proposal introduces a new JavaScript API which, by exposing high-level functionality of a language model, corrects and labels a variety of errors from user input. Specifically, the proposed proofreading API in this explainer exposes three specific higher-level functionalities for proofreading:
8+
Web applications can also benefit from such proofreading capability. This proposal introduces a new JavaScript API which, by exposing high-level functionality of a language model, corrects and labels a variety of errors from user input. Specifically, the proposed proofreading API in this explainer exposes three specific higher-level functionalities for proofreading:
99

1010

1111
1. Error Correction: Correct input text by the user
@@ -50,7 +50,7 @@ const proofreader = await Proofreader.create({
5050
const corrections = await proofreader.proofread("I seen him yesterday at the store, and he bought two loafs of bread.");
5151
```
5252

53-
`proofread()` corrects the input text and returns a list of corrections made. Additional proofreading features can be configured using includeCorrectionTypes and `includeCorrectionExplanations`. When `includeCorrectionTypes` is set to `true`, `proofread()` will provide an error type label for each correction made to each error. When `includeCorrectionExplanations` is set to `true`, `proofread()` will provide an annotation for each error with a plain language explanation.
53+
`proofread()` corrects the input text and returns a list of corrections made. Additional proofreading features can be configured using includeCorrectionTypes and `includeCorrectionExplanations`. When `includeCorrectionTypes` is set to `true`, `proofread()` will provide an error type label for each correction made to each error. When `includeCorrectionExplanations` is set to `true`, `proofread()` will provide an annotation for each error with a plain language explanation.
5454

5555
Detailed design for the corrections output is [discussed later](#proofreading-correction-output).
5656

@@ -97,14 +97,14 @@ const proofreader = await Proofreader.create({
9797
When there are multiple languages in the proofreading input, developers could specify them by adding to the list of `expectedInputLanguages` in the `create()` method.
9898

9999
```js
100-
const proofreader = await proofreader.create({
100+
const proofreader = await Proofreader.create({
101101
includeCorrectionTypes: true,
102102
expectedInputLanguages: ["en", "ja"],
103103
})
104104
```
105105

106106
### Testing available options before creation
107-
The proofreading API is customizable during the `create()` calls, with various options including the language option above. All options are given in more detail in the [later section](#full-api-surface-in-web-idl).
107+
The proofreading API is customizable during the `create()` calls, with various options including the language option above. All options are given in more detail in the [later section](#full-api-surface-in-web-idl).
108108

109109
However, not all models will necessarily support every language and it might require a download to get the appropriate fine-tuning or other collateral necessary on the first use.
110110

@@ -132,7 +132,7 @@ if (supportsOurUseCase !== "unavailable") {
132132
console.log(await proofreader.proofread(editBoxEl.textContent));
133133
} else {
134134
// Either the API overall, or the combination of correction-with-labels with
135-
// English input, is not available.
135+
// English input, is not available.
136136
// Handle the failure / run alternatives.
137137
}
138138
```
@@ -200,7 +200,7 @@ dictionary ProofreadCorrection {
200200
unsigned long long endIndex;
201201
DOMString correction;
202202
CorrectionType type; // exists if proofreader.includeCorrectionTypes === true
203-
DOMString explanation; // exists if proofreader.includeCorrectionExplanations === true
203+
DOMString explanation; // exists if proofreader.includeCorrectionExplanations === true
204204
}
205205

206206
enum CorrectionType { "spelling", "punctuation", "capitalization", "preposition", "missing-words", "grammar" };
@@ -246,15 +246,15 @@ interface ProofreaderFactory {
246246
static Promise<AIAvailability> availability(optional ProofreaderCreateCoreOptions options = {});
247247

248248
Promise<ProofreadResult> proofread(DOMString input);
249-
ReadableStream proofreadStreaming(DOMString input);
249+
ReadableStream proofreadStreaming(DOMString input);
250250

251251
// whether to provide correction types for each correction as part of the proofreading result.
252252
readonly attribute boolean includeCorrectionTypes;
253253
// whether to provide explanations for each correction as part of the proofreading result.
254254
readonly attribute boolean includeCorrectionExplanations;
255255
readonly attribute DOMString? correctionExplanationLanguage;
256256
readonly attribute FrozenArray<DOMString>? expectedInputLanguages;
257-
257+
258258
undefined destroy();
259259
};
260260

@@ -283,13 +283,13 @@ dictionary ProofreadCorrection {
283283
DOMString explanation;
284284
}
285285

286-
enum CorrectionType {
287-
"spelling",
288-
"punctuation",
289-
"capitalization",
290-
"preposition",
291-
"missing-words",
292-
"grammar"
286+
enum CorrectionType {
287+
"spelling",
288+
"punctuation",
289+
"capitalization",
290+
"preposition",
291+
"missing-words",
292+
"grammar"
293293
};
294294
```
295295
@@ -311,8 +311,8 @@ The [spellcheck](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attrib
311311
For more sophisticated browser integrated proofreading features, it’s an open question how to address the potential conflicts. For example, for browser extensions, one option is for web developers to detect the presence of certain extensions and then decide the behavior of their own proofreading feature.
312312
313313
### Customization with user-mutable dictionary
314-
While the proposed Proofreading API corrects user input based on general knowledge, there could be cases where users would prefer to ignore correcting certain proper names, acronyms, etc. For example, the proposed [Dictionary API](https://github.com/Igalia/explainers/pull/37) allows users to add and remove words from the browser’s custom dictionary to address special use cases.
314+
While the proposed Proofreading API corrects user input based on general knowledge, there could be cases where users would prefer to ignore correcting certain proper names, acronyms, etc. For example, the proposed [Dictionary API](https://github.com/Igalia/explainers/pull/37) allows users to add and remove words from the browser’s custom dictionary to address special use cases.
315315
316-
The Proofreading API can potentially allow users to specify a custom dictionary, and avoid correcting any words included in the dictionary.
316+
The Proofreading API can potentially allow users to specify a custom dictionary, and avoid correcting any words included in the dictionary.
317317
318318
However, in cases where ignoring certain words for correction could potentially change the meaning/structure of a sentence, it could be a bit tricky to proofread with pre-trained language models. Therefore, we are moving forward without integration with custom dictionaries until further exploration and evaluation is done. Nevertheless, we invite discussion of all of these APIs within the Web Machine Learning Community Group.

0 commit comments

Comments
 (0)