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

Add post-process labels stage #4

Merged
merged 16 commits into from
Oct 5, 2024
Merged

Add post-process labels stage #4

merged 16 commits into from
Oct 5, 2024

Conversation

pmhalvor
Copy link
Owner

Final stage of the pipeline.

Will need to decide on how and what to store in the final outputs.
If we are storing all intermediate stage outputs, we can just join on key or encounter ids, to avoid storing duplicate audio data. Only need to store encounter id and pooled-classification (average).

Need to think about this a bit before implementing.

@pmhalvor pmhalvor force-pushed the add-postprocess-labels branch from 274d8ff to 50109f2 Compare October 5, 2024 07:59
Copy link
Owner Author

@pmhalvor pmhalvor left a comment

Choose a reason for hiding this comment

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

Added small fixes after reading through PR code one last time. Everything for post-processing looks good.

Next PR will tackle TODOs about rewriting outputs

src/config/common.yaml Outdated Show resolved Hide resolved
src/config/local.yaml Outdated Show resolved Hide resolved
Comment on lines +23 to +37
def create_dataset(dataset_id):
try:
dataset_path = f"{client.project}.{dataset_id}"
dataset = bigquery.Dataset(dataset_path)
dataset.location = "US"
dataset = client.create_dataset(dataset, timeout=30)
print(f"Created dataset {client.project}.{dataset.dataset_id}")
except Conflict as e:
if "Already Exists" in str(e):
dataset = client.get_dataset(dataset_id)
print(f"Dataset {client.project}.{dataset.dataset_id} already exists. Continuing.")
else:
raise e

return dataset
Copy link
Owner Author

Choose a reason for hiding this comment

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

Swap to first check if the table exists, then try to make table only when it does not, instead of the other way around, requiring a try/except.

Comment on lines +55 to +58
def run(args):
dataset = create_dataset(args.dataset_id)
table = create_table(dataset.dataset_id, args.table_id)
return table
Copy link
Owner Author

Choose a reason for hiding this comment

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

Expand to include checks for all stags that will be writing to gcp

src/model_server.py Outdated Show resolved Hide resolved
src/stages/postprocess.py Outdated Show resolved Hide resolved
src/stages/postprocess.py Outdated Show resolved Hide resolved
src/stages/postprocess.py Outdated Show resolved Hide resolved
src/stages/postprocess.py Outdated Show resolved Hide resolved
src/stages/postprocess.py Show resolved Hide resolved
@pmhalvor pmhalvor merged commit 725794e into master Oct 5, 2024
1 check passed
@pmhalvor pmhalvor mentioned this pull request Oct 7, 2024
12 tasks
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.

1 participant