PLangRec is a character-level deep model to recognize the programming language of source code.
PLangRec is provided as a Python desktop application, web API and web application.
Make sure you have Python installed. Then, install all the required packages:
pip install -r requirements.txt --upgrade
Make sure you have downloaded both the both common
and the desktop
folders, and they are
both subdirectories of the same parent directory (the must be sibling directories).
Finally, run PLangRec as a Python application (the model will be downloaded from the Internet, so the first execution may take minutes):
cd desktop-app
python main.py
Make sure you have Python installed. Then, install all the required packages:
pip install -r requirements.txt --upgrade
Make sure you have downloaded both the both common
and the web-api
folders, and they are
both subdirectories of the same parent directory (the must be sibling directories).
Finally, run PLangRec as a Web API (the model will be downloaded from the Internet, so the first execution may take minutes):
cd web-api
python main.py
For the web application, you need to deploy the Web API because the application consumes the API.
Steps:
- Deploy the Web API in one server.
- Download the
web-app
folder to your web server. - Modify the value of the
WEB_SERVER
variable in theindex.html
file, setting its value to the server where you have the web API (step 1).
The Web application will be ready, calling the Web API.
PLangRec uses a deep model classifier to predict the programming language from the source code.
It uses a bidirectional recurrent neural network (BRNN). We have also tried a multi-layer preceptron
architecture, but the BRNN achieved better performance.
The BRNN
and MLP
directories included in this repository include the training, validation and evaluation
of both models.