regicid
commited on
Commit
·
9b3132c
1
Parent(s):
30939fc
bla
Browse files- full_data.csv +2 -2
- scripts/figures.qmd +18 -16
full_data.csv
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9fec1f45e6d895ed85cb6194f2deef78ffec33d6cf64bf6af4580718db20fd0d
|
3 |
+
size 1050186765
|
scripts/figures.qmd
CHANGED
@@ -287,31 +287,33 @@ ggplot(result, aes(year,Male/Female)) + geom_point() + geom_smooth(color="black"
|
|
287 |
|
288 |
```{r}
|
289 |
#Stereotypes data preparation
|
290 |
-
files = read.csv("~/Downloads/citations_by_article.csv",
|
291 |
-
col.names = c("filename","n_men","n_women","verbs_men",
|
292 |
-
"verbs_men_lemmatized","verbs_women","verbs_women_lemmatized"))
|
293 |
-
z = duplicated(files$filename)
|
294 |
-
files = files[!z,]
|
295 |
-
library(stringr)
|
296 |
-
files$filename = str_c(files$filename,".txt")
|
297 |
-
z = duplicated(data$filename)
|
298 |
-
verbs_data = data[!z,c("filename","sexe_prenom","year","rubrique")] %>%
|
299 |
-
right_join(files,by="filename")
|
300 |
#verbs_data = filter(verbs_data,sexe_prenom =="Men")
|
301 |
verbs = unique(read.csv("https://raw.githubusercontent.com/gillesbastin/old_fashion_nlp/refs/heads/main/cues_all.csv")$lemmatized_cue)
|
302 |
```
|
303 |
|
304 |
```{r}
|
305 |
##Compute odds ratios
|
|
|
|
|
306 |
threshold = 30
|
307 |
-
men =
|
308 |
verbs_men_lemmatized = strsplit(verbs_men_lemmatized, ";")) %>%
|
309 |
unnest(verbs_men_lemmatized) %>%
|
310 |
count(verbs_men_lemmatized) %>% ungroup() %>%
|
311 |
complete(verbs_men_lemmatized = verbs,fill = list(n = 0,year = 1945)) %>%
|
312 |
arrange(verbs_men_lemmatized)
|
313 |
-
|
314 |
-
men <- men %>%
|
315 |
pivot_wider(
|
316 |
names_from = verbs_men_lemmatized,
|
317 |
values_from = n,
|
@@ -324,14 +326,14 @@ men = men %>% dplyr::select(-year) %>%
|
|
324 |
|
325 |
|
326 |
|
327 |
-
women =
|
328 |
verbs_women_lemmatized = strsplit(verbs_women_lemmatized, ";")) %>%
|
329 |
unnest(verbs_women_lemmatized) %>%
|
330 |
count(verbs_women_lemmatized) %>% ungroup() %>%
|
331 |
complete(verbs_women_lemmatized = verbs,fill = list(n = 0,year = 1945)) %>%
|
332 |
arrange(verbs_women_lemmatized)
|
333 |
-
|
334 |
-
women <- women %>%
|
335 |
pivot_wider(
|
336 |
names_from = verbs_women_lemmatized,
|
337 |
values_from = n,
|
|
|
287 |
|
288 |
```{r}
|
289 |
#Stereotypes data preparation
|
290 |
+
#files = read.csv("~/Downloads/citations_by_article.csv",
|
291 |
+
# col.names = c("filename","n_men","n_women","verbs_men",
|
292 |
+
# "verbs_men_lemmatized","verbs_women","verbs_women_lemmatized"))
|
293 |
+
#z = duplicated(files$filename)
|
294 |
+
#files = files[!z,]
|
295 |
+
#library(stringr)
|
296 |
+
#files$filename = str_c(files$filename,".txt")
|
297 |
+
#z = duplicated(data$filename)
|
298 |
+
#verbs_data = data[!z,c("filename","sexe_prenom","year","rubrique")] %>%
|
299 |
+
# right_join(files,by="filename")
|
300 |
#verbs_data = filter(verbs_data,sexe_prenom =="Men")
|
301 |
verbs = unique(read.csv("https://raw.githubusercontent.com/gillesbastin/old_fashion_nlp/refs/heads/main/cues_all.csv")$lemmatized_cue)
|
302 |
```
|
303 |
|
304 |
```{r}
|
305 |
##Compute odds ratios
|
306 |
+
verbs = unique(read.csv("https://raw.githubusercontent.com/gillesbastin/old_fashion_nlp/refs/heads/main/cues_all.csv")$lemmatized_cue)
|
307 |
+
|
308 |
threshold = 30
|
309 |
+
men = data %>% group_by(year) %>% mutate(
|
310 |
verbs_men_lemmatized = strsplit(verbs_men_lemmatized, ";")) %>%
|
311 |
unnest(verbs_men_lemmatized) %>%
|
312 |
count(verbs_men_lemmatized) %>% ungroup() %>%
|
313 |
complete(verbs_men_lemmatized = verbs,fill = list(n = 0,year = 1945)) %>%
|
314 |
arrange(verbs_men_lemmatized)
|
315 |
+
z = is.na(men$verbs_men_lemmatized)
|
316 |
+
men <- men[!z,] %>%
|
317 |
pivot_wider(
|
318 |
names_from = verbs_men_lemmatized,
|
319 |
values_from = n,
|
|
|
326 |
|
327 |
|
328 |
|
329 |
+
women = data %>% group_by(year) %>% mutate(
|
330 |
verbs_women_lemmatized = strsplit(verbs_women_lemmatized, ";")) %>%
|
331 |
unnest(verbs_women_lemmatized) %>%
|
332 |
count(verbs_women_lemmatized) %>% ungroup() %>%
|
333 |
complete(verbs_women_lemmatized = verbs,fill = list(n = 0,year = 1945)) %>%
|
334 |
arrange(verbs_women_lemmatized)
|
335 |
+
z = is.na(men$verbs_men_lemmatized)
|
336 |
+
women <- women[z,] %>%
|
337 |
pivot_wider(
|
338 |
names_from = verbs_women_lemmatized,
|
339 |
values_from = n,
|