File size: 673 Bytes
78d8974
 
 
 
 
7c32196
78d8974
7c32196
78d8974
fca8bf7
 
7c32196
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
language:
- en
---
# RUN

## BERT Language Model

```python
from transformers import pipeline

model_path = "/language-ml-lab/iranian-azerbaijani-nlp/AzerBert/checkpoint-11630" 
tokenizer_path = "/language-ml-lab/iranian-azerbaijani-nlp/AzerBert"
fill_mask = pipeline("fill-mask", model=model_path, tokenizer=tokenizer_path)

example = "خارجدن یئمک گتیریلمهسینه امکان وئرمیردیلر [MASK]"
arr_example = example.split(" ")
result = fill_mask(example, arr_example)

for prediction in result:
  print("Predicted Word: ", prediction["token_str"])
  print(f"Final sentence: {prediction['sequence']}, confidence: {prediction['score']}")
```