Update app.py
Browse files
app.py
CHANGED
|
@@ -55,7 +55,7 @@ def preprocess_text(text):
|
|
| 55 |
|
| 56 |
# Return the cleaned_chunks
|
| 57 |
return cleaned_chunks
|
| 58 |
-
|
| 59 |
# Load the pre-trained embedding model that converts text to vectors
|
| 60 |
model = SentenceTransformer('all-MiniLM-L6-v2')
|
| 61 |
|
|
@@ -102,7 +102,7 @@ def get_top_chunks(query, chunk_embeddings, text_chunks):
|
|
| 102 |
for indices in top_indices:
|
| 103 |
relevant_info = cleaned_chunks[indices]
|
| 104 |
top_chunks.append(relevant_info)
|
| 105 |
-
|
| 106 |
|
| 107 |
|
| 108 |
chatbot.launch()
|
|
|
|
| 55 |
|
| 56 |
# Return the cleaned_chunks
|
| 57 |
return cleaned_chunks
|
| 58 |
+
cleaned_chunks = preprocess_text(ECOsphere_text)
|
| 59 |
# Load the pre-trained embedding model that converts text to vectors
|
| 60 |
model = SentenceTransformer('all-MiniLM-L6-v2')
|
| 61 |
|
|
|
|
| 102 |
for indices in top_indices:
|
| 103 |
relevant_info = cleaned_chunks[indices]
|
| 104 |
top_chunks.append(relevant_info)
|
| 105 |
+
return top_chunks
|
| 106 |
|
| 107 |
|
| 108 |
chatbot.launch()
|