Spaces:
Sleeping
Sleeping
import gradio as gr | |
from gpt_s import GPT | |
summary_message = ''' | |
You are a summarizer, you give a comprehensive summary of a transcription you will be provided with. | |
Give back the summary in the same langugae of the text you recieve." | |
''' | |
insights_message = ''' | |
You are an insights extractor, you give a comprehensive list of points that gives the main ideas and insights from a given transcription you will be provided with. | |
Give back the list as bullet points, with the same language of the text you receive. | |
''' | |
questions_message = ''' | |
You are a question extractor, you give a deep insightful questions about the topics and points that are mentioned in the transcription of the talk you are provided with. | |
Be critical and smart. | |
Give back the questions as a list, in the same language of the text you recieve. | |
''' | |
summ_gpt = GPT(summary_message) | |
insights_gpt = GPT(insights_message) | |
ques_gpt = GPT(questions_message) | |
def process(input_text): | |
return [summ_gpt.extract_insights(input_text), | |
insights_gpt.extract_insights(input_text), | |
ques_gpt.extract_insights(input_text)] | |
iface = gr.Interface( | |
fn=process, | |
inputs=gr.Textbox(lines=10, placeholder="Enter a big chunk of text here..."), | |
outputs=[gr.Textbox(lines=5, placeholder="Processed paragraph will appear here..."), | |
gr.Textbox(lines=5, placeholder="Processed paragraph will appear here..."), | |
gr.Textbox(lines=5, placeholder="Processed paragraph will appear here...")], | |
title="Summarizer", | |
description="This interface takes a large chunk of text and returns a processed paragraph." | |
) | |
iface.launch() |