Last active
October 6, 2019 06:35
-
-
Save ksoda/e473a5e741db7751277f4a83fafc6add to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
pkgs = import <nixpkgs> {}; | |
stdenv = pkgs.stdenv; | |
in with pkgs; { | |
myProject = stdenv.mkDerivation { | |
name = "myProject"; | |
version = "1"; | |
src = if pkgs.lib.inNixShell then null else nix; | |
buildInputs = with rPackages; [ | |
R | |
ggplot2 | |
knitr | |
textrank | |
udpipe | |
]; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(textrank) | |
library(udpipe) | |
joboffer$textrank_id <- unique_identifier(joboffer, c("doc_id", "paragraph_id", "sentence_id")) | |
sentences <- unique(joboffer[, c("textrank_id", "sentence")]) | |
terminology <- subset(joboffer, upos %in% c("NOUN", "ADJ")) | |
terminology <- terminology[, c("textrank_id", "lemma")] | |
tr <- textrank_sentences(data = sentences, terminology = terminology) | |
summary(tr, n = 5, keep.sentence.order = TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://cran.r-project.org/web/packages/textrank/vignettes/textrank.html