我正在对从此处下载的各种语料库应用MLlib LDA示例。我过滤掉了停用词,也排除了非常频繁的术语和非常罕见的术语。问题是我的主题总是具有非常相似的特征。
以下是我在运行算法时从维基百科的30万个英文句子语料库(eng_wikipedia_2010_300K-sentences)中得到的主题示例,值得注意的是,当使用其他语料库时,我也有类似的表现:
TOPIC 0dai 0.0020492776129338083call 0.0019627409470977355citi 0.0019496273507300062three 0.0019172201890256511gener 0.0018325842193426059plai 0.0018287121439402873peopl 0.001786839660855886well 0.0017792000702589461system 0.0017410979899730565area 0.001721711978388363power 0.0016906026954800833forc 0.0016646631729486227number 0.00163433860305189791 0.0016238591786476033team 0.0016112030952801443second 0.0015692071709961662develop 0.0015670177558504078group 0.0015378927495689552unit 0.001535180513974118nation 0.001520548489788889TOPIC 1dai 0.002027230927747474call 0.0019861147606781222citi 0.0019793753441068825three 0.0019315799215582723gener 0.0018482143436741026plai 0.0018088629290540156peopl 0.0017929339168126625well 0.0017549252518608278system 0.0016936542725510587power 0.0016792684719108006area 0.0016604962232717288forc 0.00165756243329704561 0.0016344588453542676number 0.0016147026427518426team 0.0015914797457267642develop 0.001580085843019015unit 0.0015659585445574969nation 0.0015412334667742672second 0.0015292625574896467group 0.0015111594105132022TOPIC 2dai 0.002028407701986021call 0.001987655848237808citi 0.0019737160296217846three 0.0019183385421321895plai 0.0018470661666555599gener 0.0018431319454591765peopl 0.0017947273975068192well 0.00174922095206974area 0.0017256327188664123system 0.0016995971624202812forc 0.001690002995539528power 0.00167792505813793531 0.0016214669556130525team 0.0016134935452659781number 0.00161273946842774develop 0.0015712560226793318unit 0.0015385515465297065second 0.001537016434433013nation 0.001529578699246495group 0.0015259003261706866TOPIC 3dai 0.0020271063080981745call 0.001973996689805456citi 0.0019709486233839084three 0.0019445106630149387gener 0.0018677792917783514plai 0.0018485914586526906peopl 0.0018082458859327093well 0.0017955363877379456area 0.0017455386898734308system 0.0017118889300776724power 0.0017085249825238942forc 0.00164160266328131641 0.001625823945554925team 0.0015984923365964885number 0.001584888932954503develop 0.0015753517064182336unit 0.0015587234313666533second 0.0015545107852806973nation 0.001551230039407881form 0.0015004750009120491TOPIC 4dai 0.0020367505428973216citi 0.0019778590305849857call 0.0019772546555550576three 0.001909390366412786peopl 0.001822249318126459gener 0.0018136257455996375plai 0.0018128359158538045well 0.0017692106359278286system 0.0017220797688845334area 0.0017158874212548339power 0.0016752592665713634forc 0.00164812288332621571 0.0016364343814157618develop 0.0016172188646470641team 0.0016018835612051036number 0.0015991873726231036group 0.0015593423279207062second 0.0015532604092917898unit 0.0015495253363353232 0.0015220460130066676TOPIC 5dai 0.0020635883517150367call 0.0019664003159491844citi 0.001961190935833301three 0.001945998746077669plai 0.0018498883070569758peopl 0.0018146602342867515gener 0.0018135991027718233well 0.0017837359414291816area 0.0017440315427199456system 0.0016954828503859868power 0.001684533695977363forc 0.001669704443002364number 0.001615285649370311 0.001615272821378791team 0.0016121988960501902unit 0.0015895009183487473develop 0.001577936587739003group 0.0015555325586313624nation 0.0015404874848355308second 0.0015394146696500102TOPIC 6dai 0.0020136284206896792call 0.001992567179072041citi 0.0019601308797825385three 0.0019185595159400765plai 0.0018409472012516875gener 0.001829303983728153peopl 0.0017780620849170163well 0.001771180582253062system 0.0017377818879564248area 0.0016871361621009276power 0.0016862650658960986forc 0.001671411721983671 0.001629498191900329number 0.0015977527836457993develop 0.0015960475085336815team 0.001571055963470908unit 0.0015559866004530513group 0.0015445653607137958second 0.00153464129964869152 0.001533194322154979TOPIC 7dai 0.0020097600649219504citi 0.001996121452902739call 0.001976365831615543three 0.0019444233325152307gener 0.0018347697960641011plai 0.0018294437097569366peopl 0.001809068711352435well 0.0017851474017785431system 0.0017266117477556496power 0.001696861186965475area 0.0016963032173278431forc 0.0016424242914518095team 0.0016341651077031543number 0.00162572683777832361 0.0016221579346215153develop 0.0015930555191603342unit 0.0015895942206181324group 0.0015703868353222673second 0.0015154545527331732 0.0015143190174102155TOPIC 8dai 0.002044683052793855call 0.001992448963405555citi 0.00195425798896221three 0.0018970773269210957plai 0.001853887836159108gener 0.0018252502592182695peopl 0.0018160312050590462well 0.0017935933754513543system 0.0017479534729456555area 0.0017288815955179666power 0.0017029539375086361forc 0.00167066732378653131 0.0016681586343593317number 0.0016501255143390717team 0.0015894156993455188develop 0.0015724268907364824unit 0.0015371351757786232second 0.0015247527824288484nation 0.0015235190916716697group 0.0015194534324480095TOPIC 9dai 0.0020620160901430877citi 0.001987856719658478call 0.001973103036828604three 0.001924295805136688peopl 0.0018232321289066767plai 0.0018172215529843724gener 0.0018125979152302458well 0.0018056742813131674system 0.001725860669839185area 0.0017232894719674296power 0.0016976432531194421 0.001640662972775316forc 0.0016394197000681693number 0.0015927389128238725unit 0.0015785177165666606team 0.0015751611459412492develop 0.0015670613914512046nation 0.00152873945478475422 0.0015262474392790497group 0.0015196717933709822TOPIC 10dai 0.0020203137546454856citi 0.001985814822156114call 0.001974265937728284three 0.001934180185122672gener 0.0018803136198652043plai 0.0018164056544889878peopl 0.0018083393449413536well 0.0017804569091358126power 0.0017051544274740097area 0.0016959804754901494system 0.00169186205282116531 0.0016435864049172597forc 0.0016413861291761263number 0.001638383798987439develop 0.0016053710214565596team 0.0015754232749060797unit 0.001543834810440448group 0.0015352472722856185nation 0.00153505408258840742 0.001500158078774582
回答:
你为什么要移除频繁的词?保留它们。LDA在给定大量特征时并不总是工作得很好。很多已发表的结果将LDA限制在最常见的2万个英语单词(不包括停用词)上。我猜这可能是你现在遇到的大部分问题。
也可能有其他问题,你是否让算法运行到收敛?10个主题是否太少而无法得到合理的主题?你提供的信息很少。
去查阅原始的在线LDA论文,尝试复制他们的结果,首先确认你正确使用了库,然后在你掌握了之后再调整到新的语料库上。