tag slop
I hate tagging content. It occurs to me for a series, but never ahead of time, and they are nice to have for browsing. Let’s add slop to the web by tagging posts here with ollama!
We can create a model derived from an existing one with a ModelFile:
FROM gemma3:12b # setting a seed makes it deterministic PARAMETER seed 1337 # set temperature [higher is more creative, lower is more coherent] # PARAMETER temperature 0.1 PARAMETER temperature 1 # allow looking back further, at the cost of more memory PARAMETER num_ctx 20000 # PARAMETER num_ctx 4096 SYSTEM """You are a content tagger for text. Your will take in an article and return a terse set of tags. A tag is a single word. Tags should not be plural. Tags should be relevant to the article contents. Only respond with a single line comma-separated list of tags, such as: emacs,bspwm,colors,music,hallucination """ # give it an example of expected conversation: MESSAGE user tag this text: Cake is nice. I love cats and lately I've been thinking about the rain MESSAGE assistant cake,cats,rain
We’ll name it “tagger”:
ollama create tagger -f ../extra/modelfile.txt;
And we’re off!:
$ cat On-Emacs.org | ollama run tagger "tag the following content: \n"
emacs,programming,text-editor,lisp,customization
I’m not much of a prompt engineer, but it’s been fun (and infuriating) to see how little shifts in the system prompt affect the quality of the tagging.
Much more interesting has been HOWTO display the tags around the site. Showing generated tags on every header would get noisy fast - I’ve decided that what makes tags meaningful is there being multiple posts with a tag (it’s annoying to click a tag link and find out you are on the only relevant post already). You can see the tag cloud over at tag links, but for now only tags that have multiple posts are shown at the top of post pages.