data-scrapper / app.py
Dedisson's picture
Create app.py
cb87193 verified
raw
history blame contribute delete
386 Bytes
import gradio as gr
from scraper import scrape_site
from cleaner import clean_data
def chatbot(message, history):
if message.startswith("scrape"):
url = message.replace("scrape ", "")
data = scrape_site(url)
clean = clean_data(data)
return "\n".join(clean[:10])
return "Tape: scrape URL"
demo = gr.ChatInterface(fn=chatbot)
demo.launch()