domenicrosati commited on
Commit
1137a5a
β€’
1 Parent(s): a5a19f3

snip abstracts

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -111,11 +111,11 @@ def find_source(text, docs, matched):
111
  if text in sent:
112
  new_text = sent
113
  return {
114
- 'citation_statement': "ABSTRACT: " + remove_html(doc[3]).replace('<strong class="highlight">', '').replace('</strong>', ''),
115
  'text': new_text,
116
  'from': doc[0],
117
  'supporting': doc[0],
118
- 'source_title': "ABSTRACT of " + remove_html(doc[2] or ''),
119
  'source_link': f"https://scite.ai/reports/{doc[0]}"
120
  }
121
  return None
@@ -211,7 +211,7 @@ with st.expander("Settings (strictness, context limit, top hits)"):
211
  use_reranking = st.radio(
212
  "Use Reranking? Reranking will rerank the top hits using semantic similarity of document and query.",
213
  ('yes', 'no'))
214
- top_hits_limit = st.slider('Top hits? How many documents to use for reranking. Larger is slower but higher quality', 10, 300, 100)
215
  context_lim = st.slider('Context limit? How many documents to use for answering from. Larger is slower but higher quality', 10, 300, 10)
216
 
217
  # def paraphrase(text, max_length=128):
 
111
  if text in sent:
112
  new_text = sent
113
  return {
114
+ 'citation_statement': new_text if text != new_text else remove_html(doc[3]).replace('<strong class="highlight">', '').replace('</strong>', ''),
115
  'text': new_text,
116
  'from': doc[0],
117
  'supporting': doc[0],
118
+ 'source_title': remove_html(doc[2] or ''),
119
  'source_link': f"https://scite.ai/reports/{doc[0]}"
120
  }
121
  return None
 
211
  use_reranking = st.radio(
212
  "Use Reranking? Reranking will rerank the top hits using semantic similarity of document and query.",
213
  ('yes', 'no'))
214
+ top_hits_limit = st.slider('Top hits? How many documents to use for reranking. Larger is slower but higher quality', 10, 300, 50)
215
  context_lim = st.slider('Context limit? How many documents to use for answering from. Larger is slower but higher quality', 10, 300, 10)
216
 
217
  # def paraphrase(text, max_length=128):