Comprehensive Vietnamese fake-news detection pipeline combining web scraping, Kafka-based ingestion, AI claim extraction & verification, and automated retraining with Airflow.
crawler/producer.py reads scraped articles and pushes them to Kafka topic raw_articles.processor/consumer.py consumes Kafka, extracts claims (PhoBERT), encodes embeddings, and stores into PostgreSQL + pgvector.backend/main.py exposes /api/v1/verify, report endpoints and an internal /api/internal/reload-model for Airflow webhook.dashboard/app.py for reviewing user reports and metrics.dags/.model/retrain_pipeline.py (invoked by Airflow weekly DAG).Crawler -> Kafka (raw_articles) -> Consumer (AI) -> PostgreSQL + pgvector
Users/Extension -> Backend API -> Retriever+Verifier -> Response
Airflow DAGs (daily crawl, weekly retrain) orchestrate scheduled processing and model updates.
consumer)db / my_postgres_vector)cp .env.example .env
# Edit .env for credentials (POSTGRES_USER, POSTGRES_PASSWORD, etc.)
start_system.sh):./start_system.sh --build # builds images and starts infra + apps
./start_system.sh # start without rebuild
docker compose exec backend python init_db_full.py
backend_api_connection with Host=backend, Port=8000, Schema=http.Edit .env or .env.example. Important vars:
POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DBPGADMIN_EMAIL, PGADMIN_PASSWORDAIRFLOW_UID, _AIRFLOW_WWW_USER_USERNAME, _AIRFLOW_WWW_USER_PASSWORDKAFKA_BOOTSTRAP_SERVERS (default kafka:9093)dags/daily_crawl_dag.py: runs daily crawler/processor to ingest new articles.dags/weekly_retrain_dag.py: runs weekly retrain and calls backend reload webhook.Notes:
airflow database; start_system.sh handles initialization. If Airflow reports DB errors, create DB manually in Postgres: CREATE DATABASE airflow; and grant privileges.Use init_db_full.py to create tables:
articles — raw scraped articlesclaims — extracted claims with embedding vectorusers — extension users + reputationuser_reports — feedback from userstraining_data — approved labeled data for retrainingmodel_versions — stored model metadata/model and my_model* directories.user_reports, fine-tunes a CrossEncoder, saves new version under model/retrained_models/ and marks training data as used.# from repo root
uvicorn backend.main:app --host 0.0.0.0 --port 8000 --reload
curl -X POST http://localhost:8000/api/v1/verify -H "Content-Type: application/json" -d '{"text":"Một câu cần kiểm chứng"}'
backend is a package (there is an __init__.py) and container has /app on PYTHONPATH.docker compose logs airflow-webserver) and ensure AIRFLOW__CORE__FERNET_KEY is a valid Fernet key.docker compose logs kafka and kafka-ui.POSTGRES_HOST env points to db inside Docker, not localhost when inside containers.# Show running containers
docker compose ps
# Tail backend logs
docker compose logs -f backend
# Tail consumer logs
docker compose logs -f consumer
# Recreate a single service
docker compose up -d --no-deps --build backend
Created/maintained by the project owner. For questions or help, open an issue or contact the maintainer.
Comprehensive Vietnamese fake-news detection pipeline combining web scraping, Kafka-based ingestion, AI claim extraction & verification, and automated retraining with Airflow.
crawler/producer.py reads scraped articles and pushes them to Kafka topic raw_articles.processor/consumer.py consumes Kafka, extracts claims (PhoBERT), encodes embeddings, and stores into PostgreSQL + pgvector.backend/main.py exposes /api/v1/verify, report endpoints and an internal /api/internal/reload-model for Airflow webhook.dashboard/app.py for reviewing user reports and metrics.dags/.model/retrain_pipeline.py (invoked by Airflow weekly DAG).Crawler -> Kafka (raw_articles) -> Consumer (AI) -> PostgreSQL + pgvector
Users/Extension -> Backend API -> Retriever+Verifier -> Response
Airflow DAGs (daily crawl, weekly retrain) orchestrate scheduled processing and model updates.
consumer)db / my_postgres_vector)cp .env.example .env
# Edit .env for credentials (POSTGRES_USER, POSTGRES_PASSWORD, etc.)
start_system.sh):./start_system.sh --build # builds images and starts infra + apps
./start_system.sh # start without rebuild
docker compose exec backend python init_db_full.py
backend_api_connection with Host=backend, Port=8000, Schema=http.Edit .env or .env.example. Important vars:
POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DBPGADMIN_EMAIL, PGADMIN_PASSWORDAIRFLOW_UID, _AIRFLOW_WWW_USER_USERNAME, _AIRFLOW_WWW_USER_PASSWORDKAFKA_BOOTSTRAP_SERVERS (default kafka:9093)dags/daily_crawl_dag.py: runs daily crawler/processor to ingest new articles.dags/weekly_retrain_dag.py: runs weekly retrain and calls backend reload webhook.Notes:
airflow database; start_system.sh handles initialization. If Airflow reports DB errors, create DB manually in Postgres: CREATE DATABASE airflow; and grant privileges.Use init_db_full.py to create tables:
articles — raw scraped articlesclaims — extracted claims with embedding vectorusers — extension users + reputationuser_reports — feedback from userstraining_data — approved labeled data for retrainingmodel_versions — stored model metadata/model and my_model* directories.user_reports, fine-tunes a CrossEncoder, saves new version under model/retrained_models/ and marks training data as used.# from repo root
uvicorn backend.main:app --host 0.0.0.0 --port 8000 --reload
curl -X POST http://localhost:8000/api/v1/verify -H "Content-Type: application/json" -d '{"text":"Một câu cần kiểm chứng"}'
backend is a package (there is an __init__.py) and container has /app on PYTHONPATH.docker compose logs airflow-webserver) and ensure AIRFLOW__CORE__FERNET_KEY is a valid Fernet key.docker compose logs kafka and kafka-ui.POSTGRES_HOST env points to db inside Docker, not localhost when inside containers.# Show running containers
docker compose ps
# Tail backend logs
docker compose logs -f backend
# Tail consumer logs
docker compose logs -f consumer
# Recreate a single service
docker compose up -d --no-deps --build backend
Created/maintained by the project owner. For questions or help, open an issue or contact the maintainer.