AI-powered bilingual (Arabic & English) news platform for news aggregation, media bias detection, and personalized insights. 2026 Ain Shams University Computer Science Graduation Project.
Jupyter Notebook
0
1 commits
updated Jun 29, 2026
Welcome to the Hasal-Eih repository!
Hasal-Eih is an advanced, AI-powered bilingual (Arabic & English) intelligent news platform designed to tackle the global challenge of information overload and hidden media bias.
Every day, over 2 million news articles are published. Readers struggle to distinguish between factual reporting and subjective framing. Hasal-Eih aims to reduce cognitive overload by automatically aggregating, summarizing, analyzing, and detecting bias in news articles. Furthermore, it measures the impact of news sentiment on financial markets.
Hasal-Eih is built as a highly scalable microservices ecosystem. It separates high-speed data ingestion from resource-intensive Machine Learning inference.
trafilatura to extract core text from raw HTML, and utilizes langdetect to instantly route articles into Arabic or English processing queues.The system uses differing SOTA approaches based on the language.
RoBERTa-base model trained on the NewsMTSC dataset. It inserts custom [TARGET] tokens during tokenization to force the model to gauge sentiment exclusively towards that entity. It then aggregates these sentence scores into a weighted Article-Level bias score using Entropy.MARBERT fine-tuned on a heavily engineered custom dataset (ArmPro + AFND + BBC + XL-Sum). We implemented a "Lead Paragraph Truncator" to strictly enforce length parity (200-250 characters) so the model focuses on semantics, not text length.tf_env) to avoid package dependency conflicts.Celery Beat) triggers the ingestion process every X minutes (default 15).Celery workers pick up tasks. For each article:
Sentence-Transformers.FastAPI instance. If a user does a semantic search, the API utilizes the HNSW index in pgvector to rapidly fetch similar articles via cosine similarity.Edge Cases & Failure Scenarios:
cloudscraper and request retries.0.7 * MSE + 0.3 * Directional Penalty. This forces the model to predict the trend direction accurately, rather than just the absolute value.embedding_vector column optimized with an HNSW (Hierarchical Navigable Small World) index for millisecond-level similarity searches across thousands of documents..env file in the root directory:NEWSAPI_KEY=YOUR_NEWSAPI_KEY
FETCH_INTERVAL_MINUTES=15
REDIS_HOST=localhost
REDIS_PORT=6379
DB_HOST=127.0.0.1
DB_PORT=5433
DB_NAME=news_db
DB_USER=postgres
DB_PASSWORD=postgres
CELERY_BROKER_URL=redis://localhost:6379/0
docker-compose up -d
(This starts Redis on port 6379 and PostgreSQL with pgvector on port 5433).
pip install -r requirements.txt
tf_env.py -3.11 -m venv tf_env
.\tf_env\Scripts\activate
.\tf_env\Scripts\python.exe -m pip install fastapi uvicorn pandas numpy tensorflow joblib scikit-learn pydantic redis celery hdbscan torch
deactivate
ml_pipeline/models/ and place the models in their respective folders:ml_pipeline/
├── models/
│ ├── BIAS/
│ │ ├── AR/
│ │ │ └── MARBERT/
│ │ └── EN/
│ │ ├── ANTIvsPRO/
│ │ ├── Binary/
│ │ └── FACTvsOP/
│ └── Impact/
│ ├── egGAS/
│ └── egx30/
We have provided an automated orchestrator script. Run:
python run_services.py
This automatically boots up 6 separate command windows representing:
http://127.0.0.1:8000)http://127.0.0.1:8001)To view the UI, launch the frontend:
cd frontend
python -m http.server 3000
Navigate to http://localhost:3000/.
NEWSAPI_KEY is valid. Ensure Celery Beat is actively running, and check docker ps to ensure Redis is accepting connections.NEWSAPI_PAGE_SIZE to process fewer documents per batch or deploy the system on an environment with high RAM resources. Ensure you are not loading the large Transformers models globally outside of worker execution unless intended.tf_env) before starting impact_api.py. The run_services.py script mitigates this locally in Windows.AI-powered bilingual (Arabic & English) news platform for news aggregation, media bias detection, and personalized insights. 2026 Ain Shams University Computer Science Graduation Project.
Jupyter Notebook
0
1 commits
updated Jun 29, 2026
Welcome to the Hasal-Eih repository!
Hasal-Eih is an advanced, AI-powered bilingual (Arabic & English) intelligent news platform designed to tackle the global challenge of information overload and hidden media bias.
Every day, over 2 million news articles are published. Readers struggle to distinguish between factual reporting and subjective framing. Hasal-Eih aims to reduce cognitive overload by automatically aggregating, summarizing, analyzing, and detecting bias in news articles. Furthermore, it measures the impact of news sentiment on financial markets.
Hasal-Eih is built as a highly scalable microservices ecosystem. It separates high-speed data ingestion from resource-intensive Machine Learning inference.
trafilatura to extract core text from raw HTML, and utilizes langdetect to instantly route articles into Arabic or English processing queues.The system uses differing SOTA approaches based on the language.
RoBERTa-base model trained on the NewsMTSC dataset. It inserts custom [TARGET] tokens during tokenization to force the model to gauge sentiment exclusively towards that entity. It then aggregates these sentence scores into a weighted Article-Level bias score using Entropy.MARBERT fine-tuned on a heavily engineered custom dataset (ArmPro + AFND + BBC + XL-Sum). We implemented a "Lead Paragraph Truncator" to strictly enforce length parity (200-250 characters) so the model focuses on semantics, not text length.tf_env) to avoid package dependency conflicts.Celery Beat) triggers the ingestion process every X minutes (default 15).Celery workers pick up tasks. For each article:
Sentence-Transformers.FastAPI instance. If a user does a semantic search, the API utilizes the HNSW index in pgvector to rapidly fetch similar articles via cosine similarity.Edge Cases & Failure Scenarios:
cloudscraper and request retries.0.7 * MSE + 0.3 * Directional Penalty. This forces the model to predict the trend direction accurately, rather than just the absolute value.embedding_vector column optimized with an HNSW (Hierarchical Navigable Small World) index for millisecond-level similarity searches across thousands of documents..env file in the root directory:NEWSAPI_KEY=YOUR_NEWSAPI_KEY
FETCH_INTERVAL_MINUTES=15
REDIS_HOST=localhost
REDIS_PORT=6379
DB_HOST=127.0.0.1
DB_PORT=5433
DB_NAME=news_db
DB_USER=postgres
DB_PASSWORD=postgres
CELERY_BROKER_URL=redis://localhost:6379/0
docker-compose up -d
(This starts Redis on port 6379 and PostgreSQL with pgvector on port 5433).
pip install -r requirements.txt
tf_env.py -3.11 -m venv tf_env
.\tf_env\Scripts\activate
.\tf_env\Scripts\python.exe -m pip install fastapi uvicorn pandas numpy tensorflow joblib scikit-learn pydantic redis celery hdbscan torch
deactivate
ml_pipeline/models/ and place the models in their respective folders:ml_pipeline/
├── models/
│ ├── BIAS/
│ │ ├── AR/
│ │ │ └── MARBERT/
│ │ └── EN/
│ │ ├── ANTIvsPRO/
│ │ ├── Binary/
│ │ └── FACTvsOP/
│ └── Impact/
│ ├── egGAS/
│ └── egx30/
We have provided an automated orchestrator script. Run:
python run_services.py
This automatically boots up 6 separate command windows representing:
http://127.0.0.1:8000)http://127.0.0.1:8001)To view the UI, launch the frontend:
cd frontend
python -m http.server 3000
Navigate to http://localhost:3000/.
NEWSAPI_KEY is valid. Ensure Celery Beat is actively running, and check docker ps to ensure Redis is accepting connections.NEWSAPI_PAGE_SIZE to process fewer documents per batch or deploy the system on an environment with high RAM resources. Ensure you are not loading the large Transformers models globally outside of worker execution unless intended.tf_env) before starting impact_api.py. The run_services.py script mitigates this locally in Windows.