<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/distributional-semantics-in-r-part-1-tm-classes-readwrite/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.exactness.net/post/154910180365"> The Exactness of Mind</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>The R code for this tutorial on Methods of Distributional Semantics in R is found in the respective<a target="_blank" rel="nofollow" href="https://github.com/GoranMilovanovic/Distributional-Semantics-in-R"> GitHub repository</a>. </p>
<p>Following my<a target="_blank" rel="nofollow" href="http://www.exactness.net/post/153902588705/belgrader-meetup-methods-of-distributional"> Methods of Distributional Semantics in R BelgradeR Meetup</a> with<a target="_blank" rel="nofollow" href="http://www.datascience.rs/"> Data Science Serbia</a>, organized in <a target="_blank" rel="nofollow" href="http://en.startit.rs/">Startit Center</a>, Belgrade,<br>
11/30/2016, several people asked me for the R code used for the analysis<br>
of William Shakespeare’s plays that was presented. I have decided to<br>
continue the development of the code that I’ve used during the Meetup in order to advance the examples<br>
that I have shown then into a more or less complete and comprehensible<br>
text-mining tutorial with<a target="_blank" rel="nofollow" href="https://cran.r-project.org/web/packages/tm/index.html"> {tm}</a>,<a target="_blank" rel="nofollow" href="https://cran.r-project.org/web/packages/openNLP/index.html"> {openNLP}</a>, and<a target="_blank" rel="nofollow" href="https://cran.r-project.org/web/packages/topicmodels/index.html"> {topicmodels}</a> in R. All<br>
files in this <a target="_blank" rel="nofollow" href="https://github.com/GoranMilovanovic/Distributional-Semantics-in-R">GitHub</a> repository are a product of that work.
</p>
<p>The idea here is to provide an overview of selected R packages and<br>
functions for text-mining and modeling in distributional semantics.<br>
Instead of presenting functions and packages in a piece-wise fashion, I<br>
have decided to develop a full text-mining pipeline by combining the<br>
essential steps orderly and exactly as one would need to follow them to<br>
arrive at some useful Data Science production following data wrangling,<br>
checking for integrity, text pre-processing, and modeling.</p>
<p>The first notebook – <a target="_blank" rel="nofollow" href="https://github.com/GoranMilovanovic/Distributional-Semantics-in-R/blob/master/DistSemanticsBelgradeR.Rmd">Part 1: The {tm} structures for text-mining in R</a> – introduces the classes provided by the {tm} package, and show you how to index a text corpus with metadata prior to modeling and analytics. I have also introduced the essential read and write (i.e. Vcorpus formation)  operations from {tm} there. </p>
<p>The forthcoming Part 2. of this tutorial will cover Entitity Recognition with {OpenNLP}. We will check how well can machine learning tell what characters appear in which Shakespeare’s play. In Part 3. we will deal with text pre-processing with {tm}, while Part 4. introduces topic modeling with Latent Dirichlet Allocation. Part 5, finally, will present an analytical exploration of the topic model.</p>
<figure data-orig-height="552" data-orig-width="586"><img alt="image" src="https://i0.wp.com/68.media.tumblr.com/9df71d5e63dd89bdbf7161591dfdeab4/tumblr_inline_oipnzjgw4H1qa0hyw_540.png?resize=456%2C430" data-orig-height="552" data-recalc-dims="1" data-orig-width="586"></figure>
<p><i>A semantic network of Shakespeare’s characters produced by {igraph} and from a previously developed LDA model from {topicmodels}.</i></p>
<p>The video of the Meetup that motivated me to develop this tutorial is on <a target="_blank" rel="nofollow" href="https://www.youtube.com/watch?v=lCt4GNHGZkE">YouTube</a> – however, no English titles yet.</p>
<p>The exercise uses the complete plays of <a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/William_Shakespeare">William Shakespeare</a> kindly provided by the <a target="_blank" rel="nofollow" href="http://web.mit.edu/">Massachusetts Institute of Technology</a> at their <a target="_blank" rel="nofollow" href="http://shakespeare.mit.edu/">The Complete Works of William Shakespeare</a> pages.</p>
<p>Stay tuned for more text-mining in R. </p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://www.exactness.net/post/154910180365"> The Exactness of Mind</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/jwLAnjUuagU"></a></div>