Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,9 @@ import pandas as pd
|
|
6 |
import numpy as np
|
7 |
import string
|
8 |
|
9 |
-
|
10 |
tokenizer = AutoTokenizer.from_pretrained("moussaKam/AraBART", max_length=128, padding=True, pad_to_max_length = True, truncation=True)
|
11 |
-
model = AutoModelForMaskedLM.from_pretrained("Hamda/test-1-finetuned-AraBART")
|
12 |
|
13 |
#@st.cache
|
14 |
def next_word(text, pipe):
|
@@ -31,7 +31,7 @@ st.checkbox('استعمال الرسم البياني', value=False)
|
|
31 |
|
32 |
text_st = sent+ ' <mask>'
|
33 |
|
34 |
-
pipe = pipeline("fill-mask", tokenizer=tokenizer, model=model, top_k=
|
35 |
dict_next_words = next_word(text_st, pipe)
|
36 |
df = pd.DataFrame.from_dict(dict_next_words)
|
37 |
df.reset_index(drop=True, inplace=True)
|
|
|
6 |
import numpy as np
|
7 |
import string
|
8 |
|
9 |
+
|
10 |
tokenizer = AutoTokenizer.from_pretrained("moussaKam/AraBART", max_length=128, padding=True, pad_to_max_length = True, truncation=True)
|
11 |
+
model = AutoModelForMaskedLM.from_pretrained("Hamda/test-1-finetuned-AraBART")
|
12 |
|
13 |
#@st.cache
|
14 |
def next_word(text, pipe):
|
|
|
31 |
|
32 |
text_st = sent+ ' <mask>'
|
33 |
|
34 |
+
pipe = pipeline("fill-mask", tokenizer=tokenizer, model=model, top_k=10)
|
35 |
dict_next_words = next_word(text_st, pipe)
|
36 |
df = pd.DataFrame.from_dict(dict_next_words)
|
37 |
df.reset_index(drop=True, inplace=True)
|