Update app.py
Browse files
app.py
CHANGED
@@ -32,12 +32,11 @@ sent += ' <mask>'
|
|
32 |
pipe = pipeline("fill-mask", tokenizer = tokenizer, model = model)
|
33 |
dict_next_words = next_word(sent, pipe)
|
34 |
df = pd.DataFrame.from_dict(dict_next_words)
|
35 |
-
df.reset_index(drop=True, inplace=True)
|
36 |
#design the graph theme
|
37 |
sns.set_theme(style="whitegrid")
|
38 |
sns.set_color_codes("pastel")
|
39 |
fig, ax = plt.subplots(figsize=(6, 15))
|
40 |
-
sns.barplot(data=df, orient = 'h')
|
41 |
st.pyplot(fig)
|
42 |
|
43 |
#st.table(df)
|
|
|
32 |
pipe = pipeline("fill-mask", tokenizer = tokenizer, model = model)
|
33 |
dict_next_words = next_word(sent, pipe)
|
34 |
df = pd.DataFrame.from_dict(dict_next_words)
|
|
|
35 |
#design the graph theme
|
36 |
sns.set_theme(style="whitegrid")
|
37 |
sns.set_color_codes("pastel")
|
38 |
fig, ax = plt.subplots(figsize=(6, 15))
|
39 |
+
sns.barplot(x='Score', y='Word', hue='level_0', data=df, orient = 'h')
|
40 |
st.pyplot(fig)
|
41 |
|
42 |
#st.table(df)
|