Lemmatize
The part-of-speech tags allow the tokens to be
lemmatized. Lemmatization involves turning a word into its base form, or lemma. For example, the words am
, are
and is
are all forms of the verb be
. This process allows variants of the same word to be recognised.
Example request
Send the following set of tokens and associated part-of-speech tags:
POST /zoo-chatbot/lemmatize
{
"tokens": [
"any",
"giraffes",
"?"
],
"posTags": [
"DT",
"NNS",
"."
]
}
Response
Notice that the word any
is already in its base form and the word giraffes
is converted to its base form of
giraffe
:
Response
{
"lemmas": [
"any",
"giraffe",
"?"
],
"probabilities": [
{
"lemma": "any",
"probability": 0.9965145882
},
{
"lemma": "giraffe",
"probability": 0.9917771516
},
{
"lemma": "?",
"probability": 0.4033399929
}
]
}