wzkariampuzha commited on
Commit
d548708
1 Parent(s): 5ea9a7b

Update epi_pipeline.py

Browse files
Files changed (1) hide show
  1. epi_pipeline.py +3 -3
epi_pipeline.py CHANGED
@@ -170,7 +170,7 @@ def streamlit_getAbs(searchterm_list:Union[List[str],List[int],str], maxResults:
170
  term += word + '%20'
171
  query = term[:-3]
172
 
173
- url = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term='+query+"&retmax="+str(maxResults)
174
  r = requests.get(url)
175
  root = ET.fromstring(r.content)
176
 
@@ -202,7 +202,7 @@ def streamlit_getAbs(searchterm_list:Union[List[str],List[int],str], maxResults:
202
  if filtering !='none' or filtering !='strict':
203
  filter_terms = set(searchterm_list).union(set(str(re.sub(',','',' '.join(searchterm_list))).split()).difference(STOPWORDS))
204
 
205
- for pmid in pmids:
206
  abstract = PMID_getAb(pmid)
207
  if len(abstract)>5:
208
  #do filtering here
@@ -219,7 +219,7 @@ def streamlit_getAbs(searchterm_list:Union[List[str],List[int],str], maxResults:
219
  #Else and if are separated for readability and to better understand logical flow.
220
  if set(filter_terms).intersection(set(nltk_tokenize.word_tokenize(abstract))):
221
  pmid_abs[pmid] = abstract
222
- abstracts_bar.progress(min(round(len(pmid_abs)*percent_by_step,1),1.0))
223
  abstracts_bar.empty()
224
  found = len(pmids)
225
  relevant = len(pmid_abs)
 
170
  term += word + '%20'
171
  query = term[:-3]
172
 
173
+ url = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term='+query+"&retmax="+str(int(maxResults/len(searchterm_list)))
174
  r = requests.get(url)
175
  root = ET.fromstring(r.content)
176
 
 
202
  if filtering !='none' or filtering !='strict':
203
  filter_terms = set(searchterm_list).union(set(str(re.sub(',','',' '.join(searchterm_list))).split()).difference(STOPWORDS))
204
 
205
+ for i, pmid in enumerate(pmids):
206
  abstract = PMID_getAb(pmid)
207
  if len(abstract)>5:
208
  #do filtering here
 
219
  #Else and if are separated for readability and to better understand logical flow.
220
  if set(filter_terms).intersection(set(nltk_tokenize.word_tokenize(abstract))):
221
  pmid_abs[pmid] = abstract
222
+ abstracts_bar.progress(min(round(i*percent_by_step,1),1.0))
223
  abstracts_bar.empty()
224
  found = len(pmids)
225
  relevant = len(pmid_abs)