-
Notifications
You must be signed in to change notification settings - Fork 463
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
[DRAFT] FEAT: add superscript converter #818
base: main
Are you sure you want to change the base?
Conversation
… sample based on percentage
While working on this, I came up with a few additional options/modes for conversion:
What do you think about these? Would any of them be valuable to add? As for subscripts, I believe we could implement this by adding an optional boolean parameter to the SuperscriptConverter class. What do you think? |
SuperscriptConverter
You can see I tagged you and this PR in #822 because I think a lot of these patterns can be generalized so that we don't have to reinvent the wheel over and over again for various converters. That said, if you want to leave that for a future issue/PR that's totally fine! |
I totally agree! It 100% makes sense to generalize the common patterns first, so I think I’ll wait with this PR until that’s done |
I have an idea: maybe we could add a base class for all the simple word-level converters, like So the usage would look like this: keyword_converter = SuperscriptConverter(
mode="keywords",
keywords=['test', 'conversion']
) And in place of class ROT13Converter(WordLevelPromptConverter):
async def convert_word_async(self, word: str) -> str:
return codecs.encode(word, "rot13") The concept's commit: /commit/be8a5d972fb4e7568e11954d9c531d063766d07d |
I love it! What do others think? @rlundeen2 @nina-msft @eugeniavkim @jbolor21 @jsong468 @bashirpartovi |
Description
This PR aims to resolve #528 by adding a new converter:
SuperscriptConverter
which supports various modes for conversion.Tests and Documentation
I've added unit tests for the converter