<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: hackathons</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/hackathons.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2022-09-30T00:56:28+00:00</updated><author><name>Simon Willison</name></author><entry><title>A tool to run caption extraction against online videos using Whisper and GitHub Issues/Actions</title><link href="https://simonwillison.net/2022/Sep/30/action-transcription/#atom-tag" rel="alternate"/><published>2022-09-30T00:56:28+00:00</published><updated>2022-09-30T00:56:28+00:00</updated><id>https://simonwillison.net/2022/Sep/30/action-transcription/#atom-tag</id><summary type="html">
    &lt;p&gt;I released a new project this weekend, built during the Bellingcat Hackathon (I came second!) It's called &lt;a href="https://github.com/simonw/action-transcription"&gt;Action Transcription&lt;/a&gt; and it's a tool for caturing captions and transcripts from online videos.&lt;/p&gt;
&lt;p&gt;Here's &lt;a href="https://www.youtube.com/watch?v=AneNxjSGn1I"&gt;my video&lt;/a&gt; introducing the new tool:&lt;/p&gt;
&lt;iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="allowfullscreen" frameborder="0" height="315" src="https://www.youtube-nocookie.com/embed/AneNxjSGn1I" style="max-width: 100%" width="560"&gt; &lt;/iframe&gt;
&lt;h4&gt;Bellingcat&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://www.bellingcat.com/about/"&gt;Bellingcat&lt;/a&gt; describe themselves as an "independent international collective of researchers, investigators and citizen journalists using open source and social media investigation to probe a variety of subjects".&lt;/p&gt;
&lt;p&gt;They specialize in open source intelligence - which, confusingly, does NOT mean "open source software" - this is a &lt;a href="https://en.wikipedia.org/wiki/Open-source_intelligence"&gt;much older usage of the term&lt;/a&gt; that describes the use of publicly available information to gather intelligence.&lt;/p&gt;
&lt;p&gt;They have broken a LOT of impressive stories over their eight year lifespan. Wikipedia &lt;a href="https://en.wikipedia.org/wiki/Bellingcat"&gt;has a good list&lt;/a&gt; - highlights include identifying the suspects behind the &lt;a href="https://en.wikipedia.org/wiki/Bellingcat#Skripal_poisoning"&gt;Skripal poisoning case&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The theme of the hackathon was "General Digital Investigation Tools". The goal was to build prototypes of tools that could be used by their community of investigators - most of whom are volunteers working from home with little-to-no budget, and often with limited technical skills (they can use tools very effectively but they might not be comfortable writing code or using the command-line).&lt;/p&gt;
&lt;p&gt;Inspired by the recent release of &lt;a href="https://github.com/openai/whisper"&gt;OpenAI's Whisper&lt;/a&gt;, I decided to build a tool that would make it easier to extract captions and transcripts from videos on social media sites.&lt;/p&gt;
&lt;h4&gt;Why GitHub Actions and GitHub Issues?&lt;/h4&gt;
&lt;p&gt;My goals for the project were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Help people achieve something useful&lt;/li&gt;
&lt;li&gt;Make it as inexpensive to run as possible - ideally free&lt;/li&gt;
&lt;li&gt;Make it easy for people to install and run their own copies&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I decided to build the entire thing using GitHub Actions and GitHub Issues.&lt;/p&gt;
&lt;p&gt;GitHub Actions is a powerful service for running CI jobs and other automation, but its best feature for this particular project is that it's free.&lt;/p&gt;
&lt;p&gt;I'm fine with spending money myself, but if I'm building tools for other people having a way for them to run the tool without paying for anything is a huge win.&lt;/p&gt;
&lt;p&gt;My tool needed a UI. To keep things as simple as possible, i didn't want to host anything outside of GitHub itself. So I turned to GitHub Issues to provide the interface layer.&lt;/p&gt;
&lt;p&gt;It's easy to create Actions scripts that trigger when a new issue is created. And those scripts can then interact with that issue - attaching comments, or even closing it as completed.&lt;/p&gt;
&lt;p&gt;I decided that my flow would be:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The user opens an issue and pastes in a link to an online video.&lt;/li&gt;
&lt;li&gt;GitHub Actions is triggered by that issue, extracts the URL and fetches the video using &lt;a href="https://youtube-dl.org/"&gt;youtube-dl&lt;/a&gt; (which, despite the name, can actually download videos from &lt;a href="http://ytdl-org.github.io/youtube-dl/supportedsites.html"&gt;over 1,200 sites&lt;/a&gt; including many of the social media services popular in Russia).&lt;/li&gt;
&lt;li&gt;The script extracts just the audio from the video.&lt;/li&gt;
&lt;li&gt;The audio is then passed through OpenAI's Whisper, which can create a high quality transcript in the original language AND create a shockingly good English translation.&lt;/li&gt;
&lt;li&gt;The caption is then both written back to the GitHub repository and attached to the original issue as a comment.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;GitHub Actions doesn't (yet) provide GPUs, and Whisper works a whole lot faster with GPU access. So I decided to run Whisper using &lt;a href="https://replicate.com/cjwbw/whisper"&gt;this hosted copy of the model on Replicate&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;Extracting YouTube's captions directly&lt;/h4&gt;
&lt;p&gt;I had a check-in meeting with Tristan from Bellingcat just to make sure my hack wasn't a duplicate effort, and to get feedback on the plan.&lt;/p&gt;
&lt;p&gt;Tristan liked the plan, but pointed out that extracting captions directly from YouTube would be a useful additional feature.&lt;/p&gt;
&lt;p&gt;In addition to supporting manual captions, it turns out YouTube already creates machine-generated captions in over 100 languages! The quality of these isn't nearly as good as OpenAI Whisper, but they're still useful. And they're free (running Whisper currently costs me money).&lt;/p&gt;
&lt;p&gt;So I adapted the plan, to provide the user with two options. The default option would extract captions directly from the video provider - which would definitely work for YouTube and might work for other sites too.&lt;/p&gt;
&lt;p&gt;The second option would use Whisper to create a transcript and a translation, taking longer but providing results even for sites that didn't offer their own captions.&lt;/p&gt;
&lt;p&gt;I decided to use issue tags to trigger these two workflows: tag with "captions" to extract captions directly, tag with "whisper" to use Whisper.&lt;/p&gt;
&lt;h4&gt;The implementation&lt;/h4&gt;
&lt;p&gt;The implementation ended up being &lt;a href="https://github.com/simonw/action-transcription/blob/7d900b209c6c465df35a27bb812d03754677cb78/.github/workflows/issue_created.yml"&gt;218 lines&lt;/a&gt; of JavaScript-embedded-in-YAML in a GitHub Actions &lt;code&gt;issue_created.yml&lt;/code&gt; workflow.&lt;/p&gt;
&lt;p&gt;I used &lt;a href="https://github.com/actions/github-script"&gt;actions/github-script&lt;/a&gt; for it - a convenient reusable Action that provides a pre-configured set of JavaScript objects for interacting with the GitHub API.&lt;/p&gt;
&lt;p&gt;The code isn't hugely elegant: I'm not hugely familiar with the Node.js ecosystem so I ended up hacking around with Copilot quite a bit to figure out the patterns that would work.&lt;/p&gt;
&lt;p&gt;It turns out captions can come back in a variety of different formats. The two most common appeared to be TTML - which uses XML, and WebVTT, a text-based format.&lt;/p&gt;
&lt;p&gt;I decided to archive the original caption files in the GitHub repository itself, but I wanted to extract just the text and post that as the issue comment.&lt;/p&gt;
&lt;p&gt;So I ended up building two tiny new tools: &lt;a href="https://github.com/simonw/webvtt-to-json"&gt;webvtt-to-json&lt;/a&gt; and &lt;a href="https://github.com/simonw/ttml-to-json"&gt;ttml-to-json&lt;/a&gt; - which converted the different formats into a standard JSON format of my own invention, normalizing the captions so I could then extract the text and include it in a comment.&lt;/p&gt;
&lt;p&gt;Hackathons tend to encourage some pretty scrappy solutions!&lt;/p&gt;
&lt;h4&gt;The results&lt;/h4&gt;
&lt;p&gt;These two issues demonstrate the final result of the tool:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/simonw/action-transcription-demo/issues/3"&gt;Example issue with a VK video transcribed to English using Whisper&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/simonw/action-transcription-demo/issues/4"&gt;Example issue that extracted YouTube auto-generated English captions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That first one in particular shows quite how good the Whisper model is at handling Russian text, and translating it to English.&lt;/p&gt;
&lt;h4&gt;Adding issue templates&lt;/h4&gt;
&lt;p&gt;I added one last enhancement to the project after recording the demo video for the judges embedded above.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository"&gt;Issue templates&lt;/a&gt; are a new GitHub feature that let you define a form that users must fill out when they create a new issue.&lt;/p&gt;
&lt;p&gt;Frustratingly, these only work with public repositories. I had built my hack in a private repo at first, so I was only able to explore using issue templates once I had made it public.&lt;/p&gt;
&lt;p&gt;I created &lt;a href="https://github.com/simonw/action-transcription/tree/7d900b209c6c465df35a27bb812d03754677cb78/.github/ISSUE_TEMPLATE"&gt;two issue templates&lt;/a&gt; - one for caption tasks and one for whisper tasks.&lt;/p&gt;
&lt;p&gt;Now when a user goes to open a new issue they get to chose one of the two templates and fill in the URL as part of a form! Here's a GIF demo showing that flow in action:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://static.simonwillison.net/static/2022/action-transcription-demo.gif" alt="Animated demo. Click Issues, then New Issue, then select Get Started on the Capture captions menu option. Paste in a URL and click Submit new issue." style="max-width: 100%;" /&gt;&lt;/p&gt;
&lt;h4&gt;Template repositories&lt;/h4&gt;
&lt;p&gt;One last trick. I want users to be able to run this system themselves, on their own GitHub account.&lt;/p&gt;
&lt;p&gt;I made &lt;a href="https://github.com/simonw/action-transcription"&gt;simonw/action-transcription&lt;/a&gt; a &lt;a href="https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository"&gt;template repository&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This means that any user can click a green button to get their own copy of the repository - and when they do, they'll get their own fully configured copy of the GitHub Actions workflows too.&lt;/p&gt;
&lt;p&gt;If they want to use Whisper they'll need to get an API key from &lt;a href="https://replicate.com/"&gt;Replicate.com&lt;/a&gt; and add it to their repository's secrets - but regular caption extraction will work fine without that.&lt;/p&gt;
&lt;p&gt;I've used this technique before - I wrote about it here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2022/Mar/14/shot-scraper-template/"&gt;Instantly create a GitHub repository to take screenshots of a web page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://simonwillison.net/2021/Aug/28/dynamic-github-repository-templates/"&gt;Dynamic content for GitHub repository templates using cookiecutter and GitHub Actions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;GitHub Actions as a platform&lt;/h4&gt;
&lt;p&gt;I'm pleased with how this project turned out. But I'm mainly excited about the underlying pattern. I think building tools using GitHub Actions that people can clone to their own accounts is a really promising way of developing sophisticated automated software that people can then run independently, entirely through the GitHub web interface.&lt;/p&gt;
&lt;p&gt;I'm excited to see more tools adopt a similar pattern.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/projects"&gt;projects&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hackathons"&gt;hackathons&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/bellingcat"&gt;bellingcat&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/github-actions"&gt;github-actions&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/openai"&gt;openai&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/whisper"&gt;whisper&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/replicate"&gt;replicate&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/github-issues"&gt;github-issues&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/speech-to-text"&gt;speech-to-text&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="projects"/><category term="hackathons"/><category term="bellingcat"/><category term="github-actions"/><category term="openai"/><category term="whisper"/><category term="replicate"/><category term="github-issues"/><category term="speech-to-text"/></entry><entry><title>What are good event venues to have a 100 person weekend hackathon in San Francisco?</title><link href="https://simonwillison.net/2014/Feb/24/what-are-good-event/#atom-tag" rel="alternate"/><published>2014-02-24T18:54:00+00:00</published><updated>2014-02-24T18:54:00+00:00</updated><id>https://simonwillison.net/2014/Feb/24/what-are-good-event/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;em&gt;My answer to &lt;a href="https://www.quora.com/What-are-good-event-venues-to-have-a-100-person-weekend-hackathon-in-San-Francisco/answer/Simon-Willison"&gt;What are good event venues to have a 100 person weekend hackathon in San Francisco?&lt;/a&gt; on Quora&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;As a general rule, tech companies in San Francisco are very supportive of hackathons and keen to host events. Eventbrite have hosted this kind of event in their office in the past, and I'm certain there are a bunch of other companies with decent spaces that would be worth approaching. Does the hackathon have a specific topic? I suggest approaching companies related to that topic as a starting point.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/events"&gt;events&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/san-francisco"&gt;san-francisco&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/quora"&gt;quora&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hackathons"&gt;hackathons&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="events"/><category term="san-francisco"/><category term="quora"/><category term="hackathons"/></entry><entry><title>What is a good list of conferences, speaking gigs, hackathons, and other technology-centric events where one can reach software architects and developers?</title><link href="https://simonwillison.net/2013/Aug/21/what-is-a-good/#atom-tag" rel="alternate"/><published>2013-08-21T17:15:00+00:00</published><updated>2013-08-21T17:15:00+00:00</updated><id>https://simonwillison.net/2013/Aug/21/what-is-a-good/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;em&gt;My answer to &lt;a href="https://www.quora.com/What-is-a-good-list-of-conferences-speaking-gigs-hackathons-and-other-technology-centric-events-where-one-can-reach-software-architects-and-developers/answer/Simon-Willison"&gt;What is a good list of conferences, speaking gigs, hackathons, and other technology-centric events where one can reach software architects and developers?&lt;/a&gt; on Quora&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We have a pretty comprehensive list of (mostly tech) conferences in the Midwest USA here: &lt;span&gt;&lt;a href="http://lanyrd.com/places/midwestern-usa/"&gt;http://lanyrd.com/places/midwest...&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/conferences"&gt;conferences&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/entrepreneurship"&gt;entrepreneurship&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/startups"&gt;startups&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/quora"&gt;quora&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hackathons"&gt;hackathons&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/big-data"&gt;big-data&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="conferences"/><category term="entrepreneurship"/><category term="startups"/><category term="quora"/><category term="hackathons"/><category term="big-data"/></entry><entry><title>What makes an awesome hackathon? I want to host one at the LAUNCH Festival and I have never run one.</title><link href="https://simonwillison.net/2012/Dec/3/what-makes-an-awesome/#atom-tag" rel="alternate"/><published>2012-12-03T12:48:00+00:00</published><updated>2012-12-03T12:48:00+00:00</updated><id>https://simonwillison.net/2012/Dec/3/what-makes-an-awesome/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;em&gt;My answer to &lt;a href="https://www.quora.com/What-makes-an-awesome-hackathon-I-want-to-host-one-at-the-LAUNCH-Festival-and-I-have-never-run-one/answer/Simon-Willison"&gt;What makes an awesome hackathon? I want to host one at the LAUNCH Festival and I have never run one.&lt;/a&gt; on Quora&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;One of the hardest parts to coordinate of a hackathon (we tend to call them hack days here in the UK) is the demos at the end. If you have 50+ teams giving a demo you need to make sure everything runs SUPER smoothly or the whole process will quickly jam up.&lt;/p&gt;

