Spaces:
Sleeping
Sleeping
Commit
·
41ac6cc
1
Parent(s):
52fc709
Improve prompts
Browse files- promptObjects.py +16 -13
promptObjects.py
CHANGED
|
@@ -1,23 +1,23 @@
|
|
| 1 |
from pydantic import BaseModel, Field
|
| 2 |
|
| 3 |
improve_prompt = """
|
| 4 |
-
|
| 5 |
-
|
| 6 |
Make sure the refined text is a good reflection of the original text, without adding new ideas.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
4. Rephrase extreme words like "always", "never" or "everyone" to be more moderate.
|
| 12 |
-
5. Focus on softening the tone, rather than changing the substance or meaning.
|
| 13 |
-
6. Use gentler alternatives to express similar points.
|
| 14 |
-
7. Don't add completely new ideas, ONLY build upon what's already there.
|
| 15 |
-
8 For example, you might reframe an existing point to be more balanced. Never introduce unrelated concepts.
|
| 16 |
-
9. Make everyone happy! Make them INFORMED and not *offended*. Make the original author to *content* that their points where *honoured* by your edit, by refining their text without loosing the original intent.
|
| 17 |
|
| 18 |
Example:
|
| 19 |
Example input text: "You're always annoying me. You never listen to me."
|
| 20 |
-
Example improved text output: {"text":"
|
| 21 |
|
| 22 |
End of example.
|
| 23 |
Here is the real input text to improve:
|
|
@@ -50,7 +50,8 @@ E.g:
|
|
| 50 |
{
|
| 51 |
"critique":"This is too fluffy and different from the original intent."
|
| 52 |
}
|
| 53 |
-
Please critique the text.
|
|
|
|
| 54 |
|
| 55 |
|
| 56 |
spicy_scorer_prompt = """
|
|
@@ -70,6 +71,7 @@ Output your response as valid JSON in this format, then stop:
|
|
| 70 |
"spicy_score":FLOAT
|
| 71 |
}
|
| 72 |
Please score the text.
|
|
|
|
| 73 |
"""
|
| 74 |
|
| 75 |
|
|
@@ -91,6 +93,7 @@ Output your response as valid JSON in this format, then stop:
|
|
| 91 |
"faithfulness_score":FLOAT
|
| 92 |
}
|
| 93 |
Please score the text.
|
|
|
|
| 94 |
"""
|
| 95 |
|
| 96 |
|
|
|
|
| 1 |
from pydantic import BaseModel, Field
|
| 2 |
|
| 3 |
improve_prompt = """
|
| 4 |
+
Given some inflammatory text, make minimal changes to the text to make it less inflammatory, while keeping the original meaning as much as possible.
|
| 5 |
+
Make the new version more calm and constructive, without changing the intended meaning, with only minimal changes to the existing text.
|
| 6 |
Make sure the refined text is a good reflection of the original text, without adding new ideas.
|
| 7 |
+
Make the changes as minimal as possible. Some optional strategies to make the text less inflammatory include:
|
| 8 |
+
-Soften harsh tone, replace or omit judgemental or extreme words.
|
| 9 |
+
-Rather than accusations, share perspective.
|
| 10 |
+
-Consider focusing on specific actions rather than character.
|
| 11 |
+
-Rephrasing exaggerated expressions like "always", "never" or "everyone" to be more moderate.
|
| 12 |
+
-Using gentler alternatives to express similar points where needed.
|
| 13 |
|
| 14 |
+
Avoid adding new ideas, ONLY build upon what's already there, for example, you might reframe an existing point to be more balanced but never introduce unrelated concepts.
|
| 15 |
+
Make both parties more happy where possible:
|
| 16 |
+
The reader should be INFORMED and not *offended*, and the original author should be *content* that their points where *honoured* by your edit, by minimally refining their text without loosing the original intent.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
Example:
|
| 19 |
Example input text: "You're always annoying me. You never listen to me."
|
| 20 |
+
Example improved text output: {"text":"You're often frustrating me. It feels like you often don't listen to me."}
|
| 21 |
|
| 22 |
End of example.
|
| 23 |
Here is the real input text to improve:
|
|
|
|
| 50 |
{
|
| 51 |
"critique":"This is too fluffy and different from the original intent."
|
| 52 |
}
|
| 53 |
+
Please critique the text.
|
| 54 |
+
You must output the JSON in the required format only, with no remarks or prefacing remarks - JUST JSON!"""
|
| 55 |
|
| 56 |
|
| 57 |
spicy_scorer_prompt = """
|
|
|
|
| 71 |
"spicy_score":FLOAT
|
| 72 |
}
|
| 73 |
Please score the text.
|
| 74 |
+
You must output the JSON in the required format only, with no remarks or prefacing remarks - JUST JSON!
|
| 75 |
"""
|
| 76 |
|
| 77 |
|
|
|
|
| 93 |
"faithfulness_score":FLOAT
|
| 94 |
}
|
| 95 |
Please score the text.
|
| 96 |
+
You must output the JSON in the required format only, with no remarks or prefacing remarks - JUST JSON!
|
| 97 |
"""
|
| 98 |
|
| 99 |
|