🚀 CodeTrans model for api recommendation generation
A pre - trained model for API recommendation generation using the T5 small model architecture, initially released in this repository.
🚀 Quick Start
The CodeTrans model is a pre - trained solution for API recommendation generation. It's based on the t5 - small
architecture and can be used to generate API usage for Java programming tasks.
✨ Features
- Based on the
t5 - small
model architecture.
- Has its own SentencePiece vocabulary model.
- Trained on the Api Recommendation Generation dataset using single - task training.
📦 Installation
No specific installation steps are provided in the original README.
💻 Usage Examples
Basic Usage
Here is how to use this model to generate java function documentation using Transformers SummarizationPipeline:
from transformers import AutoTokenizer, AutoModelWithLMHead, SummarizationPipeline
pipeline = SummarizationPipeline(
model=AutoModelWithLMHead.from_pretrained("SEBIS/code_trans_t5_small_api_generation"),
tokenizer=AutoTokenizer.from_pretrained("SEBIS/code_trans_t5_small_api_generation", skip_special_tokens=True),
device=0
)
tokenized_code = "parse the uses licence node of this package , if any , and returns the license definition if theres"
pipeline([tokenized_code])
Run this example in colab notebook.
📚 Documentation
Model description
This CodeTrans model is based on the t5 - small
model. It has its own SentencePiece vocabulary model. It used single - task training on Api Recommendation Generation dataset.
Intended uses & limitations
The model could be used to generate api usage for the java programming tasks.
Training data
The supervised training tasks datasets can be downloaded on Link
Evaluation results
For the code documentation tasks, different models achieve the following results on different programming languages (in BLEU score):
Test results :
Property |
Details |
Model Type |
CodeTrans-ST-Small, CodeTrans-ST-Base, CodeTrans-TF-Small, CodeTrans-TF-Base, CodeTrans-TF-Large, CodeTrans-MT-Small, CodeTrans-MT-Base, CodeTrans-MT-Large, CodeTrans-MT-TF-Small, CodeTrans-MT-TF-Base, CodeTrans-MT-TF-Large, State of the art |
Java BLEU Score |
68.71, 70.45, 68.90, 72.11, 73.26, 58.43, 67.97, 72.29, 69.29, 72.89, 73.39, 54.42 |
Created by Ahmed Elnaggar | LinkedIn and Wei Ding | LinkedIn