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

Make everything dataset UDFs #117

Merged
merged 23 commits into from
Aug 9, 2023
Merged

Make everything dataset UDFs #117

merged 23 commits into from
Aug 9, 2023

Conversation

richard-rogers
Copy link
Contributor

Use dataset UDFs instead of metric UDFs. Instead of matching on column type, just register for prompt & response columns.

langkit/textstat.py Outdated Show resolved Hide resolved
Copy link
Contributor

@andrewelizondo andrewelizondo left a 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.

langkit/nlp_scores.py Outdated Show resolved Hide resolved
langkit/themes.py Outdated Show resolved Hide resolved
langkit/themes.py Outdated Show resolved Hide resolved
langkit/textstat.py Outdated Show resolved Hide resolved
langkit/nlp_scores.py Outdated Show resolved Hide resolved
langkit/nlp_scores.py Outdated Show resolved Hide resolved
langkit/nlp_scores.py Outdated Show resolved Hide resolved
langkit/nlp_scores.py Outdated Show resolved Hide resolved
richard-rogers and others added 3 commits August 7, 2023 14:27
Co-authored-by: Jamie Broomall <88007022+jamie256@users.noreply.github.com>
Copy link
Collaborator

@jamie256 jamie256 left a 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.

langkit/topics.py Show resolved Hide resolved
langkit/topics.py Show resolved Hide resolved
langkit/sentiment.py Outdated Show resolved Hide resolved
langkit/sentiment.py Outdated Show resolved Hide resolved
langkit/textstat.py Outdated Show resolved Hide resolved
langkit/themes.py Outdated Show resolved Hide resolved
langkit/themes.py Outdated Show resolved Hide resolved
langkit/toxicity.py Outdated Show resolved Hide resolved
langkit/sentiment.py Outdated Show resolved Hide resolved
Copy link
Contributor

@andrewelizondo andrewelizondo left a 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]]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
return [sentiment_nltk(t) for t in text[_prompt]]
return list(map(sentiment_nltk, text[_prompt]))

@jamie256 jamie256 merged commit 3129051 into main Aug 9, 2023
12 checks passed
@jamie256 jamie256 deleted the dev/richard/alldataset branch August 9, 2023 16:49
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.

4 participants