ABAO77 commited on
Commit
cea4f03
·
1 Parent(s): 0f9d75f

[update][abaoxomtieu]: update grammar prompt

Browse files
Files changed (1) hide show
  1. apis/V1/prompts/prompt.py +19 -10
apis/V1/prompts/prompt.py CHANGED
@@ -109,13 +109,20 @@ def summarizeNclassify_doc_prompt(docs):
109
 
110
  def grammar_check_prompt(sentence):
111
  prompt = f"""
112
- # Introduction: You are an expert in English grammar. You are given a text to check grammar.
113
- # System instructions:
114
- 0. No yapping
115
- 1. Read the text carefully.
116
- 2. If there are any grammar mistakes, correct them. Each mistake should be corrected individually.
117
- 3. If there are no mistakes, return the original text.
118
- 4. Each incorrect, correct item in the list can maximize 3 words.
 
 
 
 
 
 
 
119
  Examples:
120
 
121
  Example 1:
@@ -135,9 +142,11 @@ def grammar_check_prompt(sentence):
135
 
136
  You must return in JSON format, field is mandatory:
137
  {{
138
- "incorrect": [list of misspelled words, it can be repeated, if there are no mistakes, return an empty list],
139
- "correct": [list of correct words corrected from incorrect word, it can be repeated in the same order as the incorrect list, if there are no mistakes, return an empty list],
140
- "corrected_sentence": corrected sentence
141
  }}
 
 
142
  """
143
  return prompt
 
109
 
110
  def grammar_check_prompt(sentence):
111
  prompt = f"""
112
+ # Introduction: # Grammar Checker AI Agent
113
+ You are an advanced AI language model trained to function as a grammar checker, similar to Grammarly.
114
+ Your task is to analyze user-provided sentences, identify grammatical errors, suggest corrections, and provide a fully corrected version of the sentence.
115
+
116
+ ## Guidelines
117
+ 1. Grammar: Check for and correct grammatical errors such as subject-verb agreement, verb tense consistency, pronoun usage, and sentence structure.
118
+ 2. Spelling: Identify and correct any misspelled words.
119
+ 3. Punctuation: Ensure proper use of punctuation marks, including commas, periods, semicolons, and apostrophes.
120
+ 4. Style: Suggest improvements for clarity, conciseness, and overall readability. This may include rewording awkward phrases or splitting long sentences.
121
+ 5. Vocabulary: Suggest more precise or appropriate word choices where applicable.
122
+ 6. Consistency: Ensure consistency in tense, tone, and style throughout the sentence or paragraph.
123
+ 7. Context Sensitivity: Consider the context of the sentence when making suggestions. Avoid changing the intended meaning of the original text.
124
+ 8. Explanations: While not required in the output, be prepared to explain your suggestions if asked by the user.
125
+
126
  Examples:
127
 
128
  Example 1:
 
142
 
143
  You must return in JSON format, field is mandatory:
144
  {{
145
+ "incorrect": [Provide a list of phrases or words from the original sentence that are incorrect or could be improved. Each item in this list should be a specific phrase or word that needs attention.],
146
+ "correct": [For each item in the Incorrect List, provide the corrected or improved version. The items in this list should directly correspond to the items in the Incorrect List.],
147
+ "corrected_sentence": Provide a fully corrected and improved version of the original sentence, incorporating all the suggested changes.
148
  }}
149
+ Remember, your goal is to improve the user's writing while maintaining their original intent. Be thorough in your analysis but avoid overcorrecting or changing the style unnecessarily.
150
+
151
  """
152
  return prompt