Skip to content

Instantly share code, notes, and snippets.

@PolMine
Created December 27, 2019 22:55
Show Gist options
  • Save PolMine/76bbf7623e60bb19cde9658a8096c1d3 to your computer and use it in GitHub Desktop.
Save PolMine/76bbf7623e60bb19cde9658a8096c1d3 to your computer and use it in GitHub Desktop.
Get phrases using pointwise mutual information
library(polmineR)
use("GermaParl")
stopwords <- unname(unlist(
noise(
terms("GERMAPARL", p_attribute = "word"),
stopwordsLanguage = "en"
)
))
r <- Cooccurrences(
.Object = "GERMAPARL", p_attribute = "word",
left = 0L, right = 1L, stoplist = stopwords
)
decode(r)
pmi(r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment