Lecture on NLP software R (Zhuojun Gu, September 29, 0800)

The course material is below.

LectureNLP_2023Fall_Zhuojun.pdf Download LectureNLP_2023Fall_Zhuojun.pdf

In the lecture, you will try these code yourselves by copy-pasting.

Pre-requisites of the NLP software

Before taking the lecture, please install the Text package in R in your own laptop and bring it to the lecture.

It is assumed that one has installed the latest R (for Windows Links to an external site., for Mac Links to an external site.), and RStudio (RStudio desktop Links to an external site.) before doing the steps.

One can follow the steps below by entering the code in each step in the "Console" in RStudio interface:

  1. install.packages("devtools") ; 
  2. devtools::install_github("oscarkjell/text")
  3. text::textrpp_install()
  4. text::textrpp_initialize(save_profile = TRUE)
  5. library(text)
  6. textEmbed("hello")

All at a time or one-by-one are both OK.

If the code textEmbed("hello") could print out the following, then the installation is correct.
"

$tokens

$tokens$texts

$tokens$texts[[1]]

... many numbers ...

$texts

$texts$texts

... many numbers ...

"

FYI to play around:

  • More Links to an external site.information (if one encounters a problem during the installation) regarding the installation. Or one can contact zhuojun.gu@psy.lu.se before the lecture for assistance. But be sure to use these resources wisely to solve your question before contacting the instructor.
  • One could follow the questions Links to an external site. on Stack overflow site for further assistance which should be quicker.

A vignette article Links to an external site. on getting started with the Text R package if one has time.