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 Date and Math Tasks #88

Merged
merged 27 commits into from
Feb 21, 2024
Merged

Add Date and Math Tasks #88

merged 27 commits into from
Feb 21, 2024

Conversation

bkb2135
Copy link
Collaborator

@bkb2135 bkb2135 commented Jan 30, 2024

No description provided.

@steffencruz steffencruz mentioned this pull request Feb 4, 2024
@bkb2135 bkb2135 changed the base branch from staging to features/crawler February 5, 2024 16:12
@bkb2135 bkb2135 changed the base branch from features/crawler to staging February 5, 2024 17:24
@steffencruz
Copy link
Collaborator

My recommendation is we do date QA scoring using a gaussian function

import numpy as np
import plotly.express as px

x= linspace(0, 100,101)
error = lambda x:  np.exp(-x**2/1000)

px.line(x=x, y=error(x))

newplot - 2024-02-06T174456 995

@bkb2135 bkb2135 marked this pull request as ready for review February 7, 2024 15:14
@bkb2135 bkb2135 requested a review from p-ferreira February 7, 2024 17:55
@steffencruz
Copy link
Collaborator

@bkb2135 do we have experimental results for this?

@bkb2135
Copy link
Collaborator Author

bkb2135 commented Feb 8, 2024

@bkb2135 do we have experimental results for this?

We have wandb data (although we only have a single miner). I'm going to restart the run pulling the suggested changes, then I'll post some data

@p-ferreira p-ferreira added v1.1.0 and removed v1.0.3 labels Feb 8, 2024
@steffencruz steffencruz changed the base branch from staging to pre-staging February 16, 2024 18:54
# If the year is a digit, return the parsed date and the year in a tuple
return (parsed_date, year)
else:
raise ValueError
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to change but it seems that this raise ValueError could be a continue. Exceptions should be used for handling error conditions or unexpected situations, not for controlling normal flow of a program.

return score
ref_date = self.parse_dates_from_text(reference)
comp_date = self.parse_dates_from_text(completion)
score =np.exp(-(self.date_diff(ref_date, comp_date)**2/1000))
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to add but a small comment explaining the rationale behind this formula could be appreciated for future maintainers

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that this single file is testing multiple features (FloatDiff, DateReward). Ideally, we have unit tests by feature so it's easier to track and understand for future maintainers. Variable naming is also something that could be improved, but I know sometimes it's hard to come up with good representative names for the variables we create.

Still talking about parametrization, I think the approach of defining the used variable in the decorator is more explicit than defining variables globally to be reused.

Last but not least, it seems that there are unused references in this test, such as
DiffRewardModel, RelevanceRewardModel, RougeRewardModel, RewardPipeline

Copy link
Contributor

@p-ferreira p-ferreira left a comment

Choose a reason for hiding this comment

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

I added a couple of suggestions around improving code quality but the core of the functionality seems to be there

@steffencruz
Copy link
Collaborator

Tracked experiment

@steffencruz steffencruz merged commit 1200586 into pre-staging Feb 21, 2024
3 checks passed
@steffencruz steffencruz mentioned this pull request Feb 21, 2024
@bkb2135 bkb2135 deleted the features/task-expansion branch March 13, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants