Update app.py
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ def proc_nouns(sen_list):
|
|
| 45 |
print("done nouns")
|
| 46 |
return noun_list
|
| 47 |
|
| 48 |
-
def sort_doc(in_list,steps_in=0,
|
| 49 |
control_json={'control':'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','char':'','leng':62}
|
| 50 |
key_cnt=len(in_list)
|
| 51 |
print(key_cnt)
|
|
@@ -161,6 +161,9 @@ def find_query(query,sen,nouns):
|
|
| 161 |
|
| 162 |
with gr.Blocks() as app:
|
| 163 |
inp = gr.Textbox(label="Paste Text",lines=10)
|
|
|
|
|
|
|
|
|
|
| 164 |
btn = gr.Button("Load Document")
|
| 165 |
with gr.Row():
|
| 166 |
query=gr.Textbox(label="Search query")
|
|
@@ -173,7 +176,7 @@ with gr.Blocks() as app:
|
|
| 173 |
with gr.Column(scale=1):
|
| 174 |
nouns=gr.JSON(label="Nouns")
|
| 175 |
search_btn.click(find_query,[query,sen,nouns],[out_box])
|
| 176 |
-
btn.click(sort_doc,[inp],[sen])
|
| 177 |
app.launch()
|
| 178 |
|
| 179 |
|
|
|
|
| 45 |
print("done nouns")
|
| 46 |
return noun_list
|
| 47 |
|
| 48 |
+
def sort_doc(in_list,steps_in=0,control=None,prev_list=None):
|
| 49 |
control_json={'control':'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','char':'','leng':62}
|
| 50 |
key_cnt=len(in_list)
|
| 51 |
print(key_cnt)
|
|
|
|
| 161 |
|
| 162 |
with gr.Blocks() as app:
|
| 163 |
inp = gr.Textbox(label="Paste Text",lines=10)
|
| 164 |
+
with gr.Row():
|
| 165 |
+
steps=gr.Slider(label="Steps",minimum=0,maximum=12,value=0)
|
| 166 |
+
control=gr.Slider(label="Control",minimum=0,maximum=32,value=0)
|
| 167 |
btn = gr.Button("Load Document")
|
| 168 |
with gr.Row():
|
| 169 |
query=gr.Textbox(label="Search query")
|
|
|
|
| 176 |
with gr.Column(scale=1):
|
| 177 |
nouns=gr.JSON(label="Nouns")
|
| 178 |
search_btn.click(find_query,[query,sen,nouns],[out_box])
|
| 179 |
+
btn.click(sort_doc,[inp,steps,control],[sen])
|
| 180 |
app.launch()
|
| 181 |
|
| 182 |
|