Hi Vitaliy,
Thank you for publishing the KeywordsGraph
function. I tried it on the "Sartre: Being and Nothingness" link provided by @Jeremy Sykes. There is an issue with DeleteStopwords
and hyphenated words that has been raised before.
text = Import["http://dhspriory.org/kenny/PhilTexts/Sartre/BeingAndNothingness.pdf", "Plaintext"];
words = TextWords[text];
words // DeleteStopwords // ToLowerCase // Counts // TakeLargest[#, 12] &
(* <|"for-" -> 1571, "world" -> 1437, "consciousness" -> 1385,
"fact" -> 947, "object" -> 916, "relation" -> 859, "freedom" -> 829,
"nothingness" -> 811, "" -> 742, "body" -> 722, "in-" -> 702,
"order" -> 660|> *)
Notice the "for-", "in-" and the empty string. I worked around it by adding them to the blacklist. However there is still a vertex with an empty label. Not sure why.
CommunityGraphPlot[
ResourceFunction["KeywordsGraph"][text, 35, {"for", "in", "", " "}, styles],
PlotLabel ->
Style["Being and Nothingness", 50, Lighter@Red,
FontFamily -> "Phosphate"],
CommunityBoundaryStyle -> Directive[Yellow, Dashed, Opacity[.5]],
CommunityRegionStyle -> Directive[Gray, Opacity[.3]],
ImageSize -> 700 {1, 1}]
