AMR-KELEG commited on
Commit
e8bd368
·
1 Parent(s): ee5cc5d

Remove the tabs

Browse files
Files changed (1) hide show
  1. app.py +29 -31
app.py CHANGED
@@ -107,43 +107,41 @@ def render_metadata():
107
  # render_svg(open("assets/ALDi_logo.svg").read())
108
  render_metadata()
109
 
110
- tab1= st.tabs(["Input a Sentence"])
111
 
112
- with tab1:
113
- sent = st.text_input(
114
- "Arabic Sentence:", placeholder="Enter an Arabic sentence.", on_change=None
115
- )
116
 
117
- # TODO: Check if this is needed!
118
- clicked = st.button("Submit")
119
 
120
- if sent:
121
- valid_dialects = predict_binary_outcomes(model, tokenizer, sent)
122
 
123
- ORANGE_COLOR = "#FF8000"
124
- fig, ax = plt.subplots(figsize=(8, 1))
125
- fig.patch.set_facecolor("none")
126
- ax.set_facecolor("none")
127
 
128
- ax.spines["left"].set_color(ORANGE_COLOR)
129
- ax.spines["bottom"].set_color(ORANGE_COLOR)
130
- ax.tick_params(axis="x", colors=ORANGE_COLOR)
131
 
132
- ax.spines[["right", "top"]].set_visible(False)
133
 
134
- dialect_labels = [int(dialect in valid_dialects) for dialect in DIALECTS]
135
- im = ax.imshow(dialect_labels, cmap="vanimo", alpha=0.5, vmin=0, vmax=1, annot=False)
136
- ax.set_yticks(range(len(DIALECTS)))
137
- ax.set_yticklabels(DIALECTS, fontsize=8)
138
- ax.set_xticks([])
139
- ax.set_title("Valid Dialects", color=ORANGE_COLOR)
140
 
141
- # ax.barh(y=[0], width=[ALDi_score], color=ORANGE_COLOR)
142
- # ax.set_xlim(0, 1)
143
- # ax.set_ylim(-1, 1)
144
- # ax.set_title(f"ALDi score is: {round(ALDi_score, 3)}", color=ORANGE_COLOR)
145
- # ax.get_yaxis().set_visible(False)
146
- # ax.set_xlabel("ALDi score", color=ORANGE_COLOR)
147
- st.pyplot(fig)
148
 
149
- print(sent)
 
107
  # render_svg(open("assets/ALDi_logo.svg").read())
108
  render_metadata()
109
 
 
110
 
111
+ sent = st.text_input(
112
+ "Arabic Sentence:", placeholder="Enter an Arabic sentence.", on_change=None
113
+ )
 
114
 
115
+ # TODO: Check if this is needed!
116
+ clicked = st.button("Submit")
117
 
118
+ if sent:
119
+ valid_dialects = predict_binary_outcomes(model, tokenizer, sent)
120
 
121
+ ORANGE_COLOR = "#FF8000"
122
+ fig, ax = plt.subplots(figsize=(8, 1))
123
+ fig.patch.set_facecolor("none")
124
+ ax.set_facecolor("none")
125
 
126
+ ax.spines["left"].set_color(ORANGE_COLOR)
127
+ ax.spines["bottom"].set_color(ORANGE_COLOR)
128
+ ax.tick_params(axis="x", colors=ORANGE_COLOR)
129
 
130
+ ax.spines[["right", "top"]].set_visible(False)
131
 
132
+ dialect_labels = [int(dialect in valid_dialects) for dialect in DIALECTS]
133
+ im = ax.imshow(dialect_labels, cmap="vanimo", alpha=0.5, vmin=0, vmax=1, annot=False)
134
+ ax.set_yticks(range(len(DIALECTS)))
135
+ ax.set_yticklabels(DIALECTS, fontsize=8)
136
+ ax.set_xticks([])
137
+ ax.set_title("Valid Dialects", color=ORANGE_COLOR)
138
 
139
+ # ax.barh(y=[0], width=[ALDi_score], color=ORANGE_COLOR)
140
+ # ax.set_xlim(0, 1)
141
+ # ax.set_ylim(-1, 1)
142
+ # ax.set_title(f"ALDi score is: {round(ALDi_score, 3)}", color=ORANGE_COLOR)
143
+ # ax.get_yaxis().set_visible(False)
144
+ # ax.set_xlabel("ALDi score", color=ORANGE_COLOR)
145
+ st.pyplot(fig)
146
 
147
+ print(sent)