File size: 1,622 Bytes
37a7b3b
4f61b51
b5f56ac
4f61b51
0add5dd
4f61b51
 
0add5dd
4f61b51
 
 
 
 
 
3609731
4f61b51
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from summarizers import Summarizers
def summarize(text, type_of_text="normal" , summary_highlight=None ):
    summ = Summarizers(type = type_of_text)
    if summary_highlight == None:
        sum= summ(text)
    else:
        sum = summ(text, query=summary_highlight)
    return  sum

demo = gr.Interface(
    fn=summarize,
    inputs=[gr.Textbox(lines=8, placeholder="Paragraph Here..."),gr.Radio(["normal", "paper", "patent"]),"text"],
    outputs="text",title="Text summarisation app",
    description="This is a summarisation app, it can prove useful when you want to summarise a text. All you need to do is copy and paste the note you want to summarise. You can also select the type of summary based on it's use case and provide the app with keywords or sentences you want your summary to focus on. ",
    examples=[
        ["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."
],
    ],
)
demo.launch()