Skip to content

Commit

Permalink
Update references
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbarrie committed Jan 2, 2024
1 parent 845e682 commit b54b29e
Show file tree
Hide file tree
Showing 32 changed files with 171 additions and 164 deletions.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-170-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-171-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-19-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-20-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-24-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-270-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-36-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-37-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-38-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-42-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _bookdown_files/main_files/figure-html/unnamed-chunk-75-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 27 additions & 27 deletions docs/exercise-4-scaling-techniques.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,25 +223,25 @@ <h2>
## DailyMailUK 0.64904 0.012949
## DailyMirror 1.18235 0.006726
## EveningStandard -0.22616 0.016082
## guardian -0.95428 0.010563
## guardian -0.95429 0.010563
## MetroUK -0.04625 0.022759
## Telegraph -1.05344 0.010640
## Telegraph -1.05343 0.010640
## TheSun 1.45044 0.006048
## thetimes -1.00168 0.014966
##
## Estimated Feature Scores:
## rt breaking coronavirus outbreak declared pandemic world health
## beta 0.537 0.191 0.06918 -0.2654 -0.06525 -0.2004 -0.317 -0.3277
## beta 0.537 0.191 0.06919 -0.2654 -0.06525 -0.2004 -0.317 -0.3277
## psi 5.307 3.535 5.78715 3.1348 0.50705 3.1738 3.366 3.2041
## organisation genuinely interested see one cos fair
## beta -0.4118 -0.2873 -0.2545 0.0005141 -0.06312 -0.2788 -0.03078
## beta -0.4118 -0.2873 -0.2545 0.0005206 -0.06312 -0.2788 -0.03077
## psi 0.5487 -0.5403 -1.4502 2.7723965 3.85881 -1.4480 0.35480
## german care system protect troubled children #covid19 anxiety shows
## beta -0.7424 -0.3251 -1.105 -0.1106 -0.4731 0.01205 -0.6742 0.4218 0.4165
## beta -0.7424 -0.3251 -1.105 -0.1106 -0.4731 0.01206 -0.6742 0.4218 0.4165
## psi 1.1009 3.1042 1.259 1.8918 -0.0784 2.85004 2.9703 0.5917 2.8370
## sign man behind app explains tips
## beta -0.1215 0.5112 0.05499 0.271 0.6687 -0.2083
## psi 1.9427 3.5777 2.43805 1.376 1.2749 1.5341</code></pre>
## sign man behind app explains tips
## beta -0.1215 0.5112 0.055 0.271 0.6687 -0.2083
## psi 1.9427 3.5777 2.438 1.376 1.2749 1.5341</code></pre>
<p>We can then plot our estimates of the <span class="math inline">\(\theta\)</span>s—i.e., the estimates of the latent newspaper position—as so.</p>
<div class="sourceCode" id="cb310"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/pkg/quanteda.textplots/man/textplot_scale1d.html">textplot_scale1d</a></span><span class="op">(</span><span class="va">dfm_newstweets_results</span><span class="op">)</span></span></code></pre></div>
Expand Down Expand Up @@ -289,151 +289,151 @@ <h2>
🎥
</td>
<td style="text-align:right;">
7.789177
7.789179
</td>
</tr>
<tr>
<td style="text-align:left;">
diver
</td>
<td style="text-align:right;">
7.015286
7.015287
</td>
</tr>
<tr>
<td style="text-align:left;">
alien-looking
</td>
<td style="text-align:right;">
6.054604
6.054606
</td>
</tr>
<tr>
<td style="text-align:left;">
wwe
</td>
<td style="text-align:right;">
5.304747
5.304748
</td>
</tr>
<tr>
<td style="text-align:left;">
cutest
</td>
<td style="text-align:right;">
5.304747
5.304748
</td>
</tr>
<tr>
<td style="text-align:left;">
lad
</td>
<td style="text-align:right;">
5.012238
5.012240
</td>
</tr>
<tr>
<td style="text-align:left;">
bargains
</td>
<td style="text-align:right;">
4.835002
4.835004
</td>
</tr>
<tr>
<td style="text-align:left;">
partner’s
</td>
<td style="text-align:right;">
4.692457
4.692459
</td>
</tr>
<tr>
<td style="text-align:left;">
ronaldo
</td>
<td style="text-align:right;">
4.495505
4.495507
</td>
</tr>
<tr>
<td style="text-align:left;">
clever
</td>
<td style="text-align:right;">
4.351124
4.351125
</td>
</tr>
<tr>
<td style="text-align:left;">
wheelchair
</td>
<td style="text-align:right;">
4.340555
4.340558
</td>
</tr>
<tr>
<td style="text-align:left;">
mcguinness
</td>
<td style="text-align:right;">
4.340555
4.340558
</td>
</tr>
<tr>
<td style="text-align:left;">
spider
</td>
<td style="text-align:right;">
4.192179
4.192181
</td>
</tr>
<tr>
<td style="text-align:left;">
nails
</td>
<td style="text-align:right;">
4.192179
4.192181
</td>
</tr>
<tr>
<td style="text-align:left;">
rides
</td>
<td style="text-align:right;">
3.950631
3.950633
</td>
</tr>
<tr>
<td style="text-align:left;">
ghostly
</td>
<td style="text-align:right;">
3.950631
3.950633
</td>
</tr>
<tr>
<td style="text-align:left;">
extensions
</td>
<td style="text-align:right;">
3.950631
3.950633
</td>
</tr>
<tr>
<td style="text-align:left;">
corrie’s
</td>
<td style="text-align:right;">
3.950631
3.950633
</td>
</tr>
<tr>
<td style="text-align:left;">
lion
</td>
<td style="text-align:right;">
3.857078
3.857080
</td>
</tr>
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion docs/exercise-7-sampling-text-information.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ <h2>
<h2>
<span class="header-section-number">23.4</span> Getting YouTube data<a class="anchor" aria-label="anchor" href="#getting-youtube-data"><i class="fas fa-link"></i></a>
</h2>
<p>In the paper by <span class="citation">(<a href="#ref-haroon2022"><strong>haroon2022?</strong></a>)</span>, the authors analyze the recommended videos for a particular used based on their watch history and on a seed video. In the below, we won’t replicate the first step but we will look at the recommended videos that appear based on a seed video.</p>
<p>In the paper by <span class="citation">Haroon et al. (<a href="references-2.html#ref-haroon2022">2022</a>)</span>, the authors analyze the recommended videos for a particular used based on their watch history and on a seed video. In the below, we won’t replicate the first step but we will look at the recommended videos that appear based on a seed video.</p>
<p>In this case, our seed video is a video by Jordan Peterson predicting the death of mainstream media. This is fairly “alternative” content and is actively taking a stance against mainstream media. So does this mean YouTube will learn to recommend us <em>away</em> from mainstream content?</p>
<div class="sourceCode" id="cb402"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://tidyverse.tidyverse.org">tidyverse</a></span><span class="op">)</span></span>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h1>
</header><main class="col-sm-12 col-md-9 col-lg-7" id="content"><!--bookdown:title:end--><!--bookdown:title:start--><div id="computational-text-analysis-pgsp11584" class="section level1 unnumbered">
<h1>“Computational Text Analysis” (PGSP11584)<a class="anchor" aria-label="anchor" href="#computational-text-analysis-pgsp11584"><i class="fas fa-link"></i></a>
</h1>
<p><img src="coverb.png" class="cover" width="250" alt="cover"> This is the dedicated webpage for the course Computational Text Analysis” <a href="http://www.drps.ed.ac.uk/21-22/dpt/cxpgsp11584.htm">(PGSP11584)</a> at the University of Edinburgh, taught by Christopher Barrie. Go to the Course Overview and Introduction tabs for a course overview and introduction to R.</p>
<p><img src="coverb.png" class="cover" width="250" alt="cover"> This is the dedicated webpage for the course Computational Text Analysis” <a href="http://www.drps.ed.ac.uk/23-24/dpt/cxpgsp11584.htm">(PGSP11584)</a> at the University of Edinburgh, taught by Christopher Barrie. Go to the Course Overview and Introduction tabs for a course overview and introduction to R.</p>
<p>We will be using this online book throughout the course. Each week has a set of essential and recommended readings. The essential readings must be consulted in full prior to the Lecture and Seminar for that week. In addition, you will find online Exercises and examples written in R. This is a “live” book and will be amended and updated during the course itself.</p>
<div id="structure" class="section level2" number="0.1">
<h2>
Expand Down
Binary file modified docs/main_files/figure-html/unnamed-chunk-170-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main_files/figure-html/unnamed-chunk-171-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main_files/figure-html/unnamed-chunk-19-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main_files/figure-html/unnamed-chunk-20-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main_files/figure-html/unnamed-chunk-24-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main_files/figure-html/unnamed-chunk-270-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main_files/figure-html/unnamed-chunk-36-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main_files/figure-html/unnamed-chunk-37-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main_files/figure-html/unnamed-chunk-38-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main_files/figure-html/unnamed-chunk-42-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main_files/figure-html/unnamed-chunk-75-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/references-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ <h1>
<div id="ref-brier_computer_2011" class="csl-entry">
Brier, Alan, and Bruno Hopp. 2011. <span>“Computer Assisted Text Analysis in the Social Sciences.”</span> <em>Quality &amp; Quantity</em> 45 (1): 103–28. <a href="https://doi.org/10.1007/s11135-010-9350-8">https://doi.org/10.1007/s11135-010-9350-8</a>.
</div>
<div id="ref-brooke2021trouble" class="csl-entry">
Brooke, SJ. 2021. <span>“Trouble in Programmer’s Paradise: Gender-Biases in Sharing and Recognising Technical Knowledge on Stack Overflow.”</span> <em>Information, Communication &amp; Society</em> 24 (14): 2091–2112.
</div>
<div id="ref-bunea_quantitative_2015" class="csl-entry">
Bunea, Adriana, and Raimondas Ibenskas. 2015. <span>“Quantitative Text Analysis and the Study of <span>EU</span> Lobbying and Interest Groups.”</span> <em>European Union Politics</em> 16 (3): 429–55. <a href="https://doi.org/10.1177/1465116515577821">https://doi.org/10.1177/1465116515577821</a>.
</div>
Expand Down Expand Up @@ -196,6 +199,9 @@ <h1>
<div id="ref-grimmer_text_2013-1" class="csl-entry">
———. 2013b. <span>“Text as <span>Data</span>: <span>The</span> <span>Promise</span> and <span>Pitfalls</span> of <span>Automatic</span> <span>Content</span> <span>Analysis</span> <span>Methods</span> for <span>Political</span> <span>Texts</span>.”</span> <em>Political Analysis</em> 21 (3): 267–97. <a href="https://doi.org/10.1093/pan/mps028">https://doi.org/10.1093/pan/mps028</a>.
</div>
<div id="ref-haroon2022" class="csl-entry">
Haroon, Muhammad, Anshuman Chhabra, Xin Liu, Prasant Mohapatra, Zubair Shafiq, and Magdalena Wojcieszak. 2022. <span>“YouTube, the Great Radicalizer? Auditing and Mitigating Ideological Biases in YouTube Recommendations.”</span> <a href="https://doi.org/10.48550/ARXIV.2203.10666">https://doi.org/10.48550/ARXIV.2203.10666</a>.
</div>
<div id="ref-hopkins_method_2010" class="csl-entry">
Hopkins, Daniel J., and Gary King. 2010. <span>“A <span>Method</span> of <span>Automated</span> <span>Nonparametric</span> <span>Content</span> <span>Analysis</span> for <span>Social</span> <span>Science</span>.”</span> <em>American Journal of Political Science</em> 54 (1): 229–47. <a href="https://doi.org/10.1111/j.1540-5907.2009.00428.x">https://doi.org/10.1111/j.1540-5907.2009.00428.x</a>.
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/search.json

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions docs/week-2-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,20 @@ <h2>
<code class="sourceCode R"><span><span class="va">lipsum_text</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span>text <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/pkg/stringi/man/stri_rand_lipsum.html">stri_rand_lipsum</a></span><span class="op">(</span><span class="fl">1</span>, start_lipsum <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span><span class="op">)</span></span>
<span></span>
<span><span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span><span class="op">(</span><span class="va">lipsum_text</span><span class="op">$</span><span class="va">text</span><span class="op">)</span></span></code></pre></div>
<pre><code>## [1] "Lorem ipsum dolor sit amet, consectetur dictum ante id urna, quis convallis. Eros ut magnis mauris, eros auctor! Auctor ipsum eu himenaeos interdum. Dictum, litora urna sapien ut morbi, dui at ante at. Lorem vitae ac ut commodo. Id non ridiculus leo erat, tristique inceptos mauris faucibus consectetur erat et. Ex sed at accumsan. Molestie ultricies eu nisl congue duis volutpat ac. Lectus, est ornare sed vel dignissim ac parturient nisl vivamus."</code></pre>
<pre><code>## [1] "Lorem ipsum dolor sit amet, mauris dolor posuere sed sit dapibus sapien egestas semper aptent. Luctus, eu, pretium enim, sociosqu rhoncus quis aliquam. In in in auctor natoque venenatis tincidunt. At scelerisque neque porta ut mi a, congue quis curae. Facilisis, adipiscing mauris. Dis non interdum cum commodo, tempor sapien donec in luctus. Nascetur ullamcorper, dui non semper, arcu sed. Sed non pellentesque rutrum tempor, curabitur in. Taciti gravida ut interdum iaculis. Arcu consectetur dictum et erat vestibulum luctus ridiculus! Luctus metus ad ex bibendum, eget at maximus nisl quisque ante posuere aptent. Cubilia tellus sed aliquam, suspendisse arcu et dapibus aenean. Ultricies primis sit nulla condimentum, sed, phasellus viverra nullam, primis."</code></pre>
<p>We can then tokenize with the <code><a href="https://rdrr.io/pkg/tidytext/man/unnest_tokens.html">unnest_tokens()</a></code> function in <code>tidytext</code>.</p>
<div class="sourceCode" id="cb19"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">tokens</span> <span class="op">&lt;-</span> <span class="va">lipsum_text</span> <span class="op"><a href="https://magrittr.tidyverse.org/reference/pipe.html">%&gt;%</a></span></span>
<span> <span class="fu"><a href="https://rdrr.io/pkg/tidytext/man/unnest_tokens.html">unnest_tokens</a></span><span class="op">(</span><span class="va">word</span>, <span class="va">text</span><span class="op">)</span></span>
<span></span>
<span><span class="fu"><a href="https://rdrr.io/r/utils/head.html">head</a></span><span class="op">(</span><span class="va">tokens</span><span class="op">)</span></span></code></pre></div>
<pre><code>## word
## 1 lorem
## 2 ipsum
## 3 dolor
## 4 sit
## 5 amet
## 6 consectetur</code></pre>
<pre><code>## word
## 1 lorem
## 2 ipsum
## 3 dolor
## 4 sit
## 5 amet
## 6 mauris</code></pre>
<p>Now we’ll get some larger data, simulating 5000 observations (rows) of random Latin text strings.</p>
<div class="sourceCode" id="cb21"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co">## Varying total words example</span></span>
Expand Down Expand Up @@ -229,39 +229,39 @@ <h2>
lipsum
</td>
<td style="text-align:right;">
71067
72170
</td>
</tr>
<tr>
<td style="text-align:left;">
more
</td>
<td style="text-align:right;">
71067
72170
</td>
</tr>
<tr>
<td style="text-align:left;">
words
</td>
<td style="text-align:right;">
66308
67407
</td>
</tr>
<tr>
<td style="text-align:left;">
sed
</td>
<td style="text-align:right;">
17855
17608
</td>
</tr>
<tr>
<td style="text-align:left;">
in
</td>
<td style="text-align:right;">
12467
12437
</td>
</tr>
</tbody>
Expand Down
Loading

0 comments on commit b54b29e

Please sign in to comment.