Slfagrouche commited on
Commit
e777fd3
1 Parent(s): 96764ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -1,5 +1,5 @@
1
  # -*- coding: utf-8 -*-
2
- """Said Lfagrouche_RAG_Based_on_ syllabi_app
3
  """
4
 
5
  import getpass
@@ -37,7 +37,7 @@ OPENAI_API_KEYY = os.getenv('OPENAI_API_KEY')
37
  MONGO_URII = os.getenv('MONGO_URI')
38
 
39
  # Append our directory path to the Python system path.
40
- directory_path = "Syllaby"
41
 
42
  sys.path.append(directory_path)
43
 
@@ -149,7 +149,7 @@ vector_search = Weaviate.from_documents(
149
 
150
  # Semantic Search.
151
  # query = "When is the spring recess at The City College of New York for Spring 2024?"
152
- query = "What are the professor names for this semester"
153
  results = vector_search.similarity_search(query=query, k=10) # 10 most similar documents.
154
 
155
  print("\n")
@@ -158,7 +158,7 @@ pprint.pprint(results)
158
 
159
  # Semantic Search with Score.
160
  # query = "When is the spring recess at The City College of New York for Spring 2024?"
161
- query = "Where is operating system exam taken?"
162
  results = vector_search.similarity_search_with_score(
163
  query = query, k = 10 # 10 most similar documents.
164
  )
@@ -216,7 +216,7 @@ rag_chain = (
216
  )
217
 
218
  # Prompt the chain.
219
- query = "What is student favourite class"
220
  answer = rag_chain.invoke(query)
221
 
222
  print("\nQuestion: " + query)
@@ -234,10 +234,10 @@ def get_response(query):
234
  return rag_chain.invoke(query)
235
 
236
  # Gradio application.
237
- with gr.Blocks(theme=Base(), title="RAG QA App Using Spring 2024 Syllabuses PDFs, Weaviate As The Vector Database, and Gradio") as demo:
238
  gr.Markdown(
239
  """
240
- # RAG Question Answering App Using PDF Files, MongoDB As The Vector Database, and Gradio
241
  """)
242
  textbox = gr.Textbox(label="Question:")
243
  with gr.Row():
@@ -252,3 +252,4 @@ with gr.Blocks(theme=Base(), title="RAG QA App Using Spring 2024 Syllabuses PDFs
252
  demo.launch(share=True)
253
 
254
 
 
 
1
  # -*- coding: utf-8 -*-
2
+ """Said Lfagrouche: RAG_QA_App_base_on_BROOKLYN_COLLEGE STUDENT_HANDBOOK_2023-2024_app
3
  """
4
 
5
  import getpass
 
37
  MONGO_URII = os.getenv('MONGO_URI')
38
 
39
  # Append our directory path to the Python system path.
40
+ directory_path = "Data"
41
 
42
  sys.path.append(directory_path)
43
 
 
149
 
150
  # Semantic Search.
151
  # query = "When is the spring recess at The City College of New York for Spring 2024?"
152
+ query = "Who is Prof. Langsam"
153
  results = vector_search.similarity_search(query=query, k=10) # 10 most similar documents.
154
 
155
  print("\n")
 
158
 
159
  # Semantic Search with Score.
160
  # query = "When is the spring recess at The City College of New York for Spring 2024?"
161
+ query = "Is there a pool in campus?"
162
  results = vector_search.similarity_search_with_score(
163
  query = query, k = 10 # 10 most similar documents.
164
  )
 
216
  )
217
 
218
  # Prompt the chain.
219
+ query = "Where is Student Center located at?"
220
  answer = rag_chain.invoke(query)
221
 
222
  print("\nQuestion: " + query)
 
234
  return rag_chain.invoke(query)
235
 
236
  # Gradio application.
237
+ with gr.Blocks(theme=Base(), title="RAG QA App base on BROOKLYN COLLEGE STUDENT HANDBOOK 2023 - 2024, Weaviate As The Vector Database, and Gradio") as demo:
238
  gr.Markdown(
239
  """
240
+ # RAG QA App base on BROOKLYN COLLEGE STUDENT HANDBOOK 2023 - 2024, Weaviate As The Vector Database, and Gradio
241
  """)
242
  textbox = gr.Textbox(label="Question:")
243
  with gr.Row():
 
252
  demo.launch(share=True)
253
 
254
 
255
+