<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=%D0%9A%D0%B0%D0%BA_%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%81%D1%82%D0%B8_%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7_%D1%82%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0</id>
	<title>Как провести анализ тональности текста - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://digida.mgpu.ru/index.php?action=history&amp;feed=atom&amp;title=%D0%9A%D0%B0%D0%BA_%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%81%D1%82%D0%B8_%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7_%D1%82%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0"/>
	<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=%D0%9A%D0%B0%D0%BA_%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%81%D1%82%D0%B8_%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7_%D1%82%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0&amp;action=history"/>
	<updated>2026-06-29T16:44:11Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=%D0%9A%D0%B0%D0%BA_%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%81%D1%82%D0%B8_%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7_%D1%82%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0&amp;diff=44394&amp;oldid=prev</id>
		<title>Patarakin в 05:45, 24 февраля 2026</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=%D0%9A%D0%B0%D0%BA_%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%81%D1%82%D0%B8_%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7_%D1%82%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0&amp;diff=44394&amp;oldid=prev"/>
		<updated>2026-02-24T05:45:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 08:45, 24 февраля 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Строка 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{#ask: [[Анализ тональности текста]] | ?Description }}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{#ask: [[Анализ тональности текста]] | ?Description }}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;; Основные понятия: Тональный анализ (sentiment analysis), лексиконы (AFINN, Bing, NRC), токенизация текста (unnest_tokens), агрегация по индексам (pivot_wider), визуализация настроений (ggplot2, wordcloud).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key digida:diff:1.41:old-44392:rev-44394:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Patarakin</name></author>
	</entry>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=%D0%9A%D0%B0%D0%BA_%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%81%D1%82%D0%B8_%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7_%D1%82%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0&amp;diff=44392&amp;oldid=prev</id>
		<title>Patarakin в 05:43, 24 февраля 2026</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=%D0%9A%D0%B0%D0%BA_%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%81%D1%82%D0%B8_%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7_%D1%82%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0&amp;diff=44392&amp;oldid=prev"/>
		<updated>2026-02-24T05:43:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 08:43, 24 февраля 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l115&quot;&gt;Строка 115:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 115:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Файл:Sentiments differents.jpg]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Lesson]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Категория:Lesson]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key digida:diff:1.41:old-44390:rev-44392:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Patarakin</name></author>
	</entry>
	<entry>
		<id>http://digida.mgpu.ru/index.php?title=%D0%9A%D0%B0%D0%BA_%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%81%D1%82%D0%B8_%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7_%D1%82%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0&amp;diff=44390&amp;oldid=prev</id>
		<title>Patarakin: Новая страница: « {{#ask: Анализ тональности текста | ?Description }}   &lt;syntaxhighlight lang=&quot;R&quot; line&gt; library(tidytext) library(textdata) get_sentiments(&quot;afinn&quot;) get_sentiments(&quot;bing&quot;) get_sentiments(&quot;nrc&quot;)  ## library(janeaustenr) library(dplyr) library(stringr)  tidy_books &lt;- austen_books() %&gt;%   group_by(book) %&gt;%   mutate(     linenumber = row_number(),     chapter = cumsum(str_detect(text,                                  regex(&quot;^chapter [\\...»</title>
		<link rel="alternate" type="text/html" href="http://digida.mgpu.ru/index.php?title=%D0%9A%D0%B0%D0%BA_%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%81%D1%82%D0%B8_%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7_%D1%82%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0&amp;diff=44390&amp;oldid=prev"/>
		<updated>2026-02-24T05:39:15Z</updated>

		<summary type="html">&lt;p&gt;Новая страница: « {{#ask: &lt;a href=&quot;/index.php/%D0%90%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7_%D1%82%D0%BE%D0%BD%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8_%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0&quot; title=&quot;Анализ тональности текста&quot;&gt;Анализ тональности текста&lt;/a&gt; | ?Description }}   &amp;lt;syntaxhighlight lang=&amp;quot;R&amp;quot; line&amp;gt; library(tidytext) library(textdata) get_sentiments(&amp;quot;afinn&amp;quot;) get_sentiments(&amp;quot;bing&amp;quot;) get_sentiments(&amp;quot;nrc&amp;quot;)  ## library(janeaustenr) library(dplyr) library(stringr)  tidy_books &amp;lt;- austen_books() %&amp;gt;%   group_by(book) %&amp;gt;%   mutate(     linenumber = row_number(),     chapter = cumsum(str_detect(text,                                  regex(&amp;quot;^chapter [\\...»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
{{#ask: [[Анализ тональности текста]] | ?Description }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;R&amp;quot; line&amp;gt;&lt;br /&gt;
library(tidytext)&lt;br /&gt;
library(textdata)&lt;br /&gt;
get_sentiments(&amp;quot;afinn&amp;quot;)&lt;br /&gt;
get_sentiments(&amp;quot;bing&amp;quot;)&lt;br /&gt;
get_sentiments(&amp;quot;nrc&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
##&lt;br /&gt;
library(janeaustenr)&lt;br /&gt;
library(dplyr)&lt;br /&gt;
library(stringr)&lt;br /&gt;
&lt;br /&gt;
tidy_books &amp;lt;- austen_books() %&amp;gt;%&lt;br /&gt;
  group_by(book) %&amp;gt;%&lt;br /&gt;
  mutate(&lt;br /&gt;
    linenumber = row_number(),&lt;br /&gt;
    chapter = cumsum(str_detect(text, &lt;br /&gt;
                                regex(&amp;quot;^chapter [\\divxlc]&amp;quot;, &lt;br /&gt;
                                      ignore_case = TRUE)))) %&amp;gt;%&lt;br /&gt;
  ungroup() %&amp;gt;%&lt;br /&gt;
  unnest_tokens(word, text)&lt;br /&gt;
&lt;br /&gt;
nrc_joy &amp;lt;- get_sentiments(&amp;quot;nrc&amp;quot;) %&amp;gt;% &lt;br /&gt;
  filter(sentiment == &amp;quot;joy&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
tidy_books %&amp;gt;%&lt;br /&gt;
  filter(book == &amp;quot;Emma&amp;quot;) %&amp;gt;%&lt;br /&gt;
  inner_join(nrc_joy) %&amp;gt;%&lt;br /&gt;
  count(word, sort = TRUE)&lt;br /&gt;
&lt;br /&gt;
jane_austen_sentiment &amp;lt;- tidy_books %&amp;gt;%&lt;br /&gt;
  inner_join(get_sentiments(&amp;quot;bing&amp;quot;)) %&amp;gt;%&lt;br /&gt;
  count(book, index = linenumber %/% 80, sentiment) %&amp;gt;%&lt;br /&gt;
  pivot_wider(names_from = sentiment, values_from = n, values_fill = 0) %&amp;gt;% &lt;br /&gt;
  mutate(sentiment = positive - negative)&lt;br /&gt;
&lt;br /&gt;
library(ggplot2)&lt;br /&gt;
ggplot(jane_austen_sentiment, aes(index, sentiment, fill = book)) +&lt;br /&gt;
  geom_col(show.legend = FALSE) +&lt;br /&gt;
  facet_wrap(~book, ncol = 2, scales = &amp;quot;free_x&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
pride_prejudice &amp;lt;- tidy_books %&amp;gt;% &lt;br /&gt;
  filter(book == &amp;quot;Pride &amp;amp; Prejudice&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
pride_prejudice&lt;br /&gt;
&lt;br /&gt;
###&lt;br /&gt;
&lt;br /&gt;
afinn &amp;lt;- pride_prejudice %&amp;gt;% &lt;br /&gt;
  inner_join(get_sentiments(&amp;quot;afinn&amp;quot;)) %&amp;gt;% &lt;br /&gt;
  group_by(index = linenumber %/% 80) %&amp;gt;% &lt;br /&gt;
  summarise(sentiment = sum(value)) %&amp;gt;% &lt;br /&gt;
  mutate(method = &amp;quot;AFINN&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
bing_and_nrc &amp;lt;- bind_rows(&lt;br /&gt;
  pride_prejudice %&amp;gt;% &lt;br /&gt;
    inner_join(get_sentiments(&amp;quot;bing&amp;quot;)) %&amp;gt;%&lt;br /&gt;
    mutate(method = &amp;quot;Bing et al.&amp;quot;),&lt;br /&gt;
  pride_prejudice %&amp;gt;% &lt;br /&gt;
    inner_join(get_sentiments(&amp;quot;nrc&amp;quot;) %&amp;gt;% &lt;br /&gt;
                 filter(sentiment %in% c(&amp;quot;positive&amp;quot;, &lt;br /&gt;
                                         &amp;quot;negative&amp;quot;))&lt;br /&gt;
    ) %&amp;gt;%&lt;br /&gt;
    mutate(method = &amp;quot;NRC&amp;quot;)) %&amp;gt;%&lt;br /&gt;
  count(method, index = linenumber %/% 80, sentiment) %&amp;gt;%&lt;br /&gt;
  pivot_wider(names_from = sentiment,&lt;br /&gt;
              values_from = n,&lt;br /&gt;
              values_fill = 0) %&amp;gt;% &lt;br /&gt;
  mutate(sentiment = positive - negative)&lt;br /&gt;
&lt;br /&gt;
bind_rows(afinn, &lt;br /&gt;
          bing_and_nrc) %&amp;gt;%&lt;br /&gt;
  ggplot(aes(index, sentiment, fill = method)) +&lt;br /&gt;
  geom_col(show.legend = FALSE) +&lt;br /&gt;
  facet_wrap(~method, ncol = 1, scales = &amp;quot;free_y&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
###&lt;br /&gt;
&lt;br /&gt;
bing_word_counts &amp;lt;- tidy_books %&amp;gt;%&lt;br /&gt;
  inner_join(get_sentiments(&amp;quot;bing&amp;quot;)) %&amp;gt;%&lt;br /&gt;
  count(word, sentiment, sort = TRUE) %&amp;gt;%&lt;br /&gt;
  ungroup()&lt;br /&gt;
&lt;br /&gt;
bing_word_counts %&amp;gt;%&lt;br /&gt;
  group_by(sentiment) %&amp;gt;%&lt;br /&gt;
  slice_max(n, n = 10) %&amp;gt;% &lt;br /&gt;
  ungroup() %&amp;gt;%&lt;br /&gt;
  mutate(word = reorder(word, n)) %&amp;gt;%&lt;br /&gt;
  ggplot(aes(n, word, fill = sentiment)) +&lt;br /&gt;
  geom_col(show.legend = FALSE) +&lt;br /&gt;
  facet_wrap(~sentiment, scales = &amp;quot;free_y&amp;quot;) +&lt;br /&gt;
  labs(x = &amp;quot;Contribution to sentiment&amp;quot;,&lt;br /&gt;
       y = NULL)&lt;br /&gt;
&lt;br /&gt;
####&lt;br /&gt;
library(wordcloud)&lt;br /&gt;
tidy_books %&amp;gt;%&lt;br /&gt;
  anti_join(stop_words) %&amp;gt;%&lt;br /&gt;
  count(word) %&amp;gt;%&lt;br /&gt;
  with(wordcloud(word, n, max.words = 100))&lt;br /&gt;
&lt;br /&gt;
library(reshape2)&lt;br /&gt;
&lt;br /&gt;
tidy_books %&amp;gt;%&lt;br /&gt;
  inner_join(get_sentiments(&amp;quot;bing&amp;quot;)) %&amp;gt;%&lt;br /&gt;
  count(word, sentiment, sort = TRUE) %&amp;gt;%&lt;br /&gt;
  acast(word ~ sentiment, value.var = &amp;quot;n&amp;quot;, fill = 0) %&amp;gt;%&lt;br /&gt;
  comparison.cloud(colors = c(&amp;quot;gray20&amp;quot;, &amp;quot;gray80&amp;quot;),&lt;br /&gt;
                   max.words = 100)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Категория:Lesson]]&lt;/div&gt;</summary>
		<author><name>Patarakin</name></author>
	</entry>
</feed>