emrecan commited on
Commit
dcc574b
·
1 Parent(s): d85b7d4

try to fix overlapping cols

Browse files
Files changed (1) hide show
  1. app.py +42 -40
app.py CHANGED
@@ -24,45 +24,47 @@ if method_selection == METHOD_OPTIONS["nsp"]:
24
 
25
  st.header("Configure prompts and labels")
26
  col1, col2 = st.columns(2)
27
- col1.subheader("Candidate labels")
28
- labels = col1.text_area(
29
- label="These are the labels that the model will try to predict for the given text input. Your input labels should be comma separated and meaningful.",
30
- value="spor,dünya,siyaset,ekonomi,kültür ve sanat",
31
- )
32
- col2.subheader("Prompt template")
33
- prompt_template = col2.text_area(
34
- label="Prompt template is used to transform NLI and NSP tasks into a general-use zero-shot classifier. Models replace {} with the labels that you have given.",
35
- value="Bu metin {} kategorisine aittir",
36
- )
37
 
38
- col1.header("Make predictions")
39
- col2.header("")
40
- col1.text_area("", value="Enter some text to classify.")
41
- col1.button("Predict")
 
 
 
 
 
42
 
43
- probs = [0.86, 0.10, 0.01, 0.02, 0.01]
44
- data = pd.DataFrame({"labels": labels.split(","), "probability": probs}).sort_values(
45
- by="probability", ascending=False
46
- )
47
- chart = px.bar(
48
- data,
49
- x="probability",
50
- y="labels",
51
- color="labels",
52
- orientation="h",
53
- height=290,
54
- width=500,
55
- ).update_layout(
56
- {
57
- "xaxis": {"title": "probability", "visible": True, "showticklabels": True},
58
- "yaxis": {"title": None, "visible": True, "showticklabels": True},
59
- "margin": dict(
60
- l=10, # left
61
- r=10, # right
62
- t=50, # top
63
- b=10, # bottom
64
- ),
65
- "showlegend": False,
66
- }
67
- )
68
- col2.plotly_chart(chart)
 
 
 
 
 
 
 
 
24
 
25
  st.header("Configure prompts and labels")
26
  col1, col2 = st.columns(2)
 
 
 
 
 
 
 
 
 
 
27
 
28
+ with col1:
29
+ st.subheader("Candidate labels")
30
+ labels = st.text_area(
31
+ label="These are the labels that the model will try to predict for the given text input. Your input labels should be comma separated and meaningful.",
32
+ value="spor,dünya,siyaset,ekonomi,kültür ve sanat",
33
+ )
34
+ st.header("Make predictions")
35
+ st.text_area("", value="Enter some text to classify.")
36
+ st.button("Predict")
37
 
38
+ with col2:
39
+ st.subheader("Prompt template")
40
+ prompt_template = st.text_area(
41
+ label="Prompt template is used to transform NLI and NSP tasks into a general-use zero-shot classifier. Models replace {} with the labels that you have given.",
42
+ value="Bu metin {} kategorisine aittir",
43
+ )
44
+ st.header("")
45
+ probs = [0.86, 0.10, 0.01, 0.02, 0.01]
46
+ data = pd.DataFrame(
47
+ {"labels": labels.split(","), "probability": probs}
48
+ ).sort_values(by="probability", ascending=False)
49
+ chart = px.bar(
50
+ data,
51
+ x="probability",
52
+ y="labels",
53
+ color="labels",
54
+ orientation="h",
55
+ height=290,
56
+ width=500,
57
+ ).update_layout(
58
+ {
59
+ "xaxis": {"title": "probability", "visible": True, "showticklabels": True},
60
+ "yaxis": {"title": None, "visible": True, "showticklabels": True},
61
+ "margin": dict(
62
+ l=10, # left
63
+ r=10, # right
64
+ t=50, # top
65
+ b=10, # bottom
66
+ ),
67
+ "showlegend": False,
68
+ }
69
+ )
70
+ st.plotly_chart(chart)