zensols.nlparse.parse
Parse an utterance using the Stanford CoreNLP and the ClearNLP SRL.
This is the main client entry point to the package. A default out of the box parser works that comes with components listed in zensols.nlparse.config/all-components.
If you want to customzie or add your own parser plug in, see the zensols.nlparse.config namespace.
in-range?
(in-range? outter inner)
Return whether inner range sits in inclusive range outter. Both parameters have the form: [start end]
.
mentions
(mentions panon & {:keys [mention-keys], :or {mention-keys [:mentions :tok-re-mentions]}})
overlap?
(overlap? a b)
Return whether two ranges overlap inclusively. Both parameters have the form: [start end]
.
parse
(parse utterance)
Parse natural language utterance returning a symbol expression tree of it’s meaning.
This returns a symbolic expression (map of maps). A definition of these and structure of these annotations are given here.
See test token-regex for example of entity-tag
.
penn-treebank-pos-tags
Alphabetical list of part-of-speech tags used in the Penn Treebank Project.
pos-tag-type
(pos-tag-type tag)
Return the POS tag type (ie. verb
yeilds VB
).
The return (function range) is the input to pos-tags.
pos-tags
(pos-tags type)
(pos-tags)
Get a sequence of POS tags based on type (if given) and all otherwise.
type is a symbol and one of noun
, verb
, adjective
, adverb
, and wh
.
See pos-tag-types.
root-dependency
(root-dependency sent)
Get the text of the root node of the dependency tree.
sentiment-score-to-label
(sentiment-score-to-label sentiment-score)
Create a human readable tag from the sentiment score.
See sentimnet-labels.
sentimnet-labels
All labels returned by sentiment-score-to-label in order of positive to negative.
token-mentions
(token-mentions panon)
(token-mentions panon mentions)
Return mentions with a :tokens
key that includes token maps from the sentence level.
tokens-by-sentence
(tokens-by-sentence panon sent-index token-range)
Return the tokens for sent-index in the token-range.