roncc13 commited on
Commit
547c955
·
verified ·
1 Parent(s): 9d47642

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +77 -78
app.py CHANGED
@@ -59,84 +59,83 @@ with gr.Blocks(fill_height=True) as demo:
59
  """
60
  )
61
  # Main two-column layout
62
- gr.HTML("<div style='max-width:1120px;margin:0 auto;'>")
63
- with gr.Row(elem_classes=["two-col"], equal_height=True):
64
- # Left: input card
65
- with gr.Column(scale=3):
66
- with gr.Group(elem_classes=["glass-card"]):
67
- card_start()
68
- gr.Markdown(
69
- "#### Text input\n"
70
- "Cebuano only. This tool checks linguistic patterns; it does not verify facts."
71
- )
72
- gr.Markdown(
73
- "> **Example** \n"
74
- "> “Nakadisubre og milagro nga tambal sa COVID‑19 ang usa ka local doktor, "
75
- "giingon nga walay side effects ug dili kinahanglan og bakuna.”"
76
- )
77
-
78
- # give the textbox its own margin inside the card
79
- gr.HTML("<div style='margin-top:12px;margin-bottom:14px;'>")
80
- news_text = gr.Textbox(
81
- lines=7,
82
- label="",
83
- placeholder="Paste Cebuano news text here...",
84
- )
85
- gr.HTML("</div>")
86
-
87
- with gr.Row():
88
- analyze_btn = gr.Button(
89
- "Analyze", elem_classes=["btn-primary-custom"]
90
- )
91
- clear_btn = gr.Button(
92
- "Clear", elem_classes=["btn-secondary-custom"]
93
- )
94
- gr.Markdown(
95
- "<span style='font-size:11px;opacity:0.8;'>"
96
- "Tip: Keep inputs under 1,000 characters for faster results."
97
- "</span>",
98
- container=False,
99
- )
100
- card_end()
101
-
102
- # Right: result card
103
- with gr.Column(scale=2):
104
- with gr.Group(elem_classes=["glass-card"]):
105
- card_start()
106
- gr.Markdown("#### Result")
107
- result_label_html = gr.HTML(
108
- '<span class="badge-pill badge-fake">FAKE</span>'
109
- )
110
- conf_text = gr.HTML(
111
- """
112
- <div style="display:flex;align-items:flex-end;gap:6px;margin-top:10px;">
113
- <span style="font-size:28px;font-weight:600;" id="conf-val">0.00</span>
114
- <span style="font-size:12px;opacity:0.8;">confidence</span>
115
- </div>
116
- """
117
- )
118
-
119
- # margin around the confidence bar
120
- gr.HTML("<div style='margin-top:10px;margin-bottom:10px;'>")
121
- conf_bar = gr.HTML(
122
- """
123
- <div class="conf-bar-bg">
124
- <div class="conf-bar-fill" style="width:0%;"></div>
125
- </div>
126
- """
127
- )
128
- gr.HTML("</div>")
129
-
130
- gr.Markdown(
131
- "<span style='font-size:11px;opacity:0.85;'>"
132
- "Model: CMD‑BERT (fine‑tuned BERT‑base). "
133
- "Output: Label and confidence score for the submitted text."
134
- "</span>",
135
- container=False,
136
- )
137
- card_end()
138
- gr.HTML("</div>")
139
-
140
 
141
  # backend → UI glue
142
  def analyze_ui(text):
 
59
  """
60
  )
61
  # Main two-column layout
62
+ gr.HTML("<div style='max-width:1120px;margin:0 auto;'>")
63
+ with gr.Row(elem_classes=["two-col"], equal_height=True):
64
+ # Left: input card
65
+ with gr.Column(scale=3):
66
+ with gr.Group(elem_classes=["glass-card"]):
67
+ card_start()
68
+ gr.Markdown(
69
+ "#### Text input\n"
70
+ "Cebuano only. This tool checks linguistic patterns; it does not verify facts."
71
+ )
72
+ gr.Markdown(
73
+ "> **Example** \n"
74
+ "> “Nakadisubre og milagro nga tambal sa COVID‑19 ang usa ka local doktor, "
75
+ "giingon nga walay side effects ug dili kinahanglan og bakuna.”"
76
+ )
77
+
78
+ # give the textbox its own margin inside the card
79
+ gr.HTML("<div style='margin-top:12px;margin-bottom:14px;'>")
80
+ news_text = gr.Textbox(
81
+ lines=7,
82
+ label="",
83
+ placeholder="Paste Cebuano news text here...",
84
+ )
85
+ gr.HTML("</div>")
86
+
87
+ with gr.Row():
88
+ analyze_btn = gr.Button(
89
+ "Analyze", elem_classes=["btn-primary-custom"]
90
+ )
91
+ clear_btn = gr.Button(
92
+ "Clear", elem_classes=["btn-secondary-custom"]
93
+ )
94
+ gr.Markdown(
95
+ "<span style='font-size:11px;opacity:0.8;'>"
96
+ "Tip: Keep inputs under 1,000 characters for faster results."
97
+ "</span>",
98
+ container=False,
99
+ )
100
+ card_end()
101
+
102
+ # Right: result card
103
+ with gr.Column(scale=2):
104
+ with gr.Group(elem_classes=["glass-card"]):
105
+ card_start()
106
+ gr.Markdown("#### Result")
107
+ result_label_html = gr.HTML(
108
+ '<span class="badge-pill badge-fake">FAKE</span>'
109
+ )
110
+ conf_text = gr.HTML(
111
+ """
112
+ <div style="display:flex;align-items:flex-end;gap:6px;margin-top:10px;">
113
+ <span style="font-size:28px;font-weight:600;" id="conf-val">0.00</span>
114
+ <span style="font-size:12px;opacity:0.8;">confidence</span>
115
+ </div>
116
+ """
117
+ )
118
+
119
+ # margin around the confidence bar
120
+ gr.HTML("<div style='margin-top:10px;margin-bottom:10px;'>")
121
+ conf_bar = gr.HTML(
122
+ """
123
+ <div class="conf-bar-bg">
124
+ <div class="conf-bar-fill" style="width:0%;"></div>
125
+ </div>
126
+ """
127
+ )
128
+ gr.HTML("</div>")
129
+
130
+ gr.Markdown(
131
+ "<span style='font-size:11px;opacity:0.85;'>"
132
+ "Model: CMD‑BERT (fine‑tuned BERT‑base). "
133
+ "Output: Label and confidence score for the submitted text."
134
+ "</span>",
135
+ container=False,
136
+ )
137
+ card_end()
138
+ gr.HTML("</div>")
 
139
 
140
  # backend → UI glue
141
  def analyze_ui(text):