ferhataddour commited on
Commit
24e14d1
·
1 Parent(s): 139459b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -21,7 +21,10 @@ if text:
21
  top_n = 5
22
  distances = cosine_similarity(doc_embedding, candidate_embeddings)
23
  keywords = [candidates[index] for index in distances.argsort()[0][-top_n:]]
24
- st.json("Titres d'articles correspondant à votre recherche:")
 
 
 
25
  conn = sqlite3.connect('SU_CSV.db')
26
  cursor = conn.cursor()
27
 
@@ -45,5 +48,6 @@ if text:
45
 
46
  conn.close()
47
  generator = pipeline("text-generation")
48
- txt=generator(doc)
49
- st.json(txt)
 
 
21
  top_n = 5
22
  distances = cosine_similarity(doc_embedding, candidate_embeddings)
23
  keywords = [candidates[index] for index in distances.argsort()[0][-top_n:]]
24
+ json_data = {
25
+ "message": "Titres d'articles correspondant à votre recherche:"
26
+ }
27
+ st.json(json_data)
28
  conn = sqlite3.connect('SU_CSV.db')
29
  cursor = conn.cursor()
30
 
 
48
 
49
  conn.close()
50
  generator = pipeline("text-generation")
51
+ txt = generator(text)[0]["generated_text"]
52
+
53
+ st.write(txt)