Skip to content

Commit

Permalink
added end date calculation based on pevious info
Browse files Browse the repository at this point in the history
  • Loading branch information
tkv29 committed Jan 16, 2024
1 parent c0ef120 commit 9f06697
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
from tracex.extraction.prototype import function_calls as fc
from tracex.extraction.prototype import prompts as p

text = open(u.input_path / "journey_synth_covid_0.txt").read()
text = open(u.input_path / "journey_synth_covid_1.txt").read()
df = ih.convert_text_to_bulletpoints(text)
print(df)
df = ih.add_start_dates(text, df)
# df = ih.add_end_dates(text, df)
df = ih.add_end_dates(text, df)
# df = ih.add_durations(text, df)
# df = ih.add_event_types(df)
# df = ih.add_locations(df)
Expand Down
2 changes: 1 addition & 1 deletion tracex/extraction/prototype/input_inquiry.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def create_patient_journey():
{"role": "system", "content": p.create_patient_journey_context()},
{"role": "user", "content": p.CREATE_PATIENT_JOURNEY_PROMPT},
]
patient_journey_txt = u.query_gpt(messages, u.TEMPERATURE_CREATION)
patient_journey_txt = u.query_gpt(messages=messages, temperature=u.TEMPERATURE_CREATION)
i = 0
proposed_filename = "journey_synth_covid_" + str(i) + ".txt"
output_path = u.input_path / proposed_filename
Expand Down
4 changes: 3 additions & 1 deletion tracex/extraction/prototype/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ def life_circumstances_prompt(sex):
Only return the date! Nothing else!
"""
END_DATE_PROMPT = """
Here is the text and the bulletpoint with the start date for which you should extract end date in the format YYYYMMDD with the postfix T0000!
Here is the text and the bulletpoint with the start date for which you should extract the end date in the format YYYYMMDD with the postfix T0000!
In case that you are not able to find a end date return the term "N/A". Only use the format YYYYMMDDTHHMM e.g. 20200401T0000!
Explain step by step your conclusions if the end date YYYYMMDDTHHMM is available, if not calculate the average time of the activity and add this on the start date resulting as the end date.
"""
END_DATE_ANSWER = """
For example for the text 'Four days after the first april 2020 I went to the doctor and got tested positive for Covid19. I was then hospitalized for two weeks.'
Expand Down

0 comments on commit 9f06697

Please sign in to comment.