GiliGold commited on
Commit
fe37b82
โ€ข
1 Parent(s): bab5c9e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -4
README.md CHANGED
@@ -46,20 +46,19 @@ model = AutoModelForMaskedLM.from_pretrained("GiliGold/Knesset-DictaBERT")
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
- # The [MASK] token is the 5th token in the sentence (including [CLS])
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