mahsaamani
commited on
Commit
•
7c32196
1
Parent(s):
b63a997
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
* RUN
|
2 |
+
|
3 |
+
** BERT Language Model
|
4 |
+
|
5 |
+
python```
|
6 |
+
model_path = "/language-ml-lab/iranian-azerbaijani-nlp/AzerBert/checkpoint-11630"
|
7 |
+
tokenizer_path = "/language-ml-lab/iranian-azerbaijani-nlp/AzerBert"
|
8 |
+
fill_mask = pipeline("fill-mask", model=model_path, tokenizer=tokenizer_path)
|
9 |
+
|
10 |
+
example = "خارجدن یئمک گتیریلمهسینه امکان وئرمیردیلر [MASK]"
|
11 |
+
arr_example = example.split(" ")
|
12 |
+
result = fill_mask(example, arr_example)
|
13 |
+
|
14 |
+
for prediction in result:
|
15 |
+
print("Predicted Word: ", prediction["token_str"])
|
16 |
+
print(f"Final sentence: {prediction['sequence']}, confidence: {prediction['score']}")
|
17 |
+
```
|