Topic Modeling Blog Post

The Topic Modeling tool is a very interesting tool to use. I happened to like the topics i saw when using the standard class setting’s of Number of words and Iterations. After posting that blog I went back and played around with the tool a little bit to see what it was like. My first run through with 50 Topics, 1000 iterations, and 20 topic words printing. This all took a total of 47.15 seconds to finish. I then proceeded to add more topics to 100, iterations to 2500, and 50 topic words printing. This ended in a total of 129.123 seconds. It was kind of a reasonable and expected time but I was trying to figure out which setting takes the longer time to load. As in which setting slows the system down. After a number of tests I still was unsuccessful in figuring this out. The whole point in the Topic Modeling tool is to be able to find a specific number of Topics in a well amount of documents. I decided to choose the first 10 because they interested me. At first it was a bit difficult for me to make up some titles but once I did one or two of them it became much easier. It was very unproductive when i kept in the stop words. When I kept these in nothing really significant came up. It was a bunch of nonsense words and not enough topic words. This made it impossible to make up a title that correlates all the topics into one. That was what I got from the Topic Modeling Tool.

Topic Modeling

60 topics, 1500 iterations, 25 topic words printed:

Topic: Household

years time ago week married family marriage thirty months live year age engaged twenty daughter situation lives carruthers living meet history month youth happy woodley

Topic: Emotions

good ah put word deal suppose feel don glad means thing laughed leave true mine takes kind heavens anger service fortune bye lead mistaken detail

Topic: Travel

train station carriage reached walk doubt gave start hotel passed town follow journey reach spoke bridge observed late catch started ready rapidly green cross hurried

Topic: Characterization

black eyes white hair face blue red dress heavy brown coat side mouth grey centre pair nose drawn thick hat forehead yellow broad faced suit

Topic: Dawn
morning day close full found visit absolutely country hat set change spent bird lie attention reading evil people nature acquaintance excitement town goose received drawn

Topic: Anecdotal

interest cases arthur friend sherlock public remarkable adventure problem present strange doyle case conan facts curious singular experience narrative details notes record long interesting events

Topic: Effeminate

lady wife woman maid left difficulty ferguson life girl mistress couple difficult forever nurse half devoted frances ill dear frightened coffin beautiful show longer notice

50 topics, 2000 iterations, 50 topic words printed:

Topic: Calligraphy

paper note read book table pocket papers hand short handed hopkins attention writing sheet post show eye rough slip drew baron page stanley pen pencil simply tossed held printed scribbled initials finished tea leaves worth volume desk knee added column reading trust pages folded excellent aloud arrange notebook torn gruner

Topic: Masculinity

father man time heard son young returned hudson mother mccarthy ship witness sea alive made peter game left boat captain estate cry trevor long quarrel carey dozen coroner return lay call turner concerned keeper warning word gun board jury farm rat hatherley securities sailor voyage considerably tale boscombe hearing seaman

Topic: Fright

light window dark suddenly looked coming round lamp black shadow spoke figure darkness stood corner empty heels moved silent moving shining whispered thrown emerged lantern yellow sudden sprang dashed low bushes ears watched vanished dim glancing half horrible bent gave band bar fear metal excitement burning deserted shone gleam flash

Sherlock Holmes Stories via Topic Modeling

10 Topics/ 1000 Iterations/ 15 Words Printed

1) Moment of Time: face eyes back cried head turned hands instant moment sat hand woman minutes lay voice

2) Setting: room door window light open long passed house stood round opened front dark night entered

3) Case: case point friend matter crime interest facts london remarkable fact attention singular account strange long

50 Topics/1500 Iterations/20 Words Printed

4) Family: woman lady wife husband life love left boy child nature loved beautiful maid ferguson happy madam women mistress devoted wonderful

5) Money & Worth: business client money england hundred king pounds thousand large set gold photograph paid pay ten give draw fifty ready worth

6) Physical Appearance: man black white hair hat blue heavy red dress short appearance cut fashion thick coat broad brown faced clean beard

7) Unfortunate Murder: death man poor terrible dead heard told creature happened died night life human met devil great wild fate dreadful killed

20 Topics/ 5000 Iterations/ 20 Words Printed

8) Solved Case: found police made night lestrade crime reason evidence place show visit murder finally account death brought occurred london john tragedy

9) Depression: man lay dead poor body professor blood close carried end terrible death struck moment broken shot strange deep long water

10) Relationship: woman lady wife miss life husband house young girl maid mrs st love save gentleman child married sister things marriage

Modeled Topics from my Topic Modeling

