Update tools/quran_search.py
Browse files- tools/quran_search.py +0 -6
tools/quran_search.py
CHANGED
@@ -8,17 +8,11 @@ class QuranSearchEngine:
|
|
8 |
self.data_loaded = False
|
9 |
|
10 |
def load_data(self):
|
11 |
-
"""Lazy load data and model"""
|
12 |
if not self.data_loaded:
|
13 |
-
# Load Quran data
|
14 |
self.quran_df = pd.read_csv("https://raw.githubusercontent.com/mafahim/quran-json/main/quran_clean.csv")
|
15 |
-
|
16 |
-
# Load model
|
17 |
self.model = SentenceTransformer(
|
18 |
'sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2'
|
19 |
)
|
20 |
-
|
21 |
-
# Pre-compute embeddings
|
22 |
self.verse_embeddings = self.model.encode(self.quran_df['text'].tolist())
|
23 |
self.data_loaded = True
|
24 |
|
|
|
8 |
self.data_loaded = False
|
9 |
|
10 |
def load_data(self):
|
|
|
11 |
if not self.data_loaded:
|
|
|
12 |
self.quran_df = pd.read_csv("https://raw.githubusercontent.com/mafahim/quran-json/main/quran_clean.csv")
|
|
|
|
|
13 |
self.model = SentenceTransformer(
|
14 |
'sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2'
|
15 |
)
|
|
|
|
|
16 |
self.verse_embeddings = self.model.encode(self.quran_df['text'].tolist())
|
17 |
self.data_loaded = True
|
18 |
|