<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/an-nsfw-filter-for-marginalia-search-gqzn4pskl" -->

---
title: An NSFW filter for Marginalia Search | daily.dev
description: A developer building Marginalia Search documents their journey implementing an NSFW content filter from scratch. After finding transformer-based models too...
canonical: https://daily.dev/posts/an-nsfw-filter-for-marginalia-search-gqzn4pskl
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: An NSFW filter for Marginalia Search | daily.dev
og:description: A developer building Marginalia Search documents their journey implementing an NSFW content filter from scratch. After finding transformer-based models too...
og:url: https://daily.dev/posts/an-nsfw-filter-for-marginalia-search-gqzn4pskl
og:image: https://api.daily.dev/og/posts/GQzN4PSKL.png
og:image:alt: An NSFW filter for Marginalia Search
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# An NSFW filter for Marginalia Search

**[Hacker News](https://daily.dev/sources/hn)** · 14 min read · 2 upvotes · 0 comments

## Summary

A developer building Marginalia Search documents their journey implementing an NSFW content filter from scratch. After finding transformer-based models too slow for real-time search use, they tried fasttext but got poor results due to biased training data. They solved the labeling problem by using ollama+qwen3.5 as an LLM-based annotator to generate training samples at scale. The final solution is a single hidden layer neural network with hand-picked features and chi-squared scoring for disambiguation, implemented in Java. The post includes full math derivations for forward propagation, backpropagation, and gradient descent, plus evaluation metrics showing ~90% accuracy on training data with caveats about real-world false positive rates due to low NSFW base rates.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.marginalia.nu/log/a_134_nsfw/>

## Similar posts on daily.dev

- [How we think about text classification in the LLM era](https://daily.dev/posts/how-we-think-about-text-classification-in-the-llm-era-ccij6y48x) · Medium Engineering · 1 upvotes · 0 comments
- [Job Searcher](https://daily.dev/posts/job-searcher-jnnq5luqj) · Hugging Face · 19 upvotes · 1 comments
- [Unsloth's new desktop app does the one thing LM Studio and Ollama never let me do](https://daily.dev/posts/unsloth-s-new-desktop-app-does-the-one-thing-lm-studio-and-ollama-never-let-me-do-k73yb5rml) · XDA Developers · 1 upvotes · 0 comments
- [How Vision Language Models Are Trained from “Scratch”](https://daily.dev/posts/how-vision-language-models-are-trained-from-scratch--cptxwc95l) · Towards Data Science · 0 upvotes · 0 comments

---

Tags: [#machine-learning](https://daily.dev/tags/machine-learning), [#deep-learning](https://daily.dev/tags/deep-learning)

[View this post on daily.dev](https://daily.dev/posts/an-nsfw-filter-for-marginalia-search-gqzn4pskl)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"An NSFW filter for Marginalia Search","url":"https://daily.dev/posts/an-nsfw-filter-for-marginalia-search-gqzn4pskl","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/an-nsfw-filter-for-marginalia-search-gqzn4pskl"},"datePublished":"2026-03-30T23:19:23.916Z","dateModified":"2026-03-30T23:19:54.565Z","description":"A developer building Marginalia Search documents their journey implementing an NSFW content filter from scratch. After finding transformer-based models too...","image":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","thumbnailUrl":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/an-nsfw-filter-for-marginalia-search-gqzn4pskl","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"machine-learning,deep-learning","timeRequired":"PT14M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"An NSFW filter for Marginalia Search"}]}
```

