Izza-shahzad-13
commited on
Commit
•
ac7075c
1
Parent(s):
e00a19f
Update app.py
Browse files
app.py
CHANGED
@@ -69,7 +69,7 @@ dataset = load_dataset("Amod/mental_health_counseling_conversations")["train"]
|
|
69 |
def embed_dataset(_dataset):
|
70 |
embeddings = []
|
71 |
for entry in _dataset:
|
72 |
-
embedding = retrieve_embedding(entry["
|
73 |
if embedding is not None:
|
74 |
embeddings.append(embedding)
|
75 |
return embeddings
|
@@ -88,7 +88,7 @@ def retrieve_response(user_query, dataset, dataset_embeddings, k=5):
|
|
88 |
|
89 |
retrieved_responses = []
|
90 |
for idx in top_indices:
|
91 |
-
retrieved_responses.append(dataset[idx]["
|
92 |
return retrieved_responses
|
93 |
|
94 |
# Streamlit app UI
|
|
|
69 |
def embed_dataset(_dataset):
|
70 |
embeddings = []
|
71 |
for entry in _dataset:
|
72 |
+
embedding = retrieve_embedding(entry["Response"])
|
73 |
if embedding is not None:
|
74 |
embeddings.append(embedding)
|
75 |
return embeddings
|
|
|
88 |
|
89 |
retrieved_responses = []
|
90 |
for idx in top_indices:
|
91 |
+
retrieved_responses.append(dataset[idx]["Response"])
|
92 |
return retrieved_responses
|
93 |
|
94 |
# Streamlit app UI
|