dengkane commited on
Commit
2c5540d
1 Parent(s): 7b79b5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,7 +10,7 @@ import numpy as np
10
  model = SentenceTransformer("moka-ai/m3e-base")
11
 
12
  # Encode the documents into embeddings
13
- documents = ["Document 1", "Document 2", "Document 3"]
14
  document_embeddings = model.encode(documents)
15
 
16
  # Store the embeddings to FAISS
@@ -18,7 +18,7 @@ index = faiss.IndexFlatIP(document_embeddings.shape[1])
18
  index.add(document_embeddings)
19
 
20
  # Encode the query into an embedding
21
- query = "2"
22
  query_embedding = model.encode([query])[0]
23
 
24
  # Search the FAISS index for the most similar document
 
10
  model = SentenceTransformer("moka-ai/m3e-base")
11
 
12
  # Encode the documents into embeddings
13
+ documents = ["班车线路", "兴趣小组", "财务报销"]
14
  document_embeddings = model.encode(documents)
15
 
16
  # Store the embeddings to FAISS
 
18
  index.add(document_embeddings)
19
 
20
  # Encode the query into an embedding
21
+ query = "报销餐费"
22
  query_embedding = model.encode([query])[0]
23
 
24
  # Search the FAISS index for the most similar document