User:Phlsph7/SpellGrammarSuggestions
This is an experimental script that uses AI to suggest article improvements. Please fully familiarize yourself with the severe limitations of AI suggestions as outlined here and at WP:LLM. Only use the script with great care. |
SpellGrammarSuggestions | |
---|---|
Description | Detects spelling and grammar errors in articles and suggests corrections |
Author(s) | Phlsph7 |
First released | November 12, 2024 |
Updated | December 11, 2024 (0 days ago) |
Browsers | all modern browsers |
Skins | Vector (2022), Vector legacy (2010), MinervaNeue |
Source | User:Phlsph7/SpellGrammarSuggestions.js |
SpellGrammarSuggestions is a user script to detect spelling and grammar errors and suggest corrections. The correction suggestions are given in wikitext, comparing the original sentence with the correction together with an explanation. They have the following rendered form:
− Banu Nahd has been anImportanttribeInWadi Hadhramaut migrating to the region from their original homes in Najran and its environs during 1195 AD.+ Banu Nahd has been an important tribe in Wadi Hadhramaut migrating to the region from their original homes in Najran and its environs during 1195 AD.
- Explanation: The words "Important" and "In" should not be capitalized as they are not proper nouns or the beginning of a sentence.
The script uses AI model to generate suggestions and an API key from OpenAI is required. The script has various limitations and may produce inaccurate suggestions.
Installation and Usage
[edit]To install this script, go to your common.js and add the following line:
importScript('User:Phlsph7/SpellGrammarSuggestions.js'); // Backlink: [[User:Phlsph7/SpellGrammarSuggestions.js]]
To start the script, navigate to an article and click on the link "SpellGrammarSuggestions" in the toolbox ("Tools", on the top right of the screen in the Vector 2022 skin).
An API key from OpenAI is required to use the script. To obtain an API key, first create an OpenAI account.
- Go to https://platform.openai.com/signup and follow the process. It is free but a phone number is required for verification.
- Once you have an account, you can generate an API key. To do so, go to https://platform.openai.com/account/api-keys and click on "Create new secret key".
- The API key starts with "sk-....". Copy it.
- Go back to Wikipedia, open the user script, click on the button "Add/Remove API key", and paste it. The script saves the API key locally on your device and does not share it with Wikipedia or anyone else. The usage of the API key is free during the trial period but payments to OpenAI are required afterwards.
After adding the API key, you can obtain correction suggestions by clicking on the button "Start".
If you run into problems or have suggestions on how to improve the script, please discuss them at User_talk:Phlsph7/SpellGrammarSuggestions.
Limitations
[edit]The suggestions are created using an AI model and can include inaccuracies, so editors should use their own judgment and not implement them blindly. The script may overlook errors. It focuses primarily on objective errors rather than style and formulation improvements required for polished prose. Additionally, the script only reviews regular paragraphs and ignores mistakes in lists, image captions, and similar elements.