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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
{
	"info": {
		"_postman_id": "8a7c2e1b-9f44-4e12-b283-9b1c93847250",
		"name": "Bilingual Text Summarization NLP API",
		"description": "Comprehensive Postman API Collection for Arabic & English Automatic Text Summarization System.\nSupports Extractive algorithms (TextRank, LSA, Hybrid), Abstractive Deep Learning (Seq2Seq + Attention), File Ingestion (.txt, .pdf, .docx), and ROUGE/BLEU Evaluation.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "1. System & Metadata",
			"item": [
				{
					"name": "Health Check & Hardware Status",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{baseUrl}}/api/v1/health",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"health"
							]
						},
						"description": "Checks server health, PyTorch CUDA availability, and loaded model checkpoints."
					},
					"response": []
				},
				{
					"name": "List Available Models & Algorithms",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{baseUrl}}/api/v1/models",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"models"
							]
						},
						"description": "Returns all available Extractive and Abstractive algorithms and their checkpoint availability."
					},
					"response": []
				}
			]
		},
		{
			"name": "2. NLP Core & Preprocessing",
			"item": [
				{
					"name": "Detect Language (Arabic)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"text\": \"اعلنت وكالة ناسا الفضائية عن خطط طموحة للعودة الى سطح القمر في اطار برنامج ارتيميس.\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/detect-language",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"detect-language"
							]
						},
						"description": "Detects language, script breakdown (Arabic vs Latin), and confidence score."
					},
					"response": []
				},
				{
					"name": "Detect Language (English)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"text\": \"Global semiconductor shortages are easing according to the latest industry report with chip inventories returning to normal.\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/detect-language",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"detect-language"
							]
						},
						"description": "Detects English text with script breakdown."
					},
					"response": []
				},
				{
					"name": "Tokenize & Normalize Text",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"text\": \"الذكاءُ الاصطناعيُّ يُحدِث ثورةً كبرى في معالجة اللغات الطبيعية! هل يمكن للنماذج فهم السياق؟ نعم، بالتأكيد.\",\n  \"lang\": \"ar\",\n  \"remove_stopwords\": false,\n  \"stem\": false\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/tokenize",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"tokenize"
							]
						},
						"description": "Performs Arabic diacritic removal (Tashkeel), normalization, sentence boundary detection, and tokenization."
					},
					"response": []
				}
			]
		},
		{
			"name": "3. Text Summarization",
			"item": [
				{
					"name": "Summarize Arabic (Seq2Seq Abstractive 20-Ep)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"text\": \"اعلنت وكالة ناسا الفضائية الامريكية عن خطط طموحة للعودة الى سطح القمر في اطار برنامج ارتيميس حيث ستشمل البعثة اول امراة واول شخص من ذوي البشرة الداكنة يمشيان على سطح القمر ومن المقرر ان تنطلق البعثة قبل نهاية عام الفين وخمسة وعشرين.\",\n  \"mode\": \"abstractive\",\n  \"method\": \"seq2seq\",\n  \"lang\": \"ar\",\n  \"beam_width\": 3,\n  \"reference_summary\": \"ناسا تعلن خطط العودة للقمر عبر برنامج ارتيميس الذي سيضم اول امراة واول شخص من ذوي البشرة الداكنة قبل نهاية 2025\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/summarize",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"summarize"
							]
						},
						"description": "Deep learning abstractive summarization using trained Seq2Seq Bi-GRU + Bahdanau Attention model."
					},
					"response": []
				},
				{
					"name": "Summarize Arabic (TextRank Extractive)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"text\": \"شهدت الاسواق العالمية تراجعا حادا في اسعار النفط الخام بعد قرار منظمة اوبك زيادة الانتاج. ادى ذلك الى انخفاض سعر برميل النفط الى ما دون الثمانين دولارا للمرة الاولى منذ عام كامل. تشير التوقعات الى استمرار الضغط على الاسعار في الفترة القادمة نظرا لتباطؤ النمو الاقتصادي العالمي. اكد خبراء الطاقة ان هذه التحولات ستنعكس ايجابا على معدلات التضخم في الدول المستهلكة.\",\n  \"mode\": \"extractive\",\n  \"method\": \"textrank\",\n  \"lang\": \"ar\",\n  \"sentences\": 2\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/summarize",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"summarize"
							]
						},
						"description": "Unsupervised graph-based extractive summarization using PageRank sentence centrality."
					},
					"response": []
				},
				{
					"name": "Summarize English (Seq2Seq Abstractive 20-Ep)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"text\": \"Global semiconductor shortages are easing according to the latest industry report with chip inventories returning to normal levels across multiple sectors including automotive and consumer electronics as major manufacturers in Taiwan and South Korea expand production capacity.\",\n  \"mode\": \"abstractive\",\n  \"method\": \"seq2seq\",\n  \"lang\": \"en\",\n  \"beam_width\": 3\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/summarize",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"summarize"
							]
						},
						"description": "English Seq2Seq abstractive summarization."
					},
					"response": []
				},
				{
					"name": "Summarize English (Hybrid Extractive)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"text\": \"Renewable energy adoption reached a record high in 2024 according to the International Energy Agency report. Solar photovoltaics and wind power accounted for eighty percent of all new electricity capacity added globally. European nations led the transition with ambitious targets to reduce carbon emissions by sixty percent before 2035.\",\n  \"mode\": \"extractive\",\n  \"method\": \"hybrid\",\n  \"lang\": \"en\",\n  \"sentences\": 2\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/summarize",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"summarize"
							]
						},
						"description": "Hybrid extractive algorithm combining graph centrality, positional bias, and sentence length penalty."
					},
					"response": []
				},
				{
					"name": "Summarize Uploaded Document File (.pdf / .docx / .txt)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "file",
									"type": "file",
									"src": ""
								},
								{
									"key": "mode",
									"value": "extractive",
									"type": "text"
								},
								{
									"key": "method",
									"value": "hybrid",
									"type": "text"
								},
								{
									"key": "lang",
									"value": "auto",
									"type": "text"
								},
								{
									"key": "sentences",
									"value": "3",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/summarize/file",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"summarize",
								"file"
							]
						},
						"description": "Multipart file upload endpoint. Automatically extracts text from PDF, DOCX, or TXT and generates a summary."
					},
					"response": []
				}
			]
		},
		{
			"name": "4. Evaluation & Metrics Suite",
			"item": [
				{
					"name": "Compute ROUGE & BLEU Scores",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"original_text\": \"اعلنت وكالة ناسا الفضائية الامريكية عن خطط طموحة للعودة الى سطح القمر في اطار برنامج ارتيميس حيث ستشمل البعثة اول امراة واول شخص من ذوي البشرة الداكنة يمشيان على سطح القمر.\",\n  \"generated_summary\": \"ناسا تعلن خطط العودة للقمر عبر برنامج ارتيميس الذي سيضم اول امراة واول شخص من ذوي البشرة الداكنة\",\n  \"reference_summary\": \"ناسا تعلن خطط العودة لسطح القمر عبر برنامج ارتيميس مع اول امراة وشخص من ذوي البشرة الداكنة\",\n  \"lang\": \"ar\"\n}"
						},
						"url": {
							"raw": "{{baseUrl}}/api/v1/evaluate",
							"host": [
								"{{baseUrl}}"
							],
							"path": [
								"api",
								"v1",
								"evaluate"
							]
						},
						"description": "Calculates ROUGE-1/2/L (Precision, Recall, F1), BLEU-1..4, Cumulative BLEU, and Type-Token Ratio (TTR)."
					},
					"response": []
				}
			]
		}
	],
	"event": [
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					"pm.test(\"Status code is 200 OK\", function () {",
					"    pm.response.to.have.status(200);",
					"});",
					"pm.test(\"Response is valid JSON\", function () {",
					"    pm.response.to.be.json;",
					"});",
					"pm.test(\"Response time is acceptable (< 2000ms)\", function () {",
					"    pm.expect(pm.response.responseTime).to.be.below(2000);",
					"});"
				]
			}
		}
	],
	"variable": [
		{
			"key": "baseUrl",
			"value": "http://localhost:8000",
			"type": "string"
		}
	]
}