KwabsHug commited on
Commit
42fd0f6
1 Parent(s): 7d4cd41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -4
app.py CHANGED
@@ -185,6 +185,15 @@ def splittext(string, split_positions):
185
  linenumber += 1
186
  return FinalOutput[2:]
187
 
 
 
 
 
 
 
 
 
 
188
  with gr.Blocks() as lliface:
189
  with gr.Tab("Welcome "):
190
  gr.HTML("<h1> Spaces Test - Still Undercontruction </h1> <p> You only learn when you convert things you dont know to known --> Normally Repetition is the only reliable method for everybody </p> <p> Knowledge is a Language </p> <p>LingQ is good option for per word state management</p> <p> Arrows app json creator for easy knowledge graphing and spacy POS graph? </p> <p> https://huggingface.co/spaces/RASMUS/Whisper-youtube-crosslingual-subtitles<br>, https://huggingface.co/spaces/vumichien/whisper-speaker-diarization<br> Maybe duplicate these, private them and then load into spaces? --> Whisper space for youtube, Clip Interrogator, load here and all my random functions esp. text to HTML </p>")
@@ -200,13 +209,16 @@ with gr.Blocks() as lliface:
200
  with gr.Column(scale=1):
201
  gr.TextArea(title="Macaronic Text")
202
  with gr.Row():
203
- gr.Interface()
204
  with gr.Tab("Transcribe - RASMUS Whisper"):
205
  gr.HTML("""<p>If this tab doesnt work use the link below ⬇️</p> <a href="https://huggingface.co/spaces/RASMUS/Whisper-youtube-crosslingual-subtitles">https://huggingface.co/spaces/RASMUS/Whisper-youtube-crosslingual-subtitles</a>""")
206
  gr.Interface.load("spaces/RASMUS/Whisper-youtube-crosslingual-subtitles", title="Subtitles")
207
- with gr.Tab("Chunks"):
208
- gr.Interface(fn=FrontRevSentChunk, inputs=[ChunkModeDrop, "checkbox", "text", langdest], outputs="text")
209
- gr.Interface(fn=keep_nouns_verbs, inputs=["text"], outputs="text", title="Noun and Verbs only (Plus punctuation)")
 
 
 
210
  with gr.Tab("Unique words, Hypernyms and synonyms"):
211
  gr.Interface(fn=unique_word_count, inputs="text", outputs="text", title="Wordcounter")
212
  gr.Interface(fn=SepHypandSynExpansion, inputs="text", outputs=["text", "text"], title="Word suggestions")
 
185
  linenumber += 1
186
  return FinalOutput[2:]
187
 
188
+ def create_dictionary(word_list, word_dict = {}):
189
+ for word in word_list:
190
+ key = word[:2]
191
+ if key not in word_dict:
192
+ word_dict[key] = [word]
193
+ else:
194
+ word_dict[key].append(word)
195
+ return word_dict
196
+
197
  with gr.Blocks() as lliface:
198
  with gr.Tab("Welcome "):
199
  gr.HTML("<h1> Spaces Test - Still Undercontruction </h1> <p> You only learn when you convert things you dont know to known --> Normally Repetition is the only reliable method for everybody </p> <p> Knowledge is a Language </p> <p>LingQ is good option for per word state management</p> <p> Arrows app json creator for easy knowledge graphing and spacy POS graph? </p> <p> https://huggingface.co/spaces/RASMUS/Whisper-youtube-crosslingual-subtitles<br>, https://huggingface.co/spaces/vumichien/whisper-speaker-diarization<br> Maybe duplicate these, private them and then load into spaces? --> Whisper space for youtube, Clip Interrogator, load here and all my random functions esp. text to HTML </p>")
 
209
  with gr.Column(scale=1):
210
  gr.TextArea(title="Macaronic Text")
211
  with gr.Row():
212
+ gr.Interface(fn=create_dictionary, inputs="text", outputs="text", title="Placeholder for transcript editor functions")
213
  with gr.Tab("Transcribe - RASMUS Whisper"):
214
  gr.HTML("""<p>If this tab doesnt work use the link below ⬇️</p> <a href="https://huggingface.co/spaces/RASMUS/Whisper-youtube-crosslingual-subtitles">https://huggingface.co/spaces/RASMUS/Whisper-youtube-crosslingual-subtitles</a>""")
215
  gr.Interface.load("spaces/RASMUS/Whisper-youtube-crosslingual-subtitles", title="Subtitles")
216
+ with gr.Tab("Spelling and Chunks"):
217
+ with gr.Tab("Spelling Simplification"):
218
+ gr.Interface(fn=create_dictionary, inputs="text", outputs="text", title="Sort Text by first two letters")
219
+ with gr.Tab("Chunks"):
220
+ gr.Interface(fn=FrontRevSentChunk, inputs=[ChunkModeDrop, "checkbox", "text", langdest], outputs="text")
221
+ gr.Interface(fn=keep_nouns_verbs, inputs=["text"], outputs="text", title="Noun and Verbs only (Plus punctuation)")
222
  with gr.Tab("Unique words, Hypernyms and synonyms"):
223
  gr.Interface(fn=unique_word_count, inputs="text", outputs="text", title="Wordcounter")
224
  gr.Interface(fn=SepHypandSynExpansion, inputs="text", outputs=["text", "text"], title="Word suggestions")