cb1716pics commited on
Commit
3c7eb9f
·
verified ·
1 Parent(s): 6b4fbf8

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +4 -1
  2. retrieval.py +0 -2
app.py CHANGED
@@ -5,6 +5,9 @@ from evaluation import calculate_metrics
5
  from data_processing import load_recent_questions, save_recent_question
6
  import time
7
  import matplotlib.pyplot as plt
 
 
 
8
 
9
  # Page Title
10
  st.title("RAG7 - Real World RAG System")
@@ -118,7 +121,7 @@ if recent_questions and "questions" in recent_questions and recent_questions["qu
118
  for q in recent_qns: # Show latest first
119
  st.sidebar.write(f"🔹 {q['question']}")
120
  else:
121
- st.sidebar.write("No recent questions")
122
 
123
  if st.button("Submit"):
124
  start_time = time.time()
 
5
  from data_processing import load_recent_questions, save_recent_question
6
  import time
7
  import matplotlib.pyplot as plt
8
+ import nltk
9
+
10
+ nltk.download('punkt')
11
 
12
  # Page Title
13
  st.title("RAG7 - Real World RAG System")
 
121
  for q in recent_qns: # Show latest first
122
  st.sidebar.write(f"🔹 {q['question']}")
123
  else:
124
+ st.sidebar.title("No recent questions")
125
 
126
  if st.button("Submit"):
127
  start_time = time.time()
retrieval.py CHANGED
@@ -13,8 +13,6 @@ reranker = CrossEncoder("cross-encoder/ms-marco-MiniLM-L-6-v2")
13
 
14
  retrieved_docs = None
15
 
16
- nltk.download('punkt')
17
-
18
  # Tokenize the documents and remove punctuation
19
  def preprocess(doc):
20
  return [word.lower() for word in word_tokenize(doc) if word not in string.punctuation]
 
13
 
14
  retrieved_docs = None
15
 
 
 
16
  # Tokenize the documents and remove punctuation
17
  def preprocess(doc):
18
  return [word.lower() for word in word_tokenize(doc) if word not in string.punctuation]