All Projects → graykode → Commit Autosuggestions

graykode / Commit Autosuggestions

Licence: other
A tool that AI automatically recommends commit messages.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Commit Autosuggestions

rita
Website, documentation and examples for RiTa
Stars: ✭ 42 (-79.71%)
Mutual labels:  natural-language, text-generation
Download Tweets Ai Text Gen
Python script to download public Tweets from a given Twitter account into a format suitable for AI text generation.
Stars: ✭ 182 (-12.08%)
Mutual labels:  text-generation
Guyu
pre-training and fine-tuning framework for text generation
Stars: ✭ 144 (-30.43%)
Mutual labels:  text-generation
Textlint
The pluggable natural language linter for text and markdown.
Stars: ✭ 2,158 (+942.51%)
Mutual labels:  natural-language
Freelb
Adversarial Training for Natural Language Understanding
Stars: ✭ 147 (-28.99%)
Mutual labels:  natural-language
Programming Language Classifier
An example of how to use CreateML in Xcode 10 to create a Core ML model for classifying text
Stars: ✭ 172 (-16.91%)
Mutual labels:  natural-language
Parse English
English (natural language) parser
Stars: ✭ 137 (-33.82%)
Mutual labels:  natural-language
Deep Generative Models For Natural Language Processing
DGMs for NLP. A roadmap.
Stars: ✭ 185 (-10.63%)
Mutual labels:  text-generation
Deeplearning.ai
该存储库包含由deeplearning.ai提供的相关课程的个人的笔记和实现代码。
Stars: ✭ 181 (-12.56%)
Mutual labels:  natural-language
Vae Lagging Encoder
PyTorch implementation of "Lagging Inference Networks and Posterior Collapse in Variational Autoencoders" (ICLR 2019)
Stars: ✭ 153 (-26.09%)
Mutual labels:  text-generation
Ctrl Gce
Set up the CTRL text-generating model on Google Compute Engine with just a few console commands.
Stars: ✭ 154 (-25.6%)
Mutual labels:  text-generation
Kobe
Source code and dataset for KDD 2019 paper "Towards Knowledge-Based Personalized Product Description Generation in E-commerce"
Stars: ✭ 148 (-28.5%)
Mutual labels:  text-generation
Retext
natural language processor powered by plugins part of the @unifiedjs collective
Stars: ✭ 2,119 (+923.67%)
Mutual labels:  natural-language
Natural Regex
Create regex from natural language
Stars: ✭ 147 (-28.99%)
Mutual labels:  natural-language
Texar
Toolkit for Machine Learning, Natural Language Processing, and Text Generation, in TensorFlow. This is part of the CASL project: http://casl-project.ai/
Stars: ✭ 2,236 (+980.19%)
Mutual labels:  text-generation
Onnxt5
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.
Stars: ✭ 143 (-30.92%)
Mutual labels:  text-generation
Nlp pytorch project
Embedding, NMT, Text_Classification, Text_Generation, NER etc.
Stars: ✭ 153 (-26.09%)
Mutual labels:  text-generation
Gpt 2 Tensorflow2.0
OpenAI GPT2 pre-training and sequence prediction implementation in Tensorflow 2.0
Stars: ✭ 172 (-16.91%)
Mutual labels:  text-generation
Attention Mechanisms
Implementations for a family of attention mechanisms, suitable for all kinds of natural language processing tasks and compatible with TensorFlow 2.0 and Keras.
Stars: ✭ 203 (-1.93%)
Mutual labels:  text-generation
Crslab
CRSLab is an open-source toolkit for building Conversational Recommender System (CRS).
Stars: ✭ 183 (-11.59%)
Mutual labels:  text-generation

commit-autosuggestions

Build Status License: Apache 2.0 PyPI Downloads

Have you ever hesitated to write a commit message? Now get a commit message from Artificial Intelligence!

Abstract

CodeBERT: A Pre-Trained Model for Programming and Natural Languages introduces a pre-trained model in a combination of Program Language and Natural Language(PL-NL). It also introduces the problem of converting code into natural language (Code Documentation Generation).

diff --git a/test.py b/test.py
new file mode 100644
index 0000000..d13f441
--- /dev/null
+++ b/test.py
@@ -0,0 +1,6 @@
+
+import torch
+import argparse
+
+def add(a, b):
+    return a + b
Recommended Commit Message : Add two arguments .

We can use CodeBERT to create a model that generates a commit message when code is added. However, most code changes are not made only by add of the code, and some parts of the code are deleted.

diff --git a/test.py b/test.py
index d13f441..1b1b82a 100644
--- a/test.py
+++ b/test.py
@@ -1,6 +1,3 @@

-import torch
-import argparse
-
 def add(a, b):
     return a + b
Recommended Commit Message : Remove unused imports

To solve this problem, use a new embedding called patch_type_embeddings that can distinguish added and deleted, just as the XLM(Lample et al, 2019) used language embeddeding. (1 for added, 2 for deleted.)

Language support

Language Added Diff Data(Only Diff) Weights
Python 423k Link
JavaScript 514k Link
Go
JAVA
Ruby
PHP
  • ✅ — Supported
  • ⬜ - N/A ️

We plan to slowly conquer languages that are not currently supported. However, I also need to use expensive GPU instances of AWS or GCP to train about the above languages. Please do a simple sponsor for this! Add data is CodeSearchNet dataset.

Quick Start

To run this project, you need a flask-based inference server (GPU) and a client (commit module). If you don't have a GPU, don't worry, you can use it through Google Colab.

1. Run flask pytorch server.

Prepare Docker and Nvidia-docker before running the server.

1-a. If you have GPU machine.

Serve flask server with Nvidia Docker. Check the docker tag for programming language in here. | Language | Tag | | :------------- | :---: | | Python | py | | JavaScript | js | | Go | go | | JAVA | java | | Ruby | ruby | | PHP | php |

$ docker run -it -d --gpus 0 -p 5000:5000 graykode/commit-autosuggestions:{language}
1-b. If you don't have GPU machine.

Even if you don't have a GPU, you can still serve the flask server by using the ngrok setting in commit_autosuggestions.ipynb.

2. Start commit autosuggestion with Python client module named commit.

First, install the package through pip.

$ pip install commit

Set the endpoint for the flask server configured in step 1 through the commit configure command. (For example, if the endpoint is http://127.0.0.1:5000, set it as follows: commit configure --endpoint http://127.0.0.1:5000)

$ commit configure --help       
Usage: commit configure [OPTIONS]

Options:
  --profile TEXT   unique name for managing each independent settings
  --endpoint TEXT  endpoint address accessible to the server (example :
                   http://127.0.0.1:5000/)  [required]

  --help           Show this message and exit.

All setup is done! Now, you can get a commit message from the AI with the command commit.

$ commit --help          
Usage: commit [OPTIONS] COMMAND [ARGS]...

Options:
  --profile TEXT       unique name for managing each independent settings
  -f, --file FILENAME  patch file containing git diff (e.g. file created by
                       `git add` and `git diff --cached > test.diff`)

  -v, --verbose        print suggested commit message more detail.
  -a, --autocommit     automatically commit without asking if you want to
                       commit

  --help               Show this message and exit.

Commands:
  configure

Training detail

Refer How to train for your lint style. This allows you to re-fine tuning to your repository's commit lint style.

Contribution

You can contribute anything, even a typo or code in the article. Don't hesitate!!. Versions are managed only within the branch with the name of each version. After being released on Pypi, it is merged into the master branch and new development proceeds in the upgraded version branch.

Author

Tae Hwan Jung(@graykode)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].