Last active
January 9, 2024 03:00
-
-
Save ZSendokame/200762cd35881bb3dc8c257dea84fdc9 to your computer and use it in GitHub Desktop.
Text prediction using your own datasets. Works by searching matches and then cutting out unnecesary segments. Still working on it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def algorithm(dataset: list, input: str, output_length: int = None) -> str: | |
matches = filter(lambda quote: input in quote, dataset) | |
processed = map(lambda quote: quote[quote.index(input):], matches) | |
return [segment[0:output_length] for segment in processed] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment