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

Get filters metadata. #61

Open
galachad opened this issue Feb 4, 2025 · 0 comments
Open

Get filters metadata. #61

galachad opened this issue Feb 4, 2025 · 0 comments
Assignees

Comments

@galachad
Copy link
Member

galachad commented Feb 4, 2025

We represent a filter as an unnamed list. It will be nice to read the meta information from the filters and prepare the dataset for consumption by LLM.

It should be possible to read the information from step or from cohort metadata using the id or name of the filter.

Example:

# Create binding keys
librarian_source <- cohortBuilder::set_source(
  cohortBuilder::as.tblist(librarian),
  binding_keys = cohortBuilder::bind_keys(
    cohortBuilder::bind_key(
      update = cohortBuilder::data_key('books', 'isbn'),
      cohortBuilder::data_key('issues', 'isbn'),
      activate = TRUE
    ),
    cohortBuilder::bind_key(
      update = cohortBuilder::data_key('issues', 'isbn'),
      cohortBuilder::data_key('books', 'isbn'),
      activate = TRUE
    )
  )
) %>%
  shinyCohortBuilder::autofilter(attach_as = "meta")

coh <- librarian_source %>%
  cohortBuilder::cohort()

The filters are store in meta information of cohort.

coh$attributes$available_filters

Image

It's unnamed list.

We need to implement functions that allow us:

  • getting metadata of single filter by name(for example dataset and name) or id
  • getting metadata of dataset
  • the output should be grouped by dataset
  • predefine function to return the list of the text description for llm model

Example prompt optimalization:

  • Similarity search on filters base on user prompt

Minimal example:

`study` - The description of study dataset
The `study` dataset contains filters:
- `id(name)` - Unique idetifier of study - Filter id: `filter_id`
- `study_number(name)` - Description of the study number - Filter id: `filter_id` 

`other_dataset` - Other dataset description
- `id(name)` - Unique idetifier of id - Filter id: `filter_id`
- `custom_val(name)` - Description of `custom_val` - Filter id: `filter_id`
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

No branches or pull requests

2 participants