CoEdIT: Text Editing by Task-Specific Instruction Tuning
Paper
•
2305.09857
•
Published
•
7
ONNX quantized version of Grammarly's CoEdIT-Large model for browser-based text editing and grammatical error correction with Transformers.js.
CoEdIT is a text-to-text model fine-tuned for various editing tasks. For grammar correction, use the prompt format:
Fix grammatical errors: <input text>
The model generates the corrected text directly.
import { pipeline } from '@huggingface/transformers';
const corrector = await pipeline(
'text2text-generation',
'YOUR_USERNAME/coedit-large',
{ dtype: 'q8' }
);
const result = await corrector('Fix grammatical errors: He go to school yesterday.');
console.log(result[0].generated_text);
// "He went to school yesterday."
CoEdIT supports multiple editing tasks via different prompts:
Fix grammatical errors: ... - Grammar correctionParaphrase: ... - ParaphrasingSimplify: ... - Text simplificationMake this more formal: ... - Formality transferMake this more coherent: ... - Coherence improvementMore flexible than GECToR (can rewrite sentences), but slower due to autoregressive generation.
Apache 2.0 (following original model license)
Totally Free + Zero Barriers + No Login Required