DEV Community

Cover image for Policy Phantom: Escape the Demonetization Graveyard
Nurman Awaluddin
Nurman Awaluddin

Posted on

Policy Phantom: Escape the Demonetization Graveyard

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

I initially designed this application with the intention of entering the Week 3 challenge. However, since I found out about the event late and missed the deadline, I adapted it to perfectly align with the Week 4 theme: Ghost in the Machine.

The application is called Policy Phantom, an open-source AI-based early detection tool that scans YouTube video scripts or transcripts for potential monetization policy violations before the video is uploaded. I interpreted this week's theme by analogizing the YouTube algorithm as a "phantom" that silently judges content, and this application acts as a medium to read the curse so creators can save their videos from the "demonetization graveyard."

Demo

Note: The local computer I used has fairly slow specifications for running LLM inference, so I intentionally fast-forwarded some of the loading parts in this demo video for the sake of the viewers' time efficiency.

Code

👻 Policy Phantom

Policy Phantom adalah aplikasi compliance checker berbasis open-source AI yang dirancang untuk memindai transkrip atau naskah video YouTube secara lokal. Aplikasi ini mendeteksi potensi pelanggaran pedoman monetisasi (seperti Reused Content, Synthetic/AI Content, hak cipta, dan sensitivitas bahasa) sebelum video diunggah, guna mencegah risiko demonetisasi (Demonetization Graveyard).

Proyek ini dibangun khusus untuk Hacktoberfest Challenge Week 4: "Ghost in the Machine".


💡 Why Open Innovation Matters

Pada pembuatan konten digital, isu privasi, keamanan naskah, dan biaya operasional menjadi tantangan utama:

  1. Privasi & Keamanan Konten Terjamin: Naskah dan transkrip video belum rilis kerap kali berisi ide sensitif atau kekayaan intelektual. Dengan menjalankan pemrosesan analisis secara lokal via open-weight model, data konten tidak pernah dikirim ke server pihak ketiga.
  2. Offline-First & Zero API Cost: Pengguna dapat melakukan pemindaian lengkap tanpa koneksi internet dan tanpa batas kuota/biaya API berbayar.
  3. Fleksibilitas & Transparansi: Penggunaan model open-source/open-weight memungkinkan…

results for content that needs improvement

transcript from video using openAI whisper and ffmpeg

result for good content

How I Built It

This application is built on a foundation of open-source AI to ensure entirely local execution:

  • Gemma 2 (2B): Google's open-weight model running entirely locally via Ollama. This model acts as the core brain (Policy Phantom) that evaluates the transcript text, providing a risk score and revision suggestions (Exorcism).
  • OpenAI Whisper (Tiny): Used to extract and transcribe audio locally from the uploaded video files.
  • Gradio: Used to build a retro/terminal-themed interface that fits the eerie theme, orchestrating the entire flow from video upload to visualizing risk scores (Radar Chart & Risk Meter).
  • Gemini 2.5 Flash API (Optional): This feature is executed only once at the beginning (one-time sync) purely to pull a summary of the latest YouTube policy guidelines and save them statically into a local policy.json file. Once this data sync is complete, the API feature is ignored, and the entire transcript evaluation and analysis process is handled completely offline by Gemma.
 response = requests.post('http://localhost:11434/api/generate', json={
            "model": "gemma2:2b",
            "prompt": f"{system_prompt}\n\nTranscript/Script:\n{transkrip_ringkas}",
            "options": {"temperature": 0.2},
            "stream": False
        })
Enter fullscreen mode Exit fullscreen mode

Why Does Open Innovation Matter?

For a content creator, unpublished scripts and video drafts are highly sensitive intellectual property. If using closed APIs, creators must send that raw data to third-party servers.

The open-weight approach I used (Gemma 2 and Whisper) allows this application to operate with an offline-first approach. This provides absolute assurance of content privacy, consumes zero monthly API quota costs, and frees the application from the risks of closed API services that could suddenly change, be restricted, or shut down.

The Spirit of It

The most memorable moment while developing this application was when I ran tests using old videos from several YouTube channels that had actually been hit by demonetization sanctions. When the Risk Meter indicator lit up bright red and the Gemma model accurately highlighted the exact phrases that caused it, I felt a genuine sense of horror. It felt like the application was summoning back the dark memories and anxiety creators feel when facing the mysterious YouTube strike algorithm.

Prize Categories

  • Best Use of Gemma: I utilized Google's open-weight model, Gemma 2 (2B), running entirely locally via Ollama as the core intelligence (the "Policy Phantom") to evaluate YouTube transcripts and generate the exorcism suggestions.
  • Best Use of GitHub Copilot: I used GitHub Copilot as my AI pair programmer to rapidly prototype the Gradio terminal-themed UI, construct the multi-language logic, and refine the regex parsing function for the risk scores.

Top comments (0)