Update README.md
Browse files
README.md
CHANGED
@@ -46,20 +46,19 @@ model = AutoModelForMaskedLM.from_pretrained("GiliGold/Knesset-DictaBERT")
|
|
46 |
|
47 |
model.eval()
|
48 |
|
49 |
-
sentence = "
|
50 |
|
51 |
# Tokenize the input sentence and get predictions
|
52 |
inputs = tokenizer.encode(sentence, return_tensors='pt')
|
53 |
output = model(inputs)
|
54 |
|
55 |
-
|
56 |
-
mask_token_index = 5
|
57 |
top_2_tokens = torch.topk(output.logits[0, mask_token_index, :], 2)[1]
|
58 |
|
59 |
# Convert token IDs to tokens and print them
|
60 |
print('\n'.join(tokenizer.convert_ids_to_tokens(top_2_tokens)))
|
61 |
|
62 |
-
# Example output:
|
63 |
|
64 |
```
|
65 |
|
|
|
46 |
|
47 |
model.eval()
|
48 |
|
49 |
+
sentence = "ืืฉ ืื ื [MASK] ืขื ืื ืืฉืืืข ืืื"
|
50 |
|
51 |
# Tokenize the input sentence and get predictions
|
52 |
inputs = tokenizer.encode(sentence, return_tensors='pt')
|
53 |
output = model(inputs)
|
54 |
|
55 |
+
mask_token_index = 3
|
|
|
56 |
top_2_tokens = torch.topk(output.logits[0, mask_token_index, :], 2)[1]
|
57 |
|
58 |
# Convert token IDs to tokens and print them
|
59 |
print('\n'.join(tokenizer.convert_ids_to_tokens(top_2_tokens)))
|
60 |
|
61 |
+
# Example output: ืืฉืืื / ืืืื
|
62 |
|
63 |
```
|
64 |
|