Spaces:
Runtime error
Runtime error
Fawaz
commited on
Commit
•
0e25feb
1
Parent(s):
3240876
Add application file
Browse files
app.py
CHANGED
@@ -13,7 +13,6 @@ Original file is located at
|
|
13 |
using the E5 model as the embedding model and translated dataset from huggingface
|
14 |
"""
|
15 |
|
16 |
-
!pip install sentence_transformers
|
17 |
|
18 |
"""## Downloading the Embedding model"""
|
19 |
|
@@ -29,7 +28,6 @@ model = SentenceTransformer("intfloat/multilingual-e5-large").to('cuda')
|
|
29 |
|
30 |
"""## Downloading Translated data from english to arabic"""
|
31 |
|
32 |
-
!pip3 install datasets
|
33 |
from datasets import load_dataset
|
34 |
|
35 |
|
@@ -106,14 +104,6 @@ print(len(combined_list))
|
|
106 |
|
107 |
embeddings1 = model.encode(combined_list)
|
108 |
|
109 |
-
from sentence_transformers import SentenceTransformer
|
110 |
-
import nltk
|
111 |
-
nltk.download('punkt')
|
112 |
-
from nltk.tokenize import word_tokenize
|
113 |
-
import math
|
114 |
-
from scipy import spatial
|
115 |
-
import scipy
|
116 |
-
|
117 |
def semantic_search(query, embeddings1, combined_list):
|
118 |
query_embedding = model.encode(query)
|
119 |
|
|
|
13 |
using the E5 model as the embedding model and translated dataset from huggingface
|
14 |
"""
|
15 |
|
|
|
16 |
|
17 |
"""## Downloading the Embedding model"""
|
18 |
|
|
|
28 |
|
29 |
"""## Downloading Translated data from english to arabic"""
|
30 |
|
|
|
31 |
from datasets import load_dataset
|
32 |
|
33 |
|
|
|
104 |
|
105 |
embeddings1 = model.encode(combined_list)
|
106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
def semantic_search(query, embeddings1, combined_list):
|
108 |
query_embedding = model.encode(query)
|
109 |
|