Update README.md
Browse files
README.md
CHANGED
@@ -15,13 +15,13 @@ base_model:
|
|
15 |
```python
|
16 |
from transformers import RobertaForMaskedLM, RobertaTokenizer
|
17 |
|
18 |
-
# Load the pre-trained
|
19 |
-
model = RobertaForMaskedLM.from_pretrained("
|
20 |
-
tokenizer = RobertaTokenizer.from_pretrained("
|
21 |
|
22 |
# Example of tokenizing a code snippet
|
23 |
code_snippet = "def enumerate_items(items):"
|
24 |
-
derivation_sequence = ast2seq(code_snippet) # ast2seq implementation available https://github.com/NathanaelBeau/grammarBERT/
|
25 |
input_ids = tokenizer.encode(code_snippet, return_tensors='pt')
|
26 |
|
27 |
# Predict masked tokens or fine-tune the model as needed
|
|
|
15 |
```python
|
16 |
from transformers import RobertaForMaskedLM, RobertaTokenizer
|
17 |
|
18 |
+
# Load the pre-trained grammarBERT model and tokenizer
|
19 |
+
model = RobertaForMaskedLM.from_pretrained("Nbeau/grammarBERT")
|
20 |
+
tokenizer = RobertaTokenizer.from_pretrained("Nbeau/grammarBERT")
|
21 |
|
22 |
# Example of tokenizing a code snippet
|
23 |
code_snippet = "def enumerate_items(items):"
|
24 |
+
derivation_sequence = ast2seq(code_snippet) # ast2seq implementation available https://github.com/NathanaelBeau/grammarBERT/asdl/
|
25 |
input_ids = tokenizer.encode(code_snippet, return_tensors='pt')
|
26 |
|
27 |
# Predict masked tokens or fine-tune the model as needed
|