web_scrap / app.py
vishnu23's picture
Update app.py
1bccaf9
raw
history blame
1.06 kB
import gradio as gr
from langchain.document_loaders import UnstructuredURLLoader
from langchain.text_splitter import CharacterTextSplitter
def scrap(urls):
loaders = UnstructuredURLLoader(urls=[urls])
data = loaders.load()
# Text Splitter
text_splitter = CharacterTextSplitter(separator='\n',
chunk_size=1000,
chunk_overlap=200)
docs = text_splitter.split_documents(data)
return docs
with gr.Blocks() as demo:
f=0
gr.Markdown('# <center>INTELLIGENT ANALYSIS OF DOCUMENTS DRIVEN QA CHATBOT</center>')
input=gr.Textbox(
label='Enter the website URL',
placeholder='https://kceai.com/'
)
text_button = gr.Button("Build the Bot!!!")
text_output = gr.Textbox(
label="Verify the status",
placeholder="Start Building the Bot to view the content")
text_button.click(scrap, [input], text_output)
demo.queue().launch(debug = True,
auth=("username", "password"),
)