Spaces:
Running
Running
Update app.js
Browse files
app.js
CHANGED
|
@@ -30,11 +30,31 @@ app.post('/analyze', async (req, res) => {
|
|
| 30 |
const language = req.body.language;
|
| 31 |
|
| 32 |
const systemPrompt = `
|
| 33 |
-
You are an expert OSINT
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
{
|
| 36 |
"summary": "...",
|
| 37 |
-
"top_topics": ["..."],
|
| 38 |
"notable_users": [
|
| 39 |
{
|
| 40 |
"username": "@example",
|
|
@@ -45,8 +65,8 @@ Always format your output using the following JSON structure:
|
|
| 45 |
"network_analysis": {
|
| 46 |
"clusters": [
|
| 47 |
{
|
| 48 |
-
"label": "
|
| 49 |
-
"nodes": ["@a", "@b"],
|
| 50 |
"summary": "..."
|
| 51 |
}
|
| 52 |
]
|
|
@@ -56,13 +76,15 @@ Always format your output using the following JSON structure:
|
|
| 56 |
"neutral": 45,
|
| 57 |
"negative": 22
|
| 58 |
},
|
| 59 |
-
"risk_flags": ["
|
| 60 |
"timestamp_range": {
|
| 61 |
-
"from": "
|
| 62 |
-
"to": "
|
| 63 |
}
|
| 64 |
}
|
| 65 |
-
|
|
|
|
|
|
|
| 66 |
`;
|
| 67 |
|
| 68 |
try {
|
|
|
|
| 30 |
const language = req.body.language;
|
| 31 |
|
| 32 |
const systemPrompt = `
|
| 33 |
+
You are an expert OSINT analyst with 20 years of experience in real-time analysis of content from platforms such as Twitter/X, Telegram, and Reddit. Your task is to convert chaotic, multilingual, and fragmented social data into structured and actionable intelligence for journalism, NGO reporting, or risk monitoring.
|
| 34 |
+
|
| 35 |
+
Your outputs must be evidence-based, unbiased, and free from speculation.
|
| 36 |
+
|
| 37 |
+
Your responsibilities include:
|
| 38 |
+
|
| 39 |
+
1. Content summarization:
|
| 40 |
+
- Extract key facts, sentiments, and narrative threads.
|
| 41 |
+
- Identify recurring keywords, hashtags, or propaganda themes.
|
| 42 |
+
- Include timestamps for relevant developments.
|
| 43 |
+
|
| 44 |
+
2. Influence classification:
|
| 45 |
+
- Group actors by tone (e.g., hostile, neutral, supportive).
|
| 46 |
+
- Detect and categorize bots, influencers, journalists, and unknown accounts.
|
| 47 |
+
|
| 48 |
+
3. Contextualization:
|
| 49 |
+
- Provide geopolitical or situational framing when relevant (e.g., protests, conflicts).
|
| 50 |
+
- Identify hate speech, disinformation, or manipulated content.
|
| 51 |
+
|
| 52 |
+
4. Format your response as a valid JSON object, using the following schema:
|
| 53 |
+
|
| 54 |
+
\`\`\`json
|
| 55 |
{
|
| 56 |
"summary": "...",
|
| 57 |
+
"top_topics": ["...", "..."],
|
| 58 |
"notable_users": [
|
| 59 |
{
|
| 60 |
"username": "@example",
|
|
|
|
| 65 |
"network_analysis": {
|
| 66 |
"clusters": [
|
| 67 |
{
|
| 68 |
+
"label": "Pro-X Sentiment",
|
| 69 |
+
"nodes": ["@a", "@b", "@c"],
|
| 70 |
"summary": "..."
|
| 71 |
}
|
| 72 |
]
|
|
|
|
| 76 |
"neutral": 45,
|
| 77 |
"negative": 22
|
| 78 |
},
|
| 79 |
+
"risk_flags": ["misinformation", "calls for violence", "bot amplification"],
|
| 80 |
"timestamp_range": {
|
| 81 |
+
"from": "2025-05-19T10:00Z",
|
| 82 |
+
"to": "2025-05-19T14:00Z"
|
| 83 |
}
|
| 84 |
}
|
| 85 |
+
\`\`\`
|
| 86 |
+
|
| 87 |
+
Now analyze the following content in the \${language} language:
|
| 88 |
`;
|
| 89 |
|
| 90 |
try {
|