Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/96 improve prompts #138

Merged
merged 9 commits into from
May 24, 2024
Merged

Refactor/96 improve prompts #138

merged 9 commits into from
May 24, 2024

Conversation

FR-SON
Copy link
Collaborator

@FR-SON FR-SON commented May 17, 2024

This PR improved the prompts of the preprocessor and activity labeler. In order to adapt the other prompts to these changes, the prompts of the time extractor module have also been updated.
The following changes were made…
Preprocessing:

  • increase the number of few-shot examples
  • make each of the time-related tasks in the preprocessor distinct
  • identify timestamps
  • transform holidays
  • transform general time information ('early/mid/late month/year')
  • transform relative time information ('three weeks later', in following days')
  • rename all prompts in a uniform structure
  • add step, that propagates time information throughout the text (adds the latest known timestamp up until the current point in the text to the end of every sentence)
  • refactor similar functions in preprocessor module by replacing them with one function

Cohorts:

  • set limit of two words for request responses regarding condition, preexisting condition, origin

Activity Labeler:

  • rework the prompt and increase number of few-shot examples

Time Extractor:

  • adjust prompts to deal with the propagated timestamps

In order to review this PR, please pull (make sure the database is also updated in the process) and test if any of the functionality is broken or scrutinize the prompts in the admin view directly. Determining if the changes are improvements by executing the pipeline has proven to be rather difficult.
This closes #96.

@FR-SON FR-SON marked this pull request as ready for review May 18, 2024 12:16
@FR-SON FR-SON requested a review from tkv29 May 18, 2024 12:16
@FR-SON FR-SON self-assigned this May 18, 2024
Copy link
Collaborator

@PitButtchereit PitButtchereit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know prompts are a highly critical topic, and I've left some suggestions for improvement.

@FR-SON
Copy link
Collaborator Author

FR-SON commented May 21, 2024

Maybe I should give a general disclaimer for this PR. After a lot of trial and error the prompts now make a lot more sense to a human that reads them. The concept of the preprocessing module is more clearly reflected in the prompts. However, the overall performance of the the preprocessing did not increase in a measurable level. Other factors, such as the patient journey, still have a major impact on the quality of the results

@nils-schmitt
Copy link
Collaborator

Should I wait with the review until you implemented Pits requests or should i go straight ahead?

@FR-SON
Copy link
Collaborator Author

FR-SON commented May 21, 2024

Should I wait with the review until you implemented Pits requests or should i go straight ahead?

I implemented the requested changes, aside from those that are still in discussion.

Copy link
Collaborator

@PitButtchereit PitButtchereit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still some things left to discuss.

Copy link
Collaborator

@nils-schmitt nils-schmitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, just one minor request

@FR-SON FR-SON merged commit 085a70a into main May 24, 2024
2 checks passed
@nils-schmitt nils-schmitt deleted the refactor/96-improve-prompts branch May 27, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ideas for improving prompts
5 participants