aokitools commited on
Commit
e94b0ef
·
1 Parent(s): c517770
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -127,6 +127,12 @@ def f_jsonlines2json(e_text1):
127
 
128
  def f_sort(e_text1, e_radio1, e_checkbox1, e_checkbox2, e_checkbox3):
129
  try:
 
 
 
 
 
 
130
  b_sort1 = False
131
  if e_radio1 == "降順":
132
  b_sort1 = True
@@ -147,7 +153,9 @@ def f_sort(e_text1, e_radio1, e_checkbox1, e_checkbox2, e_checkbox3):
147
  l1 = list(set(l1))
148
  pass
149
 
150
- l1.sort(reverse=b_sort1)
 
 
151
 
152
  result = "\n".join(l1)
153
  pass
@@ -1147,7 +1155,7 @@ with gr.Blocks() as sample01:
1147
  e_checkbox1 = gr.Checkbox(label="重複排除")
1148
  e_checkbox2 = gr.Checkbox(label="前後の空白を除去")
1149
  e_checkbox3 = gr.Checkbox(label="空行除去")
1150
- e_radio1 = gr.Radio(["昇順", "降順"], value="昇順", label="sort order")
1151
 
1152
  with gr.Row():
1153
  e_button1 = gr.Button("並べ替え")
@@ -1192,7 +1200,7 @@ with gr.Blocks() as sample01:
1192
  pass
1193
  pass
1194
 
1195
- with gr.Tab("文章ベクトル(Doc2Vec)"):
1196
  e_text1 = gr.TextArea(show_label=True, label="TEXT")
1197
  e_checkbox1 = gr.Checkbox(label="1カラム目をラベルとして設定")
1198
 
@@ -1204,7 +1212,7 @@ with gr.Blocks() as sample01:
1204
  e_button1.click(f_gensim, inputs=[e_text1, e_checkbox1], outputs=[e_text2, e_text3])
1205
  pass
1206
 
1207
- with gr.Tab("文章ベクトル(GoogleSentenceEncoder)"):
1208
  e_text1 = gr.TextArea(show_label=True, label="TEXT")
1209
  e_checkbox1 = gr.Checkbox(label="1カラム目をラベルとして設定")
1210
 
 
127
 
128
  def f_sort(e_text1, e_radio1, e_checkbox1, e_checkbox2, e_checkbox3):
129
  try:
130
+ b_sort2 = True
131
+
132
+ if e_radio1 == "並べ替えしない":
133
+ b_sort2 = False
134
+ pass
135
+
136
  b_sort1 = False
137
  if e_radio1 == "降順":
138
  b_sort1 = True
 
153
  l1 = list(set(l1))
154
  pass
155
 
156
+ if b_sort2:
157
+ l1.sort(reverse=b_sort1)
158
+ pass
159
 
160
  result = "\n".join(l1)
161
  pass
 
1155
  e_checkbox1 = gr.Checkbox(label="重複排除")
1156
  e_checkbox2 = gr.Checkbox(label="前後の空白を除去")
1157
  e_checkbox3 = gr.Checkbox(label="空行除去")
1158
+ e_radio1 = gr.Radio(["並べ替えしない", "昇順", "降順"], value="並べ替えしない", label="sort order")
1159
 
1160
  with gr.Row():
1161
  e_button1 = gr.Button("並べ替え")
 
1200
  pass
1201
  pass
1202
 
1203
+ with gr.Tab("Doc2Vec"):
1204
  e_text1 = gr.TextArea(show_label=True, label="TEXT")
1205
  e_checkbox1 = gr.Checkbox(label="1カラム目をラベルとして設定")
1206
 
 
1212
  e_button1.click(f_gensim, inputs=[e_text1, e_checkbox1], outputs=[e_text2, e_text3])
1213
  pass
1214
 
1215
+ with gr.Tab("GoogleSentenceEncoder"):
1216
  e_text1 = gr.TextArea(show_label=True, label="TEXT")
1217
  e_checkbox1 = gr.Checkbox(label="1カラム目をラベルとして設定")
1218