maslionok
commited on
Commit
·
40bbaba
1
Parent(s):
a3bfb5a
fix
Browse files
app.py
CHANGED
|
@@ -67,22 +67,36 @@ with gr.Blocks(title="Solr Normalization Demo") as demo:
|
|
| 67 |
submit_btn = gr.Button("🚀 Normalize Text", variant="primary")
|
| 68 |
|
| 69 |
with gr.Column():
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
submit_btn.click(
|
| 83 |
fn=normalize,
|
| 84 |
inputs=[text_input, lang_dropdown],
|
| 85 |
outputs=output
|
| 86 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
| 67 |
submit_btn = gr.Button("🚀 Normalize Text", variant="primary")
|
| 68 |
|
| 69 |
with gr.Column():
|
| 70 |
+
with gr.Row():
|
| 71 |
+
output = gr.Textbox(
|
| 72 |
+
label="Normalized Output",
|
| 73 |
+
lines=15,
|
| 74 |
+
placeholder="Results will appear here...",
|
| 75 |
+
scale=10
|
| 76 |
+
)
|
| 77 |
+
info_btn = gr.Button("❓", size="sm", scale=1)
|
| 78 |
+
|
| 79 |
+
# Info modal/accordion for pipeline details
|
| 80 |
+
with gr.Accordion("📝 About the Pipeline", open=False, visible=False) as info_accordion:
|
| 81 |
+
gr.Markdown(
|
| 82 |
+
"""
|
| 83 |
+
- **Tokenization**: Splits text into individual tokens
|
| 84 |
+
- **Stopword Removal**: Identifies and removes common words
|
| 85 |
+
- **Language Detection**: Automatically detects text language
|
| 86 |
+
- **Normalization**: Applies language-specific text transformations
|
| 87 |
+
"""
|
| 88 |
+
)
|
| 89 |
|
| 90 |
submit_btn.click(
|
| 91 |
fn=normalize,
|
| 92 |
inputs=[text_input, lang_dropdown],
|
| 93 |
outputs=output
|
| 94 |
)
|
| 95 |
+
|
| 96 |
+
# Toggle info visibility when info button is clicked
|
| 97 |
+
info_btn.click(
|
| 98 |
+
fn=lambda: gr.Accordion(visible=True, open=True),
|
| 99 |
+
outputs=info_accordion
|
| 100 |
+
)
|
| 101 |
|
| 102 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|