This file contains hidden or 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
(def nlp | |
(let [props (new java.util.Properties)] | |
(.setProperty props "annotators" "tokenize,ssplit,parse,sentiment") | |
(new edu.stanford.nlp.pipeline.StanfordCoreNLP props))) | |
(defn find-sentiment | |
"Determines the sentiment of each sentence in a given glob of text. Results in a collection of integers ranging from [0-4]: where 0 is 'Very negative', 2 is 'neutral', and 4 is 'Very positive'" | |
[^String glob] | |
(let [main-sentiment 0 | |
longest 0] |