This topic was automatically generated from Slack. You can find the original thread here.
Anyone know of a tool / api I can use to analyze the English quality (grammar/spelling etc.) of some text?
This topic was automatically generated from Slack. You can find the original thread here.
Anyone know of a tool / api I can use to analyze the English quality (grammar/spelling etc.) of some text?
I want to take form responses and automatically assign a score based on the English quality of their answers.
Grammarly comes to mind, but I’m not positive what their API provides
I found this Scoring Texts by their grammar in Python · GitHub
can’t seem to get the import language_tool_python
to work though
Do you have a defined set of rules to derive scores? e.g. -1 point for grammar mistakes, spelling mistakes, etc.?
GPT-3 deals well with these kind of problems, I’d play around with it. This prompt might be a good start, if you have an algorithm in mind:
Score the text below using the following rules:
- Score starts at 0
- Add 1 for each sentence with correct English grammar and spelling
- Subtract 0.5 points if the sentence contains any grammar mistakes. If the sentence contains 10 grammar mistakes (for example), still only decrement the score by 0.5 points once for the first grammatical error.
- Subtract 0.5 points if the sentence contains any spelling mistakes. If the sentence contains 10 spelling mistakes (for example), still only decrement the score by 0.5 points once for the first spelling error.
Count all sentences. Output the final score as a percentage: the total score calculated above, divided by the total number of sentences.
Text:
${text}
---
I haven’t even thought about it, I don’t have any set of rules. I figured this must be something someone else has done before…
old post showing textlint, Adding Automated Text Linting to My Blog
same package, more up to date post: Adding Text Linting to Eleventy
Interesting, I’ll have a peak at that.
and i believe Grammarly officially released their API like a month ago
suspect hugging face has these tools, I think there are some python libraries as well
LanguageTool - API, Open Source and Developer information this is also available as an open source self hosted I think