clientX / app.py
kevinhug's picture
use case
852ba1e
raw
history blame
3.04 kB
import gradio as gr
# from langchain.vectorstores import Chroma
import chromadb
client = chromadb.PersistentClient(path="chroma.db")
db = client.get_collection(name="banks")
'''
https://huggingface.co/spaces/kevinhug/clientX
https://dash.elfsight.com
'''
counter="""
<script src="https://static.elfsight.com/platform/platform.js" data-use-service-core defer></script>
<div class="elfsight-app-5f3e8eb9-9103-490e-9999-e20aa4157dc7" data-elfsight-app-lazy></div>
"""
def similar(issue):
global db
docs = db.query(query_texts=issue, n_results=5)
return docs
'''
https://www.gradio.app/docs/interface
'''
iface = gr.Interface(fn=similar, inputs="text", outputs="json",
title="Enhancing Customer Engagement and Operational Efficiency with Semantic Similarity Document Search (SSDS)",
examples=[["having bad client experience"],
["having credit card problem"],
["late payment fee"],
["credit score dropping"]],
description="""
Data Scientist: Kevin Wong, [email protected], 416-903-7937
============
open source ml bank dataset
https://www.kaggle.com/datasets/trainingdatapro/20000-customers-reviews-on-banks/?select=Banks.csv
Using Sentence Embedding to inject Public ML Banks Text Dataset @ https://github.com/kevinwkc/analytics/blob/master/ai/vectorDB.py""",
custom_js=counter,
article="""
Description:
=======
In today's dynamic financial landscape, the Semantic Similarity Document Search (SSDS) capability is a practical innovation to improve client experience, marketing leads, and sentiment analysis. As a Data Scientist with a decades in the financial industry, I see the value of SSDS in action.
Client Experience:
------
When a client faces a bad experience, SSDS helps us swiftly locate relevant documents to understand and address their concerns, be it credit card issues, late payment fees, or credit score drops.
### issue:
- having bad client experience
- having credit card problem
- late payment fee
- credit score dropping
Marketing Leads:
------
To enhance marketing strategies, SSDS identifies market trends and consumer preferences, such as the demand for low-interest credit cards. It's a treasure trove for refining our product offerings.
### issue:
- low interest credit card
Sentiments:
------
SSDS tracks customer sentiment, empowering us to swiftly respond to upset customers. It ensures we address their issues promptly, enhancing trust and loyalty.
With no need for jargon, SSDS delivers tangible value to our fintech operations. It's about staying agile, informed, and customer-centric in a rapidly changing financial world.
### issue:
- upset customer
Future Improvement
============
tuning the distance for use case
<script src="https://static.elfsight.com/platform/platform.js" data-use-service-core defer></script>
<div class="elfsight-app-5f3e8eb9-9103-490e-9999-e20aa4157dc7" data-elfsight-app-lazy></div>
""")
iface.launch()