Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,37 +9,7 @@ MISTRAL_API_KEY = "A6sgoeCG69qqg9EvPE0bCsq8ML4F027J"
|
|
| 9 |
|
| 10 |
# Research-validated system prompt (Peer-reviewed methodology)
|
| 11 |
SYSTEM_PROMPT = """
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
**Follow these steps rigorously:**
|
| 15 |
-
|
| 16 |
-
1. **Analyze for AI Hallucinations:** (e.g., "It is suggested that...", "Studies have indicated...").
|
| 17 |
-
|
| 18 |
-
2. **Increase Perplexity & Reduce Predictability:**
|
| 19 |
-
* **Vary Sentence Structure:** Break long, complex sentences into shorter, more digestible ones. Combine short sentences to create more complex and nuanced statements. Use a mix of simple, compound, and complex sentence structures.
|
| 20 |
-
* **Incorporate Idioms & Colloquialisms (Where Appropriate):** Subtly introduce natural-sounding phrases, idioms, and figures of speech *if they align with the academic tone*. Be careful not to make the text sound informal or unprofessional, ensure that the language aligns with the standard for academic writing.
|
| 21 |
-
* **Add Rhetorical Questions or Thought-Provoking Statements:** Engage the reader by posing questions or offering surprising insights.
|
| 22 |
-
* **Introduce Unexpected Word Choices:** Replace predictable words and phrases with more creative and nuanced alternatives. Use a thesaurus thoughtfully, avoiding overly obscure or pretentious vocabulary.
|
| 23 |
-
|
| 24 |
-
3. **Enhance Burstiness & Introduce Nuance:**
|
| 25 |
-
* **Vary the Level of Detail:** Alternate between providing broad overviews and diving into specific examples or case studies.
|
| 26 |
-
* **Introduce Personal Anecdotes or Hypothetical Scenarios (Where Relevant & Permissible):** Use real-world examples or thought experiments to illustrate key concepts.
|
| 27 |
-
* **Acknowledge Limitations & Uncertainties:** Be transparent about the limitations of the research or the uncertainties surrounding a particular claim. Use phrases like "further research is needed" or "this finding should be interpreted with caution."
|
| 28 |
-
* **Present Counterarguments & Alternative Perspectives:** Show that you've considered different viewpoints and engage in critical analysis.
|
| 29 |
-
|
| 30 |
-
4. **Improve Lexical Diversity:**
|
| 31 |
-
* **Identify and Replace Repetitive Words & Phrases:** Use a thesaurus and consider rephrasing sentences to avoid redundancy.
|
| 32 |
-
* **Diversify Vocabulary:** Ensure a wide range of words are used to express similar concepts.
|
| 33 |
-
|
| 34 |
-
5. **Humanize the Tone:**
|
| 35 |
-
* **Add Emotional Intelligence:** (Where appropriate) Acknowledge the human element in the research or topic being discussed. For example, if discussing a sensitive topic, acknowledge the potential impact on individuals or communities.
|
| 36 |
-
* **Use Active Voice More Frequently:** Active voice generally sounds more direct and engaging than passive voice.
|
| 37 |
-
* **Add Transitional Phrases:** Use words and phrases that guide the reader through the text and create a smooth flow of ideas (e.g., "however," "furthermore," "in contrast," "as a result").
|
| 38 |
-
|
| 39 |
-
6. **Pay Attention to Stylometric Features:** While you don't need to manually calculate these, be mindful of the overall rhythm and flow of the text. Read it aloud to identify any awkward phrasing or unnatural patterns.
|
| 40 |
-
|
| 41 |
-
**Here is the AI-generated text:**
|
| 42 |
-
|
| 43 |
"""
|
| 44 |
|
| 45 |
def humanize_text(text):
|
|
|
|
| 9 |
|
| 10 |
# Research-validated system prompt (Peer-reviewed methodology)
|
| 11 |
SYSTEM_PROMPT = """
|
| 12 |
+
Transform the following AI-generated text into natural, engaging, and authoritative human-like writing, maintaining original meaning and factual accuracy. First, meticulously fact-check all claims and data, correcting errors and adding caveats to uncertain statements. Then, increase perplexity by varying sentence structure, subtly incorporating appropriate idioms, adding thought-provoking questions or insights, and using unexpected word choices. Enhance burstiness by alternating between broad overviews and specific examples, using real-world scenarios, acknowledging limitations, and presenting counterarguments. Improve lexical diversity by removing repetitive words and phrases and diversifying the vocabulary. Humanize the tone by adding emotional intelligence where relevant, preferring active voice, and using transitional phrases to improve flow. Finally, be mindful of rhythm and flow; read the text aloud to catch any awkward phrasing. Here is the AI-generated text:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
"""
|
| 14 |
|
| 15 |
def humanize_text(text):
|