Exploring Author Influence with Networks and NLP

Benjamin Ortiz Ulloa

10/27/2018

What We’ll Cover

1. Graphs: An Introduction

2. Graphs: Collaboration Networks

3. NLP: An Introduction

4. NLP: Topic Modelling

1
Graphs are made up of things

2
Things are also known as nodes

3
Things are also known as vertices

4
Things are connected by relationships

5
Relationships are also known as links

6
Relationships are also known as edges

7
Relationships can have direction

8
Things can have multiple relationships

9
Everything can have attrirbutes

10
Attributes can be visualized

11
Node attributes can be represented as nodes themselves

12
Direct relationships can be inferred from indirect relationships

13
These projected relationships enrich our data

14
An example of a bipartite graph: an author writes publications

15
Other authors collaborated on those publications

16
We can now infer a relationship

17
Information can be stored in publications

18
Information can be transfered to authors

19
Information can be stored in relationships

20
Collaboration Network:

Authors writing about network science & agent based models

21
20 largest components for exploration

22
Bag of Words

The fox jumped over the other fox

The dog ran at the foxes

The foxes ran away from the dog

The cat napped on my lap

The lion napped on the hill

The cat jumped on the fox

A standard data structure for text analysis is the Document Term Matrix (DTM). This is a matrix in which

the rows represent the documents in your corpus and the columns represent every word

at away cat dog fox foxes from hill jumped lap lion my napped on other over ran the

doc_1 0 0 0 0 2 0 0 0 1 0 0 0 0 0 1 1 0 2

doc_2 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 2

doc_3 0 1 0 1 0 1 1 0 0 0 0 0 0 0 0 0 1 1

doc_4 0 0 1 0 0 0 0 0 0 1 0 1 1 1 0 0 0 1

doc_5 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 0 0 2

doc_6 0 0 1 0 1 0 0 0 1 0 0 0 0 1 0 0 0 2

23
Remove Stop Words

For computational reasons, we generally want to remove words that are so common they don’t really provide

us with significant meaning or context.

The fox jumped over the other fox

The dog ran at the foxes

The foxes ran away from the dog

The cat napped on my lap

The lion napped on the hill

The cat jumped on the fox

cat dog fox foxes hill jumped lap lion napped ran

doc_1 0 0 2 0 0 1 0 0 0 0

doc_2 0 1 0 1 0 0 0 0 0 1

doc_3 0 1 0 1 0 0 0 0 0 1

doc_4 1 0 0 0 0 0 1 0 1 0

doc_5 0 0 0 0 1 0 0 1 1 0

doc_6 1 0 1 0 0 1 0 0 0 0

24
Unsupervised Topic Modelling

Latent Dirichlet Allocation (LDA) and Structural Topic Modelling (STM) are two methods of classifying text

without providing clues to what we want. These methods are great if we have a large corpus of documents,

but we don’t really know what we’re looking for. The only parameter needed is the number of categories we

want returned

Unsupervised Topic Modelling: K = 3

cat dog fox foxes hill jumped lap lion napped ran

doc_1 0 0 2 0 0 1 0 0 0 0

doc_2 0 1 0 1 0 0 0 0 0 1

doc_3 0 1 0 1 0 0 0 0 0 1

doc_4 1 0 0 0 0 0 1 0 1 0

doc_5 0 0 0 0 1 0 0 1 1 0

doc_6 1 0 1 0 0 1 0 0 0 0

Unsupervised Topic Modelling: K = 2

cat dog fox foxes hill jumped lap lion napped ran

doc_1 0 0 2 0 0 1 0 0 0 0

doc_2 0 1 0 1 0 0 0 0 0 1

doc_3 0 1 0 1 0 0 0 0 0 1

doc_4 1 0 0 0 0 0 1 0 1 0

doc_5 0 0 0 0 1 0 0 1 1 0

doc_6 1 0 1 0 0 1 0 0 0 0

25
STM Categories: K = 3

If we run an STM model on all the publications in our collaboration network, we get the following three

categories

26
20 Largest Components: STM Categories

27
But why are we running an unsupurvised algorithm?

What if a subject matter expert sees three clusters of authors and says, “These authors come from very focused

labs and work on very differnt things.”?

28
Start Over

We can use that information to define the categories we want. We have a network of authors and we should

use that information to inform our topic model.

29
Term Frequencies

The fox jumped over the other fox

The dog ran at the foxes

The fox ran away from the dog

The cat napped on my lap

The lion napped on the hill

The cat jumped on the fox

FOX is considered important for DOCUMENT 1 because it is the most frequently used word in that document

30
Inverse Document Frequencies

The fox jumped over the other fox

The dog ran at the foxes

The fox ran away from the dog

The cat napped on my lap

The lion napped on the hill

The cat jumped on the fox

THE is considered unimportant because it can be found in all documents

31
Inverse Document Frequencies

The fox jumped over the other fox

The dog ran at the foxes

The fox ran away from the dog

The cat napped on my lap

The lion napped on the hill

The cat jumped on the fox

LION is considered important because it is only found in one document

32
Which document is most similar to document 1?

cat dog fox foxes hill jumped lap lion napped ran

doc_1 0 0 2 0 0 1 0 0 0 0

doc_2 0 1 0 1 0 0 0 0 0 1

doc_3 0 1 0 1 0 0 0 0 0 1

doc_4 1 0 0 0 0 0 1 0 1 0

doc_5 0 0 0 0 1 0 0 1 1 0

doc_6 1 0 1 0 0 1 0 0 0 0

33
TF-IDF Categories: 3 Largest Components

Let’s run a TF-IDF on the three largest components and see what words differentiate them from one another

34
3 Largest Components: TF-IDF

35
20 Largest Components: TF-IDF

Let’s use the words associated with these three largest components and compare them to the words of all the

other components. This will tell us which groups are similar to the three groups we ran the initial TF-IDF on.

This comparison can be done with cosine similarity because the underlying data structure of the text data is

a matrix.

36
Two Similar Components

37
Why are these two components similar?

38
How have these categories changed overtime?

39
tidytextmining.com

40
kateto.net/tutorials/

41
dc2018.satrdays.org

42