A framework for extracting, processing, and analyzing Telegram communications and related event data around the October 7, 2023 conflict.
This project combines three key modules: message extraction, event parsing, and sentiment analysis, to map sentiment dynamics onto real‐world conflict timelines.
.
├── telegram_groups_messages/ # Telegram message extraction module
├── wikipedia_events/ # Wikipedia conflict periods parsing module
└── sentiment_analysis/ # Sentiment analysis & time-series notebooks
Fetches raw messages from selected Telegram groups and stores them in SQLite for downstream analysis.
- Location:
telegram_groups_messages/ - Core scripts:
main.py,telegram_extractor.py,messages_database.py - Highlights:
- Rate-limit handling, timezone normalization (Asia/Jerusalem), media metadata, message-level metrics.
- Composite-key SQLite schema with JSON serialization for complex fields.
- See module README.
Builds a structured timeline of conflict phases by extracting dates and section titles from Wikipedia.
- Location:
wikipedia_events/ - Core scripts:
wikipedia_dates_parser.py,wikipedia_titles_parser.py,time_periods_parser.py - Highlights:
- HTML scraping and API calls to capture diverse date formats.
- Maps section headings to
(start_date, end_date, duration)records for correlation.
- See module README.
Applies multilingual sentiment models to the Telegram dataset, then aggregates, decomposes, and detects events in the sentiment series.
- Location:
sentiment_analysis/ - Core notebooks:
sentiment_analysis_1.ipynb– Message-level sentiment labelingsentiment_agg_by_time_2.ipynb– Hourly/daily/weekly aggregationsentiment_time_series_3.ipynb– Decomposition & stationarity testssentiment_time_series_by_type_4.ipynb– Group-type comparisons & Granger testssentiment_event_detection_5.ipynb– Change-point & cross-correlation detectionsentiment_events_analysis_6.ipynb– Event correlation & statistical validation
- Highlights:
- Hebrew (DicataBERT-Sentiment) and Arabic (CAMeLBERT-DA) classification.
- Net Sentiment & Sentiment Index metrics, CUSUM/PELT detection, t-tests/ANOVA, regression models.
- See module README.
- Python ≥ 3.11
- SQLite (built-in)
- Jupyter Notebook/Lab
- Common packages:
pip install telethon tqdm wakepy python-dotenv emoji pytz requests beautifulsoup4 wikipedia-api nltk pandas numpy matplotlib nltk transformers torch statsmodels ruptures scipy plotly
python -m nltk.downloader punkt
cd telegram_groups_messages
python main.pycd ../wikipedia_events
python wikipedia_titles_parser.py
python wikipedia_dates_parser.py
python time_periods_parser.pycd ../sentiment_analysis
jupyter nbconvert --to notebook --execute sentiment_analysis_1.ipynb
# repeat for each notebook in order 2 → 6- Time windows & thresholds: adjust in
main.pyand analysis notebooks - Date formats & section depths: extend regexes or recursion levels in parsers
- Models & metrics: swap sentiment classifiers or add forecasting