Spaces:
GIZ
/
Running on CPU Upgrade

prashant commited on
Commit
13272a7
1 Parent(s): 2a8e40d

semantic update

Browse files
Files changed (1) hide show
  1. utils/semantic_search.py +3 -3
utils/semantic_search.py CHANGED
@@ -119,12 +119,12 @@ def semanticsearchAnnotator(matches: List[List[int]], document):
119
  for match in matches:
120
  start_idx = match[0]
121
  end_idx = match[1]
122
- annotated_text = (annotated_text + document[start:start_idx].text
123
- + str(annotation(body=document[start_idx:end_idx].text,
124
  label="ANSWER", background="#964448", color='#ffffff')))
125
  start = end_idx
126
 
127
- annotated_text = annotated_text + document[end_idx:].text
128
 
129
  st.write(
130
  markdown(annotated_text),
 
119
  for match in matches:
120
  start_idx = match[0]
121
  end_idx = match[1]
122
+ annotated_text = (annotated_text + document[start:start_idx]
123
+ + str(annotation(body=document[start_idx:end_idx],
124
  label="ANSWER", background="#964448", color='#ffffff')))
125
  start = end_idx
126
 
127
+ annotated_text = annotated_text + document[end_idx:]
128
 
129
  st.write(
130
  markdown(annotated_text),