tannu038 commited on
Commit
64de282
·
verified ·
1 Parent(s): 8670c7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -5,9 +5,10 @@ def extract_study_timeline(text):
5
  """
6
  Extracts Screening, Treatment, and Follow-up durations from study timeline text.
7
  """
8
- screening = re.search(r'(?:Screening|Pre-study observation|Initial phase)\s*[:\-]?\s*(\d+)\s*weeks?', text)
9
- treatment = re.search(r'(?:Treatment|Intervention|Therapy|Dosing period)\s*[:\-]?\s*(\d+)\s*weeks?', text)
10
- follow_up = re.search(r'(?:Follow[-\s]*up|Recovery|Post-study phase|Monitoring period)\s*[:\-]?\s*(\d+)\s*weeks?', text)
 
11
 
12
  timeline = {
13
  "Screening": int(screening.group(1)) if screening else None,
 
5
  """
6
  Extracts Screening, Treatment, and Follow-up durations from study timeline text.
7
  """
8
+
9
+ screening = re.search(r'(?:Screening(?:\s*phase| period)?|Pre-study observation)\s*(?:of|:|-)?\s*(\d+)\s*weeks?', text, re.IGNORECASE)
10
+ treatment = re.search(r'(?:Treatment(?:\s*period)?|Intervention|Therapy|Dosing phase)\s*(?:of|:|-)?\s*(\d+)\s*weeks?', text, re.IGNORECASE)
11
+ follow_up = re.search(r'(?:Follow[-\s]*up(?:\s*phase| period)?|Recovery|Post-study monitoring)\s*(?:of|:|-)?\s*(\d+)\s*weeks?', text, re.IGNORECASE)
12
 
13
  timeline = {
14
  "Screening": int(screening.group(1)) if screening else None,