Tired of ads? Enjoy an ad-free experience by signing up.
Tomi Mester · · 8 min read

How beginner-level data science helped me learn Swedish

I moved to Sweden six months ago with my girlfriend. It is a great country for expats like us because almost everyone speaks really good English. But we’d still like to learn some Swedish to understand a bit more of the daily conversations and about the country’s culture.

This is going to be a hobby for me, so I don’t want to put too much effort into it. I’d like to spend 10 to 20 hours tops, and my target is to understand 80 percent of the daily chitchat.

Is it doable? We’ll see! Here’s my approach to learning a new language through beginner-level data science.

The concept

This is, I think, a pretty unorthodox method. But sometimes, being creative makes things easier, right?

What I did:

  1. I picked two popular TV shows: Friends and How I Met Your Mother (HIMYM).
  2. I got the Swedish subtitles for all episodes.
  3. I analyzed the most common words and sorted the words by the number of occurrences.
  4. I cut off at the top 1,000 words.

The question is: How far can I go if I learn only the top 1,000 words in a language? Or being more pragmatic: What percent of Swedish conversations are covered by the language’s top 1,000 words? I set up a short data script to find out.

By the end of this article, I’ll share it with you as well. But first, I’ll show you how I got my answers for these questions.

(Note: My method works with every European language.)

The code

The first step is to get the Swedish subtitles. It can be for any and as many series or movies as you want. I picked Friends and HIMYM because I’d already watched both in English before, and I liked their vocabulary. But if you want to speak like Rocky, get the subtitles of the Rocky movies. 

(An important note about subtitles: As far as I know, using subtitles for non-profit research projects like this one is not illegal. But to be safe, do what I did: Ask a native-speaking friend to type down the whole script for you. ;))

Once you have the subtitles, you’ll need a tool to do the text analysis.

I’ve outlined how to get, install, and start with data coding tools like Python, R, SQL, and bash in this article. You could use any of those for this project.

I chose bash. It’s so simple, that the whole analysis needed only one line of code. On the screenshot below, I broke it down into 14 lines just to make it more readable.

So here’s my exact bash code:

Line by line

The results

Back to my code

The next steps

Disclaimers

Conclusion


Stay ahead in Asia’s tech landscape

You've reached your 2 free content limit for the month. Sign up for free to read the full story.

🏄 For casual readers / 👶 Free

Basic

US$0

Free forever

Get instant access to this article and more every month

0 premium content

Unlimited news briefs

5

5 articles

Ad-free reading experience

Just US$0 per day

⌛Sign up in 20s. No payment details needed.

📖 For learners / 👍 Starter

Lite

US$4.92/month

Billed annually at US$59/year

Get instant access to this article and more every month

4

4 premium content

Unlimited news briefs & articles

Ad-free reading experience

Just US$0.17 per day

Cancel anytime

Our subscriber community includes professionals from these companies:

Stay updated on the go with our mobile app.

Get latest insights with smoother, more personalized experience through TIA mobile app.

Community Writer

Tomi Mester

Tomi is a data analyst and researcher. He’s the author of the Data36 blog, where he gives a sneak peek into online data analysts’ best practices. He writes posts and tutorials on a weekly basis about data science, AB-testing, online researches and data coding. Find him here: http://data36.com or here: twitter.com/@data36_com.