Topics: 50

Iterations: 1000

Topic Words: 20

1) “Riddle Crime”

london head word man message game shook hudson break moment worth find single order means told companion hands bust probable

2) “Surprise Attack”

morning made found mrs home brought arrived breakfast sitting st city surprised coat attack ready bright afternoon spoken clothes lodger

3) “Infidelity”

woman lady life wife knew husband poor thought heart told girl words maid story love truth child dreadful mine married

4) “Person Description”

eyes face dark looked thin features tall figure expression manner deep appearance heavy blue companion gray glance fixed nose raised

5) “Murder Scene”

found crime death reason police murder attention showed night tragedy dead account evidence violence terrible unfortunate instantly trace murderer committed

6) “Through the Window”

room door window open instant light opened entered bed floor stood rushed sitting key bedroom fell closed lamp ran sound

7) “Footprint Evidence”

end left path water foot feet passed round ran ground mark fall walked track walking edge marks farther grass thumb

8) “Armchair Pondering”

holmes chair sat fire hand rose pipe glanced laid table lit seated sprang cigar smoke tobacco laughed shoulder silence silent

9) “Horse Crime”

colonel boy small horse night lad hand john led heavy missing boots double called straker moor show silver stable half

10) “Written Evidence”

paper note letter read book letters handed importance written papers table writing wrote write sheet post document short pocket held

Topic Modeling and Sherlock Holmes

Number of topics: 50 Iterations: 1000 Number of topic words: 20


Law Enforcement: horse dog colonel question master great heavy shown led john boy companion double straker lead stable stables stranger found silver

Time: years time lord ago twenty year thirty st months weeks made age subject simon great future sea peter ship business

Written Clues: paper read note word letter short written show wrote writing single sheet write post address handed slip message importance thumb

Emotions: mr holmes visitor assure smile desire beg glad relations carruthers gibson night assured consult town prefer laughed sit agitated reserve

Finances: good business money hundred deal asked pay play ten pounds thousand gold year paid give price firm hard sum worth

Action: instant suddenly turned light sprang coming caught heard forward threw fell sudden window back cry sight moment sound struck silence

London: london train station evening office papers reached west monday started line plans agent cross appointment report bridge carriage telegram journey

Travel: street half hour minutes back baker waiting cab quarter past passed ten hurried standing glad quiet start wait drive drove

Family: woman wife life husband girl lady heart love knew child married loved daughter ferguson nature soul terrible character women power

Investigating: left side examined showed corner finally square pointed carefully marks covered large books traces small wood inside evidently mark farther

 

Sherlock Holmes Topic Modeling

Topics: 50 Iterations: 1000 Topic Words: 20

(Features) man face eyes deep features step dark tall set appearance expression looked eye thin drawn middle figure beard gray pair

(Work) day work days long evening hours home visit morning news week learned spent yesterday returned couple british knowledge information acquaintance

(Bedroom) room window bed night sitting bedroom bell entered half looked floor heard morning dressing lawn finally remained sleep opened alarm

(Crime) holmes inspector lestrade case police friend sherlock yard detective official force arrest scotland evidence remarked opinion prisoner charge constable concerned

(Murder) found man dead body blood person carried death blow revolver attention attempt police examination violence stick finally drawn unfortunate suspicion

(Appearance) black red hair white heavy broad side blue head hand centre cut brown held thick coat faced headed boots clean

(Time) street morning night hour clock baker rooms late friend quarter waiting breakfast small cold sherlock twelve cross eleven early arrived

(Literature) paper note read letter book handed wrote written short post sheet reading writing document slip date importance write envelope client

(Transportation) half past station train back carriage drive cab ten town drove hour started reached hurried minutes passed country journey pulled

(Communication) holmes answer asked men family fresh telegram questions surprise single picture message received tregennis wire remember early considerable order lonely

Topic Modeling – My Found Topics

Using sets of 15 words.

My First Search – 1500 iterations of 50 topics

(Business and Labor) – business money hundred answered asked pay ten good pounds pocket thousand men worth company paid

(Holmes’ Office) – holmes chair sat table room fire back pipe sitting rose arm laid seated glanced books

(Emotional Shock) – cried hands head face voice thought man word shook suddenly amazement burst sank astonishment stared

My Second Search – 2000 iterations of 75 topics

(Place) – door room open opened key passage closed ran locked stood empty rushed stair steps stairs

(Crime) – crime night police occurred house tragedy violence murder made caused committed account barclay death appeared

(Foot Traffic) – path feet ground stood foot water direction walked fall end edge ran track marked grass

