A markov-chain based sentence generation library.
$ dotnet add package vomarkA markov-chain based random sentence generator library. Create a "brain" that you can feed a vocabulary and reproduce sentences! NOTE: This is NOT an LLM, and does not use any other data than what you specifically answer. It literally only uses the words you give it and reproduces patterns given a vocabulary.
Vomark can be installed as a NuGet package:
Install-Package vomark
YouTube integration features are dependent on YoutubeDLSharp, and conversely require yt-dlp and ffmpeg.
Both packages can be installed within the library by running the following:
bool success = await YTIntegration.SetupPackages(path);
Creating a fresh VomBrain:
VomBrain vb = new();
Adding a graph to a VomBrain:
string ex = "This is an example string."
vb.AddNewGraph("example", ex);
// Existing graphs can append data as such:
string ex2 = "This is a second string."
vb.AddThoughtRaw("example", ex2);
When using .txt files, instead use AddThoughtTxt() and use the path instead of the data.
Returning a sentence from the VomBrain:
Console.WriteLine(vb.FormThought("example"));
When forming sentences from a VomBrain, it uses the maximum word length from the associated settings object as well as capitalization/punctuation from the context object.
Changing the settings and context:
vb.Settings = new(
ytDl: "../ytlibs",
ytOut = "../vidOut",
subLang = "en",
maxLen = 16
);
VomContext Angry = new(
"angry", Punctuation.TRIPEXC, Capitalization.ALLCAPS
);
vb.Context = Angry;
If YoutubeDLSharp and all dependencies are installed, then you can use YouTube videos and playlists as data sources for VomBrains. When using YT features, ensure that your VomBrain settings are applied correctly. This ensures that your ytDl points to the folder containing yt-dlp.exe and ffmpeg.exe.
The vomark library requires that a YouTube video have at least one SRT file in the given language in order to be read. Many automated subtitles will work fine with vomark, but custom-made subtitles are not forced to follow any particular standard. All text between brackets and parentheses are removed, so sentence structures may become awkward. YouTube automatically censors certain language, so it can create gaps in speech and unexpected connections between words.
Adding a YouTube video to a graph:
await vb.AddThoughtYt("example", "example_url_");
// Adding a playlist follows the same format, but uses
// await vb.AddThoughtPlaylistYt("example", "example_url_");
Testing is implemented locally in a separate project using xUnit.
This project is licensed under the BSD-3 Claude License