adorkin commited on
Commit
702c8d6
·
verified ·
1 Parent(s): 538fa38

Update output format

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -20,7 +20,7 @@ def search_query(query, top_k=10):
20
 
21
  id_list = ", ".join(map(str, similar_item_ids))
22
  sql_query = f"""
23
- SELECT w.value AS word, d.value AS definition
24
  FROM definitions d
25
  JOIN words w ON d.word_id = w.word_id
26
  WHERE d.entry_id IN ({id_list})
@@ -30,13 +30,12 @@ def search_query(query, top_k=10):
30
  """
31
 
32
  results = conn.execute(sql_query).fetchdf()
33
-
34
- results["relevance_score"] = [1 - d for d in distances]
35
 
36
  return results
37
 
38
 
39
- # Example queries in natural language
40
  examples = [
41
  "väga vana mees",
42
  "очень старый дед",
 
20
 
21
  id_list = ", ".join(map(str, similar_item_ids))
22
  sql_query = f"""
23
+ SELECT w.value AS sõna, d.value AS definitsioon
24
  FROM definitions d
25
  JOIN words w ON d.word_id = w.word_id
26
  WHERE d.entry_id IN ({id_list})
 
30
  """
31
 
32
  results = conn.execute(sql_query).fetchdf()
33
+ results["#"] = list(range(1, len(results) + 1))
34
+ # results["relevance_score"] = [1 - d for d in distances]
35
 
36
  return results
37
 
38
 
 
39
  examples = [
40
  "väga vana mees",
41
  "очень старый дед",