#library(NLP)
#library(openNLP)
library(magrittr)

# R wrapper for spaCy Python package to extract parts of speech:
library(spacyr) 

str1 <- c("Mr Smith eats Chicago deep dish pizza!", "Also Pizzeria Uno!")
cat("\n")
print(paste0("contents of str1:"))
str1

parsed1 <- spacy_parse(str1, lemma = FALSE, entity = TRUE, nounphrase = TRUE)
entity_extract(parsed1)

entity_extract(parsed1, type = "all")

entity_consolidate(parsed1) %>%
    tail()

