catiR commited on
Commit
2dfee05
·
1 Parent(s): e2901c5

run clustering

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -40,7 +40,8 @@ def f1(voices, sent, indices):
40
  def label_indices(sentence):
41
  sentence = scripts.runSQ.snorm(sentence)
42
  sentence = sentence.split(' ')
43
- labelled = [(word, i) for i, word in enumerate(sentence)]
 
44
  return labelled
45
 
46
 
@@ -56,18 +57,19 @@ with bl:
56
  # supposedly they also provided for Karl, Dora, but i dont even get their wavs
57
  # i get everyone elses wavs tho
58
 
59
- with gr.Row():
60
  #with gr.Column(scale=4):
61
- temp_sentmenu = gr.Dropdown(temp_sentences, label="Sentence")
62
  #voiceselect = gr.CheckboxGroup(voices, label="TTS voice",value='Alfur')
63
 
64
  marked_sentence = gr.HighlightedText(interactive=False)
65
-
66
- spanselect = gr.Textbox(value='1-3',info='Enter the index of the word(s) to analyse. It can be a single word: 4 or a span of words separated by a dash: 2-3')
67
- voiceselect = gr.Radio(voices, label="TTS voice",value='Alfur')
 
68
 
69
  #with gr.Column(scale=1):
70
- temp_button = gr.Button(value="Run with selected options")
71
 
72
 
73
  tts_output = gr.Audio(interactive=False)
 
40
  def label_indices(sentence):
41
  sentence = scripts.runSQ.snorm(sentence)
42
  sentence = sentence.split(' ')
43
+ color_map = {i+1:"#dcfce7" for i in range(len(sentence))}
44
+ labelled = [(f'{word} {i+1} ', i+1) for i, word in enumerate(sentence)]
45
  return labelled
46
 
47
 
 
57
  # supposedly they also provided for Karl, Dora, but i dont even get their wavs
58
  # i get everyone elses wavs tho
59
 
60
+ #with gr.Row():
61
  #with gr.Column(scale=4):
62
+ temp_sentmenu = gr.Dropdown(temp_sentences, label="Sentence")
63
  #voiceselect = gr.CheckboxGroup(voices, label="TTS voice",value='Alfur')
64
 
65
  marked_sentence = gr.HighlightedText(interactive=False)
66
+
67
+ with gr.Row():
68
+ spanselect = gr.Textbox(value='1-3',info='Enter the index of the word(s) to analyse. It can be a single word: 4 or a span of words separated by a dash: 2-3')
69
+ voiceselect = gr.Radio(voices, label="TTS voice",value='Alfur')
70
 
71
  #with gr.Column(scale=1):
72
+ temp_button = gr.Button(value="Run with selected options")
73
 
74
 
75
  tts_output = gr.Audio(interactive=False)