Skip to content

Commit

Permalink
Fixing up some FONTS
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge committed Oct 11, 2018
1 parent 549be7f commit 60c6959
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 99 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ My xaringan theme (from [xaringanthemer](https://pkg.garrickadenbuie.com/xaringa
```
mono_accent(
base_color = "#F48024",
header_font_google = google_font("IBM Plex Sans"),
header_font_google = google_font("IBM Plex Sans", "700"),
text_font_google = google_font("IBM Plex Sans Condensed"),
code_font_google = google_font("IBM Plex Mono")
)
Expand Down
2 changes: 1 addition & 1 deletion css/footer_plus.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.large { font-size: 150% }
.large { font-size: 160% }

.title-slide .remark-slide-number {
display: none;
Expand Down
2 changes: 1 addition & 1 deletion css/xaringan-themer.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* ------------------------------------------------------- */
@import url(https://fonts.googleapis.com/css?family=IBM+Plex+Sans+Condensed);
@import url(https://fonts.googleapis.com/css?family=IBM+Plex+Sans);
@import url(https://fonts.googleapis.com/css?family=IBM+Plex+Sans:700);
@import url(https://fonts.googleapis.com/css?family=IBM+Plex+Mono);


Expand Down
76 changes: 38 additions & 38 deletions slides.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ background-size: cover

<img src="figs/so-logo.svg" width="30%"/>

# Text Modeling
# **Text Modeling**

### USING TIDY DATA PRINCIPLES

### Julia Silge | IBM Community Day: AI
.large[**Julia Silge | IBM Community Day: AI**]

---
class: left, middle
Expand All @@ -74,7 +74,7 @@ background-size: cover
background-image: url(figs/white_bg.svg)
background-size: cover

# Text in the real world
# **Text in the real world**

--

Expand Down Expand Up @@ -122,7 +122,7 @@ background-size: 450px
background-image: url(figs/white_title.svg)
background-size: cover

# Two powerful NLP modeling approaches
# **Two powerful NLP techniques**

--

Expand All @@ -137,13 +137,13 @@ background-size: cover
background-image: url(figs/white_bg.svg)
background-size: cover

# Topic modeling
# **Topic modeling**

- .large[Each document = mixture of topics]
- .large[Each **document** = mixture of topics]

--

- .large[Each topic = mixture of words]
- .large[Each **topic** = mixture of words]

---

Expand All @@ -157,11 +157,11 @@ class: center, middle
background-image: url(figs/white_title.svg)
background-size: cover

# GREAT LIBRARY HEIST `r emo::ji("sleuth")`
# **GREAT LIBRARY HEIST** `r emo::ji("sleuth")`

---

## Downloading your text data
## **Downloading your text data**

```{r}
library(tidyverse)
Expand All @@ -180,7 +180,7 @@ books

---

## Someone has torn your books apart! `r emo::ji("sob")`
## **Someone has torn your books apart!** `r emo::ji("sob")`


```{r}
Expand All @@ -198,7 +198,7 @@ by_chapter

---

## Can we put them back together?
## **Can we put them back together?**

```{r}
library(tidytext)
Expand All @@ -214,7 +214,7 @@ word_counts

---

## Can we put them back together?
## **Can we put them back together?**

```{r}
words_sparse <- word_counts %>%
Expand All @@ -225,7 +225,7 @@ class(words_sparse)

---

## Train a topic model
## **Train a topic model**

Use a sparse matrix or a `quanteda::dfm` object as input

Expand All @@ -240,7 +240,7 @@ summary(topic_model)

---

## Exploring the output of topic modeling
## **Exploring the output of topic modeling**

.large[Time for tidying!]

Expand All @@ -252,7 +252,7 @@ chapter_topics

---

## Exploring the output of topic modeling
## **Exploring the output of topic modeling**

```{r}
top_terms <- chapter_topics %>%
Expand All @@ -265,7 +265,7 @@ top_terms
```

---
## Exploring the output of topic modeling
## **Exploring the output of topic modeling**

```{r, eval=FALSE}
top_terms %>%
Expand Down Expand Up @@ -293,7 +293,7 @@ top_terms %>%

---

## How are documents classified?
## **How are documents classified?**

```{r}
chapters_gamma <- tidy(topic_model, matrix = "gamma",
Expand All @@ -304,7 +304,7 @@ chapters_gamma

---

## How are documents classified?
## **How are documents classified?**

```{r}
chapters_parsed <- chapters_gamma %>%
Expand All @@ -315,7 +315,7 @@ chapters_parsed

---

## How are documents classified?
## **How are documents classified?**

```{r, eval=FALSE}
chapters_parsed %>%
Expand Down Expand Up @@ -343,14 +343,14 @@ class: center, middle
background-image: url(figs/white_title.svg)
background-size: cover

# GOING FARTHER `r emo::ji("rocket")`
# **GOING FARTHER** `r emo::ji("rocket")`

---

background-image: url(figs/white_bg.svg)
background-size: cover

## Tidying model output
## **Tidying model output**

### Which words in each document are assigned to which topics?

Expand All @@ -364,7 +364,7 @@ background-size: 850px

---

## Using stm
## **Using stm**

- .large[Document-level covariates]

Expand Down Expand Up @@ -393,7 +393,7 @@ background-size: 950px
background-image: url(figs/white_title.svg)
background-size: cover

# Stemming?
# **Stemming?**

.large[Advice from [Schofield & Mimno](https://mimno.infosci.cornell.edu/papers/schofield_tacl_2016.pdf)]

Expand All @@ -417,12 +417,12 @@ background-image: url(figs/white_title.svg)
background-size: cover


# Text classification
# **Text classification**
<h1 class="fa fa-balance-scale fa-fw"></h1>

---

## Downloading your text data
## **Downloading your text data**

```{r}
library(tidyverse)
Expand All @@ -440,7 +440,7 @@ books

---

## Making a tidy dataset
## **Making a tidy dataset**

.large[Use this kind of data structure for EDA! `r emo::ji("nail")`]

Expand All @@ -458,7 +458,7 @@ tidy_books

---

## Cast to a sparse matrix
## **Cast to a sparse matrix**

.large[And build a dataframe with a response variable]

Expand All @@ -474,7 +474,7 @@ books_joined <- data_frame(document = as.integer(rownames(sparse_words))) %>%

---

## Train a glmnet model
## **Train a glmnet model**

```{r}
library(glmnet)
Expand All @@ -490,7 +490,7 @@ model <- cv.glmnet(sparse_words, is_jane, family = "binomial",

---

## Tidying our model
## **Tidying our model**

.large[Tidy, then filter to choose some lambda from glmnet output]

Expand All @@ -508,7 +508,7 @@ Intercept <- coefs %>%

---

## Tidying our model
## **Tidying our model**

```{r}
classifications <- tidy_books %>%
Expand All @@ -522,7 +522,7 @@ classifications

---

## Understanding our model
## **Understanding our model**

```{r, eval=FALSE}
coefs %>%
Expand Down Expand Up @@ -551,7 +551,7 @@ coefs %>%

---

## ROC
## **ROC**

```{r}
comment_classes <- classifications %>%
Expand All @@ -569,7 +569,7 @@ roc <- comment_classes %>%

---

## ROC
## **ROC**

```{r}
roc %>%
Expand All @@ -592,7 +592,7 @@ roc %>%

---

## AUC for model
## **AUC for model**

```{r}
roc %>%
Expand All @@ -601,7 +601,7 @@ roc %>%

---

## Misclassifications
## **Misclassifications**

Let's talk about misclassifications. Which documents here were incorrectly predicted to be written by Jane Austen?

Expand All @@ -616,7 +616,7 @@ roc %>%

---

## Misclassifications
## **Misclassifications**

Let's talk about misclassifications. Which documents here were incorrectly predicted to *not* be written by Jane Austen?

Expand All @@ -636,14 +636,14 @@ background-image: url(figs/tmwr_0601.png)
background-position: 50% 70%
background-size: 750px

## Workflow for text mining/modeling
## **Workflow for text mining/modeling**

---
background-image: url(figs/lizzieskipping.gif)
background-position: 50% 55%
background-size: 750px

# Go explore real-world text!
# **Go explore real-world text!**

---

Expand Down
Loading

0 comments on commit 60c6959

Please sign in to comment.