(Time) – day morning days evening hours work early clock breakfast week spent morrow arrived call meet

My Third Search – 3000 iterations of 30 topics

(Deduction) – watson case point dear make points curious facts doubt fact person possibly clear obvious surely

(Love and Matrimony) – woman lady wife life husband heart girl love mrs child married creature beautiful loved daughter

(Notes and Writing) – paper note read table hand pocket papers letter box book put handed written client writing

Topic Model

Topics: 50  Iterations: 1000 Topic words: 20.

 

Therapeutic

man doctor told dr explain find advice ill hope doubt nervous sort natural inquiries lies medical due quarters telling blessington

Shoot Out

hand held pocket drew shot revolver give count struck big finger bird feel picked deep huge lay rough human long

Appearance

man black hair hat red appearance cut broad dress side middle front white brown faced tall clean pair coat nose

Murder

man found young dead world body strong blood carried hand knife unfortunate person finally roof drawn wound blow fallen weapon

Demon

cried man hands head god heart shook sake face devil hold stand soul sank burst tut jack tore shaking gasped

Medusa In Disguise

instant stone caught eye sprang glass air passed gave direction pointed quick hotel spring green swiftly glimpse blue moment bright

Robbery

house night place master left scene returned caused servants missing alarm servant connection suspicion long feared discovered view save found

Abandonment

father left met son heard young poor sister returned life told mother died death true mccarthy fate alive month considerable

Letter

paper note letter read table book letters box papers handed put wrote written writing sheet write finished small pocket piece

Family

woman lady wife husband life girl maid love child married beautiful loved daughter marriage make ferguson poor mistress women young

Topic Modeling

10 favorite topics from Mallet:

1)  Police

         crime inspector london police found murder evidence arrest charge tragedy proved violence   discovered present remained committed appeared bust trace person

2) Death

 man life poor strange heart told death creature died broke devil met terrible happened human wild loose killed telling terror

3)  Home

  room chair sat fire table sitting half pipe rose corner round lit arm lamp laid cigar tobacco smoke bed chamber

4) Movement

 back station half hour past carriage waiting drive minutes cab train started drove hurried standing start ten pulled quarter reached

5) Scared

light window dark suddenly threw looked round sprang forward shadow steps moved darkness thrown figure black sharp lamp standing water

6) Appearance

face eyes features looked dark tall pale thin expression figure lips glance sprang gray colour manner spoke clean angry handsome

7) Case

holmes street sherlock baker call men king address rooms cross photograph smiling laughing working ha afternoon description seldom absolute admirable

8) Murder

28. found man dead body blood left head finally lay drawn knife sign fell round sight blow stick lying clothes thing

9) Abandon

32. man father young found left point true occurred account time view home narrative evidence court single alive witness place general

10)  Stationary

paper note letter read table book st written handed writing papers wrote sheet post write letters simon document slip reading

11) Routine

night morning clock room morrow mrs hour early breakfast bed arrived work late heard twelve change hours hear sleep dressed

Settings:  Number of topics: 50

                 Number of Iterations  1000

                Number of Topic Words 20

                 Stop Words Removed

The Hippy’s Guide to Google N-Grams

Hey man. It’s me, hippy man Jim. Here’s a picture of me in my heyday.

rsz_dan-220x231

These n-grams have me bugging out. I punched in a few words to make this drag Google n-gram show the world the light. N-grams shows “war” and “love” to have very different trends of usage:

NGram1

Check out how “war” spikes during the two world wars. Also notice how the lines kind of look like an alligator or something. That’s cool.

This chart is really bumming me out, man. This is just another instance of the man bringing down the rest of the world. It just shows how messed up the world has became. “Love” has been on a downwards trend ever since 1920! But everyone I know uses “love” wayyy more than “war”. I would say the only word me and my hippy compadres have used more than “love” is like, “pass” or something…maybe “music”. Hey, maybe I should look up “rock” or “weed” or something. Yeah, this is gonna be so cool.

Okay, check it out:

NGram2

Look at 1970! That little red spike, that’s me! Yeah, I did it. Don’t let this graph fool you. Just because a word shows up in books a lot doesn’t mean it wasn’t prevalent. Trust me, no stoner hippies were writing about marijuana. That was probably all those liberal school types writing in their books and papers. And some people have the nerve to call them hippies. Who needs em?! Us real hippies weren’t writing about it anyway. We were making the rock happen with the power of grass! That means these trends are intrinsically linked by the weed soaked fingers that caught those rock riffs. If only Lennon were still alive to see these charts. His eyes would burst out his circular shades.