Codcat
Natural Language Processing (NLP) is a rapidly growing field that aims to help machines understand and interpret human language. With the increasing use of code repositories like Github, there is a growing need to accurately categorize program code by programming language. This is particularly important in large repositories where multiple programming languages are used, as it allows developers to easily navigate and search for specific code snippets.
The goal of this NLP project is to develop a model that can automatically categorize program code by programming language. The model will be trained on a large dataset of code snippets from various programming languages, and will use NLP techniques to extract features and patterns from the code.
The project will involve several steps, including data collection, pre-processing, feature extraction, model selection and evaluation. The dataset for the project will be sourced from various public code repositories, including GitHub, GitLab, Stackoverflow. The collected data will then be pre-processed to remove irrelevant information and to standardize the format of the code snippets. This will involve techniques such as tokenization and stop-word removal.
Once the data is pre-processed, features will be extracted from the code snippets using NLP techniques. This will involve using methods such as Bag of Words (BoW), Term Frequency-Inverse Document Frequency (TF-IDF), and Embeddings to capture the semantics of the code. These features will then be used to train and evaluate several machine learning models, including Naive Bayes, RandomForest, CNN, RNN, Transformers.
The final model will be evaluated on a test set of code snippets to assess its accuracy and generalizability.
Prerequisites
On your PC with local run you must have Python >= 3.9
Installation
Install codcat with pip:
pip install codcat
or with your favorite package manager.
Example
Input
from codcat.downloader import load
model = load('base-tiny')
print(model.predict(['def foo(bar): return bar', '#include <stdio.h>']))
Output
['python' 'c']
Authors
- Templin Konstantin 1qnbhd@gmail.com
Metadata
Release files for codcat 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| codcat-0.2.0.tar.gz | 2.6 MB | Without provenance | Details for codcat-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codcat-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for codcat-0.2.0-py3-none-any.whl |
Total release size: 2.6 MB
Release files / codcat-0.2.0.tar.gz
| Download URL | codcat-0.2.0.tar.gz |
|---|---|
| Size | 2.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
caa446a064c6ca4a3eef0d3bdc044fcbd1e7e30b49470d03795a62f2b3a5fc5a
|
|
BLAKE2b-256 checksum How to use checksums |
ff0e012a57e3fa782483a3901dfe9c6fdce61f1bb43589561660a5ee1b04eda1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / codcat-0.2.0-py3-none-any.whl
| Download URL | codcat-0.2.0-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39b26ddd776fa48fc1927eed2e146c9c4b1728ca64fe246e817620d206d1707c
|
|
BLAKE2b-256 checksum How to use checksums |
31f0fbf26b92b046b9c20113843fad5eda500a79d328d1234336725f34fff1f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for codcat 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.