Subzero7473 commited on
Commit
2865a75
·
1 Parent(s): c9afd8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -6
app.py CHANGED
@@ -41,24 +41,31 @@ def get_transcript_sentiment(url):
41
  with gr.Blocks() as demo:
42
  gr.Markdown(
43
  """
44
- # Provide MP3 -> Whisper generates captions -> Hugging Face generates sentiment
 
 
45
  Paste the URL of an audio file (mp3) into the box and get the sentiment.
46
  """
47
  )
48
  with gr.Column(scale=1, min_width=800):
49
  text_input = gr.Text(placeholder='MP3 URL here', label='URL')
50
- df_output = gr.DataFrame(wrap=True, max_rows=10)
51
  run_btn = gr.Button('Submit')
52
  run_btn.click(fn=get_transcript_sentiment, inputs=text_input, outputs=df_output)
53
 
54
- gr.Markdown('### Example 1: [San Francisco Government Public Defender Candidate Statements](https://sanfrancisco.granicus.com/player/clip/42153?view_id=74&redirect=true&h=31a924a5a2f50ac4f57f07b44f58331c)')
55
-
 
 
 
56
  gr.Examples(
57
- [['https://archive-media2.granicus.com/OnDemand/sanfrancisco/sanfrancisco_33cae840-42ed-458b-8eaf-bd4760747ab0.mp3'], ['https://archive-media2.granicus.com/OnDemand/sanfrancisco/sanfrancisco_8c0f76b6-527a-4702-b117-ed40c1eb26fd.mp3']],
58
  [text_input],
59
  fn=get_transcript_sentiment,
60
- label='Example 1'
61
  )
62
 
 
 
63
 
64
  demo.launch()
 
41
  with gr.Blocks() as demo:
42
  gr.Markdown(
43
  """
44
+ # Provide MP3 ->
45
+ # Whisper generates captions ->
46
+ # Hugging Face generates sentiment
47
  Paste the URL of an audio file (mp3) into the box and get the sentiment.
48
  """
49
  )
50
  with gr.Column(scale=1, min_width=800):
51
  text_input = gr.Text(placeholder='MP3 URL here', label='URL')
52
+ df_output = gr.DataFrame(wrap=True, max_rows=10, headers=['Transcript Sentence', 'Sentiment', 'Score'])
53
  run_btn = gr.Button('Submit')
54
  run_btn.click(fn=get_transcript_sentiment, inputs=text_input, outputs=df_output)
55
 
56
+ gr.Markdown('''
57
+ ### Example 1:
58
+ [San Francisco Government Public Defender Candidate Statements](https://sanfrancisco.granicus.com/player/clip/42153?view_id=74&redirect=true&h=31a924a5a2f50ac4f57f07b44f58331c)
59
+ '''
60
+ )
61
  gr.Examples(
62
+ [['https://archive-media2.granicus.com/OnDemand/sanfrancisco/sanfrancisco_33cae840-42ed-458b-8eaf-bd4760747ab0.mp3'],
63
  [text_input],
64
  fn=get_transcript_sentiment,
65
+ label='Click to insert example URL'
66
  )
67
 
68
+
69
+
70
 
71
  demo.launch()