A machine learning system to detect propaganda in news articles using a hybrid backend (Python) and demo frontend (Java GUI). Built for a university course on applied AI.
The system uses the OpenAI GPT-3.5-turbo model as a semantic encoder to process input articles and extract sentence-level features. These are then passed to a neural network built with TensorFlow/Keras to classify whether the article contains propaganda techniques.
- Python 3.10 (backend)
- TensorFlow + Keras (neural network)
- OpenAI API (semantic encoding)
- spaCy + VADER (NLP and sentiment features)
- Java (JDK 20) + JavaFX (GUI demo)
- Sklearn, NumPy, Pathlib, dotenv
Make sure you have Python 3.10 and all dependencies installed.
-
Install dependencies:
pip install -r requirements.txt python -m spacy download en_core_web_sm
-
Run the classifier from the terminal:
python3 -m ANN.classify
.
├── code/
│ ├── ANN/ # Neural network code and model weights
│ ├── DATA/ # Numpy arrays with test/train labels
│ ├── DATASETS/ # Processed input feature vectors
│ ├── evaluators/ # Propaganda technique evaluators
│ ├── gui/ # Java files for GUI (JavaFX)
│ ├── src/, target/, build/ # Java build structure
│ └── Main.py # Central script (if needed for integration)
├── demo/
│ ├── propaganda_example.png # Screenshot of propaganda result
│ └── neutral_example.png # Screenshot of neutral result
├── requirements.txt # Python dependencies
├── README.md # This file
└── Propaganda_Detector_Report.pdf # University report
To run the GUI demo (JavaFX-based):
- Make sure Java JDK 20 is installed.
- Compile and run the Java code in
code/gui
or via theMain.java
file.