Lab · Topic count主题个数练习 · 主题个数
What changes when these nine lines get more folders?给这九行多几个文件夹,会变成什么样?
A classmate has nine one-line notes to sort before a tutorial: three lines about wages, three about who talks to whom, and three about fitting a curve. K is how many folders are on the desk. At 1, every line goes in one folder and the word list mixes wages, bridges, and error. At 3, each list can have its own color, because the lists barely share words. A line gets one color only. A topic mixture would let one line sit in more than one folder at the same time.一个同学在导修前要给九行短句分文件夹:三行讲工资,三行讲谁和谁说过话,三行讲怎么拟合一条曲线。K 是桌上有几个文件夹。K 为 1 时,全部句子进一个文件夹,词表把 wages、bridges 和 error 混在一起。K 为 3 时,每份清单可以有自己的颜色,因为它们几乎不共享词。一行只有一种颜色。主题混合会让一行同时放进不止一个文件夹。
Why it matters.为什么要紧。 A topic mixture would let one line belong to several themes at once. Here a line gets one color. The words listed under that color are the counts that landed together, not a title a reader would have chosen.主题混合会让一行同时属于几个主题。这里一行只有一种颜色。颜色下面列出的词,是落在一起的计数,不是读者会起的标题。
Try this试一试 Set K to 1 and read the mixed word list. Then 2, and see which lists still share a color. Then 3, and notice the colors match the way the lines were written.把 K 设为 1,读那份混在一起的词。再设为 2,看哪些清单仍同色。再设为 3,注意颜色和这些行的写法对上了。
How to read the chart怎么读这张图
If you read this wrong要是读错了
If the classmate writes “three topics” because three colors split cleanly, the tutorial gets headings that match how these nine lines were written. They barely share words. The split does not find themes in a newspaper.如果同学因为三种颜色分得干净,就写成“有三个主题”,导修得到的标题只是这九行被写成的方式。它们几乎不共享词。这次分开并没有从报纸里找出主题。
What this picture is enough for这张图够说明什么
Enough to see that one folder forces the wage lines, the talk lines, and the curve lines into a single word list.看得出:一个文件夹会把工资、谈话和曲线这三行挤进同一份词表。
Not enough to name topics in the tutorial note. You still need the lines that were actually written, a method that lets one line sit in more than one folder, and a sentence about how unsure the folder count is.还不够拿来在导修笔记里点出主题。你仍需要真正写下的那些句子,一种让一行可以同时进不止一个文件夹的办法,以及文件夹个数有多没把握的一句话。
The equation, and where it stops式子、假设和边界
Each line becomes a list of word counts. K-means places K centers, gives every line to the nearest center, then moves each center to the average of its lines. The centers start from fixed lines, so the picture does not jump. “Near” is ordinary straight-line distance on the counts.每一行变成一组词数。K 均值先放下 K 个中心,把每一行分给最近的中心,再把中心移到这些行的平均。中心从固定的行出发,所以图不会乱跳。“近”就是词数上普通的直线距离。
A topic model, in the usual classroom story, is different. Each topic is a distribution over words, and each line is a mixture of topics, so one line can belong to more than one topic. K is how many topics you allow. This page borrows only the question K asks. It does not estimate mixtures, and it does not say how unsure that K is.按课堂上通常的讲法,主题模型不是这样。每个主题是词上的一个分布,每一行是若干主题的混合,所以一行可以同时属于不止一个主题。K 是你允许有几个主题。这一页只借用 K 提出的那个问题。它不估计混合,也不说这个 K 有多没把握。
Easy to get wrong.容易踩的坑。 A clean split at K = 3 does not mean three is the true number of topics. These lines were written as three lists that share almost no words. Ask for fewer folders and different lists are forced together. Another mistake is to treat a pile’s frequent words as a theme a reader would name. They are just the counts that happened to sit together.K = 3 时分得干净,并不意味着三个就是真正的主题个数。这些行是按几乎不共享词的三份清单来写的。少要几个文件夹,不同的清单就会被挤在一起。另一个错,是把一堆里常见的词当成读者会起的主题名。它们只是碰巧聚在一起的计数。