&lt;p&gt;The first thing to figure out here is the AV setup. Teams will often need to present on their own hardware, so it's vital to have a quick turnaround. The best setup is to have TWO laptop setup points (each equipped with a savvy technician, a preview monitor that shows exactly what will be projected on stage to avoid dual monitor setup problems and every variety of display adaptor you can get your hands on). While one team is presenting, the next team can be setting up their demo - then you can flip over to the other setup. There's no reason not to extend this to three setup points so you can have two teams preparing to present while another team is on stage.&lt;/p&gt;

&lt;p&gt;I suggest emphasizing demos over prepared slide decks - or even banning slide decks entirely. It's nice if you can include enough time for the judges to ask a couple of questions, but depending on time constraints this might not be possible.&lt;/p&gt;

&lt;p&gt;Make sure you have a good mix of categories and prizes, and promote them ahead of time so people know what to hack towards. A hackathon is more interesting if there's a variety of stuff going on, so having a prize for e.g. "most unexpected hack" or "hardware hack" or "funniest hack" will let teams know that it's OK to do something a little out of the ordinary.&lt;/p&gt;

&lt;p&gt;I'm actually not too keen on super-valuable prizes as I feel they can skew the atmosphere, but it depends entirely on what kind of hacks you want to encourage.&lt;/p&gt;

&lt;p&gt;No matter what you do, the demos will go on for a LONG time - 3 hours plus is not out of the ordinary. This is a difficult issue: the audience will lose interest and it will feel like a slog for everyone (especially hackers who have been up for 24 hours and are restless to go home) - but it's important to give teams a good chance to demonstrate what they've been working on. I don't know of any good hacks to deal with this - make sure there are breaks, and that people have a feel for how far through the process they are (and teams know roughly when they will be on stage) and have a kick-ass moderator to keep things flowing along. Try to keep it fair too - it's pretty common for the earlier teams to get to ramble for 5 minutes while later teams are restricted to a 2 minute slot.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/quora"&gt;quora&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hackathons"&gt;hackathons&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="quora"/><category term="hackathons"/></entry></feed>