Skip to content

Instantly share code, notes, and snippets.

@ksoda
Last active October 6, 2019 06:35
Show Gist options
  • Save ksoda/e473a5e741db7751277f4a83fafc6add to your computer and use it in GitHub Desktop.
Save ksoda/e473a5e741db7751277f4a83fafc6add to your computer and use it in GitHub Desktop.
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
];
};
}
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)
@ksoda
Copy link
Author

ksoda commented Sep 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment