Spaces:
Sleeping
Sleeping
import gradio as gr | |
from google_search_service.search_google import GoogleSearchService | |
from summerizer_service.summarize_text import Summarizer | |
from web_scraping_service.beautiful_scrape import WebScrapingService | |
def get_google_data(search_term): | |
summaries = '' | |
search_results = GoogleSearchService().google_search(search_term) | |
for i, result in enumerate(search_results, start=1): | |
text = WebScrapingService().scrape_text_from_url(result) | |
if text: | |
summary = Summarizer().summarize_text(text) | |
summaries += summary | |
search_result = Summarizer().summarize_text(summaries) | |
return search_result | |
iface = gr.Interface(fn=get_google_data, inputs="text", outputs="text") | |
iface.launch(share=True) |