Instructions to use CAUKiel/JavaBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CAUKiel/JavaBERT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="CAUKiel/JavaBERT")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("CAUKiel/JavaBERT") model = AutoModelForMaskedLM.from_pretrained("CAUKiel/JavaBERT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
model documentation
#2
by nazneen - opened
123456789101112131415161718192021---language:- codelicense: apache-2.0widget:- text: 'public [MASK] isOdd(Integer num) {if (num % 2 == 0) {return "even";} else {return "odd";}}'---## JavaBERTA BERT-like model pretrained on Java software code.### Training DataThe model was trained on 2,998,345 Java files retrieved from open source projects on GitHub. A ```bert-base-cased``` tokenizer is used by this model.### Training ObjectiveA MLM (Masked Language Model) objective was used to train this model.### Usage```pythonfrom transformers import pipelinepipe = pipeline('fill-mask', model='CAUKiel/JavaBERT')output = pipe(CODE) # Replace with Java code; Use '[MASK]' to mask tokens/words in the code.```#### Related ModelA version of this model using an uncased tokenizer is available at [CAUKiel/JavaBERT-uncased](https://huggingface.co/CAUKiel/JavaBERT-uncased).123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178---language:- codelicense: apache-2.0widget:- text: public [MASK] isOdd(Integer num) {if (num % 2 == 0) {return "even";} else{return "odd";}}---# Model Card for JavaBERTA BERT-like model pretrained on Java software code.# Model Details## Model DescriptionA BERT-like model pretrained on Java software code.- **Developed by:** Christian-Albrechts-University of Kiel (CAUKiel)- **Shared by [Optional]:** Hugging Face- **Model type:** Fill-Mask- **Language(s) (NLP):** en- **License:** Apache-2.0- **Related Models:** A version of this model using an uncased tokenizer is available at [CAUKiel/JavaBERT-uncased](https://huggingface.co/CAUKiel/JavaBERT-uncased).- **Parent Model:** BERT- **Resources for more information:**- [Associated Paper](https://arxiv.org/pdf/2110.10404.pdf)# Uses## Direct UseFill-Mask## Downstream Use [Optional]More information needed.## Out-of-Scope UseThe model should not be used to intentionally create hostile or alienating environments for people.# Bias, Risks, and LimitationsSignificant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups.## RecommendationsUsers (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.{ see paper= word something)# Training Details## Training DataThe model was trained on 2,998,345 Java files retrieved from open source projects on GitHub. A ```bert-base-cased``` tokenizer is used by this model.## Training Procedure### Training ObjectiveA MLM (Masked Language Model) objective was used to train this model.### PreprocessingMore information needed.### Speeds, Sizes, TimesMore information needed.# Evaluation## Testing Data, Factors & Metrics### Testing DataMore information needed.### Factors### MetricsMore information needed.## ResultsMore information needed.# Model ExaminationMore information needed.# Environmental ImpactCarbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).- **Hardware Type:** More information needed.- **Hours used:** More information needed.- **Cloud Provider:** More information needed.- **Compute Region:** More information needed.- **Carbon Emitted:** More information needed.# Technical Specifications [optional]## Model Architecture and ObjectiveMore information needed.## Compute InfrastructureMore information needed.### HardwareMore information needed.### SoftwareMore information needed.# Citation**BibTeX:**More information needed.**APA:**More information needed.# Glossary [optional]More information needed.# More Information [optional]More information needed.# Model Card Authors [optional]Christian-Albrechts-University of Kiel (CAUKiel) in collaboration with Ezi Ozoani and the team at Hugging Face# Model Card ContactMore information needed.# How to Get Started with the ModelUse the code below to get started with the model.<details><summary> Click to expand </summary>```pythonfrom transformers import pipelinepipe = pipeline('fill-mask', model='CAUKiel/JavaBERT')output = pipe(CODE) # Replace with Java code; Use '[MASK]' to mask tokens/words in the code.```</details>
README.md+165-8