The Architecture
We built the frontend and core application in Laravel - our stack of choice for complex web applications. For the actual detection engine, we moved the heavy lifting to Python.
Why Python? Because the NLP (Natural Language Processing) libraries available in Python - specifically for Arabic text processing - are far more mature than anything available in PHP.
The result was a hybrid system:
- Laravel handles the user interface, document management, user authentication, and API layer
- Python handles the actual text comparison, similarity scoring, and language processing
The Challenges
Arabic text normalisation - Arabic has multiple forms of the same letter, different Unicode representations, and diacritics that needed to be stripped before comparison.
Performance - Comparing large documents against a database of existing documents is computationally expensive. We had to optimise heavily to keep response times acceptable.
Accuracy vs Speed - A more thorough comparison gives better results but takes longer. We built configurable sensitivity levels so users could choose their trade-off.
The Lesson
Sometimes the right tool for one part of your system is not the right tool for another. A good developer knows when to switch languages or frameworks - not out of preference, but out of practicality.
At KeyTech, we build systems that solve real, complex problems - not just standard websites. If you have a non-standard requirement, let's talk.*