Lecture: How to handle FRIENDS, r, excel ver. 12

Last Updated on June 14, 2022 by shibatau

The red part is added.

I. What shall we learn?

We will learn how to use friends. The library provides the complete script transcription of the Friends sitcom.

II. The scripts

You can run R scripts on Google Colaboratory with r magic. First run the following code.

%load_ext rpy2.ipython

And you have to begin with %%R in every cell. You can see some sample scripts here:

https://colab.research.google.com/drive/1i4CI8sNiz2Jfj2ilyLzfOH518kajqDRQ?usp=sharing

III. Retrieving the texts for a particular scene

You can easily retrieve the texts in any scene in any episode in any season.

df0_se1_ep1_sc2 <- df0 |>
filter(season == 1 & episode == 1 & scene == 2)
df0_se1_ep1_sc2
 

The results:

> df0_se1_ep1_sc2
# A tibble: 62 x 6
   text                                  speaker    season episode scene utterance
   <chr>                                 <chr>       <int>   <int> <int>     <int>
 1 Now I'm guessing that he bought her … Monica Ge…      1       1     2         1
 2 Tuna or egg salad? Decide!            Chandler …      1       1     2         2
 3 I'll have whatever Christine is havi… Ross Gell…      1       1     2         3
 4 Daddy, I just... I can't marry him! … Rachel Gr…      1       1     2         4
 5 (The scene on TV has changed to show… Scene Dir…      1       1     2         5
 6 If I let go of my hair, my head will… Phoebe Bu…      1       1     2         6
 7 Ooh, she should not be wearing those… Chandler …      1       1     2         7
 8 I say push her down the stairs.       Joey Trib…      1       1     2         8
 9 Push her down the stairs! Push her d… NA              1       1     2         9
10 (She is pushed down the stairs and e… Scene Dir…      1       1     2        10
# … with 52 more rows

IV. Finding in which season or episode the texts are spoken

V. Parsing the dependency of words

If you want to parse the sentence and get a chart of the dependency of words, see:

dependency parsing with udpipe

You can get a chart like this:

You can see the scripts here:

https://colab.research.google.com/drive/1Vw25LqG0JQcOpnIxVhfDoq5xE3X9-ch3?usp=sharing

VI. In Excel online

You can get friend.csv from the link above.

1.You can find the speaker and season for any utterance with the function:

=FILTER(B2:G67374,ISNUMBER(SEARCH("Captain Crunch's", B2:B67374)))

2.Total utterance by name

The filter function is currently available only to Microsoft 365 subscribers. You can filter rows without the function like this:

About shibatau

I was born and grown up in Kyoto. I studied western philosophy at the University and specialized in analytic philosophy, especially Ludwig Wittgenstein at the postgraduate school. I'm interested in new technology, especially machine learning and have been learning R language for two years and began to learn Python last summer. Listening toParamore, Sia, Amazarashi and MIyuki Nakajima. Favorite movies I've recently seen: "FREEHELD". Favorite actors and actresses: Anthony Hopkins, Denzel Washington, Ellen Page, Meryl Streep, Mia Wasikowska and Robert DeNiro. Favorite books: Fyodor Mikhailovich Dostoyevsky, "The Karamazov Brothers", Shinran, "Lamentations of Divergences". Favorite phrase: Salvation by Faith. Twitter: @shibatau

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.