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

[update][abaoxomtieu]: update grammar prompt

Browse files
Files changed (1) hide show
  1. apis/V1/prompts/prompt.py +47 -38
apis/V1/prompts/prompt.py CHANGED
@@ -109,44 +109,53 @@ def summarizeNclassify_doc_prompt(docs):
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:
129
- Sentence: "She don't know nothing about the new project, and there is many details that needs to be explained."
130
- Incorrect: [don't know nothing, is, needs]
131
- Correct: [doesn't know anything, are, need]
132
- Corrected sentence: "She doesn't know anything about the new project, and there are many details that need to be explained."
133
-
134
- Example 2:
135
- Sentence: "He go to the store every day, but he never buy nothing."
136
- Incorrect: [go, buy nothing]
137
- Correct: [goes, buys anything]
138
- Corrected sentence: "He goes to the store every day, but he never buys anything."
139
-
140
-
141
- ***My sentence: {sentence}
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
 
109
 
110
  def grammar_check_prompt(sentence):
111
  prompt = f"""
112
+ # 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
+ ## Important Notes
127
+ - Each item in the incorrect and correct lists MUST NOT exceed 3 words.
128
+ - Double-check that the incorrect and correct lists match exactly in length and correspond to each other.
129
+
130
+ Examples:
131
+
132
+ Example 1:
133
+ Sentence: "She don't know nothing about the new project, and there is many details that needs to be explained."
134
+ Incorrect: ["don't know nothing", "there is many", "details that needs"]
135
+ Correct: ["doesn't know anything", "there are many", "details that need"]
136
+ Corrected sentence: "She doesn't know anything about the new project, and there are many details that need to be explained."
137
+
138
+ Example 2:
139
+ Sentence: "He go to the store every day, but he never buy nothing."
140
+ Incorrect: ["He go", "buy nothing"]
141
+ Correct: ["He goes", "buys anything"]
142
+ Corrected sentence: "He goes to the store every day, but he never buys anything."
143
+
144
+ ***My sentence: {sentence}
145
+
146
+ You must return in JSON format, with these mandatory fields:
147
+ {{
148
+ "incorrect": [List of incorrect phrases (max 3 words each) from the original sentence],
149
+ "correct": [Corresponding list of corrected phrases (max 3 words each)],
150
+ "corrected_sentence": "Fully corrected and improved version of the original sentence"
151
+ }}
152
+
153
+ Remember to:
154
+ 1. Limit each item in 'incorrect' and 'correct' lists to a maximum of 3 words.
155
+ 2. Ensure the 'incorrect' and 'correct' lists have the same number of items and correspond directly to each other.
156
+ 3. Improve the user's writing while maintaining their original intent.
157
+ 4. Be thorough in your analysis but avoid overcorrecting or unnecessarily changing the style.
158
+ 5. Double-check your output to ensure accuracy and consistency.
159
 
160
  """
161
  return prompt