remotewith commited on
Commit
b4b2f4e
1 Parent(s): fe5ca0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -47,7 +47,8 @@ def audio_to_text(audio, num_speakers):
47
  embeddings = make_embeddings(path, segments, duration)
48
  add_speaker_labels(segments, embeddings, num_speakers)
49
  output = get_output(segments)
50
- return output
 
51
 
52
  def convert_to_wav(path):
53
  if path[-3:] != 'wav':
@@ -111,8 +112,8 @@ def text_to_short_summary(text):
111
 
112
  from transformers import pipeline
113
  summarizer = pipeline("summarization", model="knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
114
- text = '''The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.
115
- '''
116
  return summarizer(text)
117
 
118
  ###########################################################################
@@ -127,7 +128,8 @@ app1=gr.Interface(
127
 
128
  ],
129
  outputs=[
130
- gr.outputs.Textbox(label='Transcript')
 
131
  ]
132
  )
133
 
 
47
  embeddings = make_embeddings(path, segments, duration)
48
  add_speaker_labels(segments, embeddings, num_speakers)
49
  output = get_output(segments)
50
+ short_sum=text_to_short_summary(output)
51
+ return output,short_sum
52
 
53
  def convert_to_wav(path):
54
  if path[-3:] != 'wav':
 
112
 
113
  from transformers import pipeline
114
  summarizer = pipeline("summarization", model="knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
115
+ #text = '''The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.
116
+ #'''
117
  return summarizer(text)
118
 
119
  ###########################################################################
 
128
 
129
  ],
130
  outputs=[
131
+ (gr.outputs.Textbox(label='Transcript'),
132
+ (gr.outputs.Textbox(label='SHort_sum')))
133
  ]
134
  )
135