CodeBERTa is a RoBERTa-like model trained on the
CodeSearchNet
dataset from GitHub.
Supported languages:
"go"
"java"
"javascript"
"php"
"python"
"ruby"
The
tokenizer
is a Byte-level BPE tokenizer trained on the corpus using Hugging Face
tokenizers
.
Because it is trained on a corpus of code (vs. natural language), it encodes the corpus efficiently (the sequences are between 33% to 50% shorter, compared to the same corpus tokenized by gpt2/roberta).
The (small)
model
is a 6-layer, 84M parameters, RoBERTa-like Transformer model – that’s the same number of layers & heads as DistilBERT – initialized from the default initialization settings and trained from scratch on the full corpus (~2M functions) for 5 epochs.
Just for fun, let's try to mask natural language (not code):
fill_mask("My name is <mask>.")
# {'sequence': '<s> My name is undefined.</s>', 'score': 0.2548016905784607, 'token': 3353}# {'sequence': '<s> My name is required.</s>', 'score': 0.07290805131196976, 'token': 2371}# {'sequence': '<s> My name is null.</s>', 'score': 0.06323737651109695, 'token': 469}# {'sequence': '<s> My name is name.</s>', 'score': 0.021919190883636475, 'token': 652}# {'sequence': '<s> My name is disabled.</s>', 'score': 0.019681859761476517, 'token': 7434}
This (kind of) works because code contains comments (which contain natural language).
Of course, the most frequent name for a Computer scientist must be undefined 🤓.
@article{husain_codesearchnet_2019,
title = {{CodeSearchNet} {Challenge}: {Evaluating} the {State} of {Semantic} {Code} {Search}},
shorttitle = {{CodeSearchNet} {Challenge}},
url = {http://arxiv.org/abs/1909.09436},
urldate = {2020-03-12},
journal = {arXiv:1909.09436 [cs, stat]},
author = {Husain, Hamel and Wu, Ho-Hsiang and Gazit, Tiferet and Allamanis, Miltiadis and Brockschmidt, Marc},
month = sep,
year = {2019},
note = {arXiv: 1909.09436},
}
Runs of huggingface CodeBERTa-small-v1 on huggingface.co
33.1K
Total runs
0
24-hour runs
-446
3-day runs
-13.3K
7-day runs
-15.2K
30-day runs
More Information About CodeBERTa-small-v1 huggingface.co Model
CodeBERTa-small-v1 huggingface.co
CodeBERTa-small-v1 huggingface.co is an AI model on huggingface.co that provides CodeBERTa-small-v1's model effect (), which can be used instantly with this huggingface CodeBERTa-small-v1 model. huggingface.co supports a free trial of the CodeBERTa-small-v1 model, and also provides paid use of the CodeBERTa-small-v1. Support call CodeBERTa-small-v1 model through api, including Node.js, Python, http.
CodeBERTa-small-v1 huggingface.co is an online trial and call api platform, which integrates CodeBERTa-small-v1's modeling effects, including api services, and provides a free online trial of CodeBERTa-small-v1, you can try CodeBERTa-small-v1 online for free by clicking the link below.
huggingface CodeBERTa-small-v1 online free url in huggingface.co:
CodeBERTa-small-v1 is an open source model from GitHub that offers a free installation service, and any user can find CodeBERTa-small-v1 on GitHub to install. At the same time, huggingface.co provides the effect of CodeBERTa-small-v1 install, users can directly use CodeBERTa-small-v1 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.