Skip to contents

This shiny app allows a user to manually check each sentence or paragraph in a file using OpenAI LLMs.

Usage

run_grammar_checker(path, choose_token_level = "paragraphs")

Arguments

path

file to check

choose_token_level

string "sentences" or "paragraphs", defaults to paragraphs. The document is parsed into individual sentences or paragraphs.

Value

a shiny app is launched

Details

The text file is split into sentences or paragraphs. The user manually goes through each and chooses whether or not to send the current text for suggested feedback.

The prompts used for each checking option are defined in check_grammar_gpt.

Any suggested changes returned by the model are displayed with differences between the original and modified text highlighted in the window. The returned text often has subtle changes that may be difficult to spot, hence the visualization approach.

The suggested edits may occasionally fail to follow the instructions from the prompt. Some of the models produce very low-quality results, like ada, and babbage.

Examples

# don't run during tests
# gptaddin::run_grammar_checker("example.rmd")