Development of a Secure Privacy Preserving BERT-Based Extractive API Documentation Generator

Tanaka Alexander Machemedze, Monica Gondo, Arthur Ndlovu · International Journal of Computer Science and Mobile Computing · 2025

This research presents the development of a secure, privacy-preserving BERT-based extractive API documentation generator designed to automate the creation of high-quality API documentation directly from source code. Addressing limitations in existing tools such as manual dependency, structural inconsistency, hallucinations, and data privacy concerns, the proposed system leverages a fine-tuned BERT model to extract and document API components such as parameters, return types, descriptions. The architecture integrates a local Flask API for secure code preprocessing and anonymized tokenization, ensuring sensitive code remains confidential, while a React-based frontend enables real-time customization and export in formats like YAML and JSON. Evaluated on a curated dataset of 500 Python code samples, the model achieved an accuracy of 92.30%, precision of 89.70%, recall of 85.20%, and an F1 score of 87.40%, outperforming GPT-3.5 in precision and structural consistency. User testing demonstrated a 30% faster documentation workflow and 95% compliance with OpenAPI specifications. The system’s on-premise design prioritizes privacy, making it ideal for proprietary or sensitive codebases. Future work includes expanding language support and incorporating hybrid generative-extractive techniques. This research advances automated API documentation by combining deep learning with privacy-aware practices, offering a robust alternative to traditional and cloud-based tools.

Read the paper · More papers on PaperTik