stmnk commited on
Commit
d2d822d
·
1 Parent(s): a3ea079

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -12,11 +12,11 @@ if st.button('Run semantic question answering'):
12
  if question:
13
  try:
14
  url = f"{ES_URL}/document/_search?pretty"
15
- # payload = json.dumps({"query":{"match":{"content":"moldova"}}})
16
- payload = json.dumps({"query": {
17
- "more_like_this": { "like": question, # "What is the capital city of Netherlands?"
18
- "fields": ["content"], "min_term_freq": 1.9, "min_doc_freq": 4, "max_query_terms": 50
19
- }}})
20
  headers = {'Content-Type': 'application/json'}
21
  response = requests.request("GET", url, headers=headers, data=payload)
22
  kws_result = response.json() # print(response.text)
 
12
  if question:
13
  try:
14
  url = f"{ES_URL}/document/_search?pretty"
15
+ payload = json.dumps({"query":{"match":{"content": question}}}) # "moldova"
16
+ # payload = json.dumps({"query": {
17
+ # "more_like_this": { "like": question, # "What is the capital city of Netherlands?"
18
+ # "fields": ["content"], "min_term_freq": 1.9, "min_doc_freq": 4, "max_query_terms": 50
19
+ # }}})
20
  headers = {'Content-Type': 'application/json'}
21
  response = requests.request("GET", url, headers=headers, data=payload)
22
  kws_result = response.json() # print(response.text)