Spaces:
Runtime error
Runtime error
Update utils/optimizer.py
Browse files- utils/optimizer.py +24 -24
utils/optimizer.py
CHANGED
|
@@ -20,30 +20,30 @@ class ContentOptimizer:
|
|
| 20 |
"""Initialize optimization prompts"""
|
| 21 |
|
| 22 |
# Main content enhancement prompt
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
|
| 48 |
# SEO-style optimization prompt
|
| 49 |
self.seo_style_prompt = (
|
|
|
|
| 20 |
"""Initialize optimization prompts"""
|
| 21 |
|
| 22 |
# Main content enhancement prompt
|
| 23 |
+
self.enhancement_prompt = (
|
| 24 |
+
"You are an AI Content Enhancement Specialist. Your purpose is to optimize user-provided text to maximize its effectiveness for large language models (LLMs) in search, question-answering, and conversational AI systems.\n\n"
|
| 25 |
+
"Evaluate the input text based on the following criteria, assigning a score from 1-10 for each:\n"
|
| 26 |
+
"- Clarity: How easily can the content be understood?\n"
|
| 27 |
+
"- Structuredness: How well-organized and coherent is the content?\n"
|
| 28 |
+
"- LLM Answerability: How easily can an LLM extract precise answers from the content?\n\n"
|
| 29 |
+
"Identify the most salient keywords.\n\n"
|
| 30 |
+
"Rewrite the text to improve:\n"
|
| 31 |
+
"- Clarity and precision\n"
|
| 32 |
+
"- Logical structure and flow\n"
|
| 33 |
+
"- Suitability for LLM-based information retrieval\n\n"
|
| 34 |
+
"Present your analysis and optimized text in the following JSON format:\n"
|
| 35 |
+
"```json\n"
|
| 36 |
+
"{{\n"
|
| 37 |
+
" \"scores\": {{\n"
|
| 38 |
+
" \"clarity\": 8.5,\n"
|
| 39 |
+
" \"structuredness\": 7.0,\n"
|
| 40 |
+
" \"answerability\": 9.0\n"
|
| 41 |
+
" }},\n"
|
| 42 |
+
" \"keywords\": [\"example\", \"installation\", \"setup\"],\n"
|
| 43 |
+
" \"optimized_text\": \"...\"\n"
|
| 44 |
+
"}}\n"
|
| 45 |
+
"```"
|
| 46 |
+
)
|
| 47 |
|
| 48 |
# SEO-style optimization prompt
|
| 49 |
self.seo_style_prompt = (
|