Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -263,10 +263,12 @@ async def extract_keywords(request_body: TextForKeywords):
|
|
| 263 |
"No other text should be included."
|
| 264 |
)
|
| 265 |
|
|
|
|
| 266 |
prompt = (
|
| 267 |
-
f"Extract
|
| 268 |
-
"
|
| 269 |
-
"
|
|
|
|
| 270 |
)
|
| 271 |
|
| 272 |
messages_for_llm = [
|
|
|
|
| 263 |
"No other text should be included."
|
| 264 |
)
|
| 265 |
|
| 266 |
+
# Modified prompt for clearer keyword extraction instruction
|
| 267 |
prompt = (
|
| 268 |
+
f"Extract exactly {request_body.num_keywords} most important keywords from the following text. "
|
| 269 |
+
"Your output should be ONLY the comma-separated list of keywords, nothing else. "
|
| 270 |
+
"For example, if the keywords are 'apple', 'banana', 'cherry', your output should be: 'apple, banana, cherry'. "
|
| 271 |
+
f"Text: {request_body.text}"
|
| 272 |
)
|
| 273 |
|
| 274 |
messages_for_llm = [
|