Skip to content

refactor citation score filtering #105

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sumukshashidhar
Copy link
Member

Summary

  • refactor citation score filtering pipeline
  • add dataclasses and type hints
  • improve logging and error handling

beta: float = 0.3


def _get_stage_config(config: dict[str, Any]) -> StageConfig:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we try to simplify this with StageConfig(**cfg) for brevity? This can raise a TypeError if any expected key is missing, but it can be a better way to delegate default values to the dataclass and keep the logic cleaner, if we're confident the config is well-formed

Kinda like this:

def _get_stage_config(config: dict[str, Any]) -> StageConfig:
    return StageConfig(**config.get("pipeline", {}).get("citation_score_filtering", {}))

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.

2 participants