Core
Performs various natural language tasks over raw text input.
Request
Parameter | Type | Values |
---|---|---|
text (required) | String | The text parameter is the sentence or sentences to analyze. |
graph | Boolean | Controls whether the graph of entities and relationships is returned for each sentence. The graph value may be:
|
ner | Boolean | Controls whether named entity recognition is returned for each sentence. The ner value may be:
|
pretty | Boolean | Pretty print the response. Useful for debugging. The pretty value may be:
|
Response
Returns the output of various natural language tasks on the input text (see below for more information).
Example
https://api.plasticity.ai/sapien/coreGETPOST
Tokenization
Tokens appear under the tokens
key for each sentence as the first element in the array.
Note that multi-word entities like the song “Let It Be” will be tokenized to be treated as a single word. To turn this off, set the ner
parameter to false. In cases where it is ambiguous as to whether multiple words should be interpreted as a multi-word entity, “alternatives” for each sentence parse are returned in the response.
Parts of Speech
Parts of speech tags appear under the tokens
key for each sentence as the second element in the array.
Part of Speech Tag | Meaning |
---|---|
NN | Singular Noun |
NNS | Plural Noun |
POS | Possessive Ending |
NNP | Singular Proper Noun |
NNPS | Plural Proper Noun |
PRP | Personal Pronoun |
PRPS | Personal Pronoun Possessive |
VB | Verb Base From |
VBD | Verb Past Tense |
VBG | Verb Gerund |
VBN | Verb Past Participle |
VBP | Verb Non-Third Person Singular Present |
VBZ | Verb Third Person Singular Present |
JJ | Adjective |
JJR | Adjective Comparative |
JJS | Adjective Superlative |
DT | Determiner |
IN | Preposition |
RB | Adverb |
RBR | Adverb Comparative |
RBS | Adverb Superlative |
CC | Coordinating Conjunction |
CD | Cardinal Number |
RP | Particle |
EX | Existential There |
TO | to |
MD | Modal |
WP | WH-Pronoun |
WPS | Possessive WH-Pronoun |
WRB | WH-Adverb |
WDT | WH-Determiner |
NFP | Superfluous Punctuation |
COMMA | Comma |
PERIOD | Period |
HYPH | Hyphen |
COLON | Colon |
DOLLAR | Dollar Sign |
RIGHTBRACKET | Right Bracket |
LEFTBRACKET | Left Bracket |
OPENINGQUOTES | Opening Quotes |
CLOSINGQUOTES | Closing Quotes |
UH | Interjection |
PDT | Predeterminer |
FW | Foreign Word |
SYM | Symbol |
ADD | Electronic Address (URL) |
LS | List Item Marker |
GW | Go with |
AFX | Affix |
Lemmatization
Lemmatized or normalized tokens appear under the tokens
key for each sentence as the third element in the array.
Normalization includes making the token lowercase, transforming verbs to their infinitive form, transforming adjectives to their positive degree, and transforming nouns to their singular form.
Syntax Dependency Trees
Syntax dependency trees appear under the dependencies
key for each sentence.
The first element in the array is the index of the dependent word. The second element in the array is the index of the head word (or governor). The third element in the array is the name of the dependency relation.
Dependency Relation | Meaning |
---|---|
punct | Punctuation |
prep | Preposition |
pobj | Prepositional Object |
det | Determinal |
nsubj | Nominal Subject |
nn | Noun Compound Modifier |
amod | Adjectival Modifier |
ROOT | Root |
dobj | Direct Object |
aux | Auxiliary |
advmod | Adverbial Modifier |
conj | Conjunct |
cc | Coordinating Conjunction |
num | Numeric Modifier |
poss | Possession Modifier |
dep | Unspecified Dependency |
ccomp | Clausal Complement |
cop | Copula |
mark | Marker |
xcomp | Open Clausal Complement |
rcmod | Relative Clause Modifier |
advcl | Adverbial Clause Modifier |
possessive | Possessive Modifier |
nsubjpass | Passive Nominal Subject |
pcomp | Prepositional Complement |
appos | Appositional Modifier |
partmod | Participial Modifier |
neg | Negation |
number | Number |
prt | Phrasal Verb Particle |
quantmod | Quantifier Phrase Modifier |
infmod | Infinitival Modifier |
npadvmod | Noun Phrase Adverbial Modifier |
parataxis | Parataxis |
mwe | Multi-word Expression |
expl | Expletive |
iobj | Indirect Object |
acomp | Adjectival Modifier |
discourse | Discourse |
csubj | Clausal Subject |
predet | Predeterminer |
preconj | Preconjunct |
goeswith | Goes with |
csubjpass | Passive Clausal Subject |
Sentence Graph of Entities and Relationships
A graph of entities and relationships will appear under the graph
key for each sentence. This task provides similar information to the relation extraction task or open information extraction task in NLP.
Named Entity Recognition
Named entities will appear under the graph
key for each sentence under any entity objects under the ner
key.
The ner
object provides a label (label
) for the recognized entity, along with identifiers for the Freebase entity (freebaseIdentifier
) and the Cortex Knowledge Graph entity (id
). An example of the ner
object is shown below:
1{
2 "freebaseIdentifier": "/m/01hg45m",
3 "id": "PWE199585",
4 "label": "Let It Be",
5 "type": "concept"
6}
Disambiguation
This API endpoint is currently under development and will be released shortly. Please reach out to us to stay updated on future releases.
Coreference Resolution
This API endpoint is currently under development and will be released shortly. Please reach out to us to stay updated on future releases.
Sentiment Analysis
This API endpoint is currently under development and will be released shortly. Please reach out to us to stay updated on future releases.