|
import gradio as gr |
|
|
|
|
|
|
|
import chromadb |
|
client = chromadb.PersistentClient(path="chroma.db") |
|
|
|
db = client.get_collection(name="banks") |
|
|
|
|
|
|
|
|
|
def greet(issue): |
|
global db |
|
docs = db.query(query_texts=issue, n_results=5) |
|
return docs |
|
|
|
|
|
|
|
iface = gr.Interface(fn=greet, inputs="text", outputs="text", title="Leads Generation", description="""Using Sentence Embedding to inject Public ML Banks Text Dataset @ https://github.com/kevinwkc/analytics/blob/master/ai/vectorDB.py""", |
|
article=""" |
|
put in the issue regarding service, sales, point of failure, product, trend to find out what customer talking about |
|
|
|
some ideas |
|
---------- |
|
having bad client experience |
|
having credit card problem |
|
late payment fee |
|
credit score dropping |
|
""") |
|
iface.launch() |