Home首页 · Text as Data文本作为数据 · Topic count主题个数

Lab · Topic count主题个数实验 · 主题个数

What changes when the desk has more folders?桌上的文件夹变多时,什么会变?

A press officer has nine one-line clippings to file before Monday’s brief: three lines of wage words, three of tie words, and three of model words. K is how many folders are on the desk. At 1, every clipping 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 clipping gets one color only. A topic mixture would let one clipping sit in more than one folder.一位新闻官在周一简报前要归档九行剪报:三行工资用词,三行关系用词,三行模型用词。K 是桌上的文件夹个数。K 为 1 时,全部剪报进一个文件夹,词表把 wages、bridges 和 error 混在一起。K 为 3 时,每份清单可以有自己的颜色,因为它们几乎不共享词。一行剪报只有一种颜色。主题混合会让一行同时放进不止一个文件夹。

Why this matters.为何重要。 A topic mixture would let one note belong to several themes at once. Here a note 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,注意颜色和这些行的写法对上了。

Nine lines. The names on the left are for reading. The grouping only sees the words.九行。左边的名字是给人读的。分组只看见那些词。

Each row is one clipping. Same color means one folder. The line under the chart names the words in each pile.每一行是一行剪报。同色就是同一个文件夹。图下那一行写出每一堆里的词。

Read the chart读这张图

If you misread this读错了会怎样

If the press officer prints “three topics in Monday’s coverage” because three colors split cleanly, the brief gets headings that match how these nine lines were written. They barely share words. The split does not count themes in the newspaper.如果新闻官因为三种颜色分得干净,就印出“周一的报道里有三个主题”,简报得到的标题只是这九行被写成的方式。它们几乎不共享词。这次分开并没有数出报纸里的主题。

Enough, and not enough够用,以及不够

Enough to see that one folder forces the wage lines, the tie lines, and the model lines into a single word list.够用来看见:一个文件夹会把工资行、关系行和模型行挤进同一份词表。

Not enough for a brief that names topics. It still needs the clippings that actually ran, a method that lets one clipping sit in more than one folder, and a statement of how unsure the folder count is.不够写一份点出主题的简报。简报仍需要实际刊出的剪报、一种让一行剪报可以同时进不止一个文件夹的方法,以及文件夹个数有多没把握的说明。

Equations, assumptions, and limits方程、假设与限度

Current representation当前表示

Each line becomes a vector of word counts. K-means places K centers and assigns every line to the nearest center, then moves the centers to the average of their members. The starting centers are fixed lines, so the picture does not jump. Distance is ordinary Euclidean distance on the counts.每一行变成词数向量。K 均值放下 K 个中心,把每一行分给最近的中心,再把中心移到其成员的平均。起点是固定的行,所以图不会乱跳。距离是计数上的欧氏距离。

A topic model, in the usual teaching story, is different: each topic is a distribution over words, and each document is a mixture of topics. K is the number of topics you allow. This page borrows only the question K poses. It does not estimate mixtures, and it does not report uncertainty.按通常的讲法,主题模型不同:每个主题是词上的一个分布,每份文档是主题的混合。K 是你允许的主题个数。本页只借用 K 提出的问题。它不估计混合,也不报告不确定性。

Common pitfall.常见陷阱。 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 groups and different lists are forced together. Another pitfall is to treat the cluster’s frequent words as a theme a reader would name. They are just the counts that happened to sit together.K = 3 时分得干净,并不意味着三个就是真实的主题个数。这些行被写成几乎不共享词的三份清单。少要几组,不同清单就会被挤在一起。另一个陷阱是把一组里常见的词当成读者会起的主题名。它们只是碰巧聚在一起的计数。

Books behind this lab are named on the本实验背后的书按主题列在About关于.