-
Notifications
You must be signed in to change notification settings - Fork 68
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
Make everything dataset UDFs #117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few changes needed but otherwise looks good 👍 let's just make sure the output columns are consistent.
Co-authored-by: Jamie Broomall <88007022+jamie256@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments and typo fixes, I'm ok with the changes pending approval from the other reviewers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
@register_dataset_udf([_prompt], udf_name=f"{_prompt}.sentiment_nltk") | ||
def prompt_sentiment(text): | ||
return [sentiment_nltk(t) for t in text[_prompt]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return [sentiment_nltk(t) for t in text[_prompt]] | |
return list(map(sentiment_nltk, text[_prompt])) |
Use dataset UDFs instead of metric UDFs. Instead of matching on column type, just register for prompt & response columns.