curl --location --request POST https://api.writer.com/v1/tools/text-to-graph \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--data-raw '{"text":"A racecar has very powerful brakes that can decelerate from 200 km/h to 0 km/h in a few seconds"}'
{
"graph": [
[
"racecar [RACECAR]",
"has_component",
"brakes [COMPONENT]"
],
[
"racecar [RACECAR]",
"can_perform",
"decelerate [ACTION]"
],
[
"racecar [RACECAR]",
"has_property",
"powerful [PROPERTY]"
],
[
"200 km/h [VELOCITY]",
"decreased_to",
"0 km/h [VELOCITY]"
],
[
"decelerate [ACTION]",
"performed_by",
"racecar [RACECAR]"
]
]
}
Performs name entity recognition on the supplied text accepting a maximum of 35000 words.
curl --location --request POST https://api.writer.com/v1/tools/text-to-graph \
--header "Authorization: Bearer <token>" \
--header "Content-Type: application/json" \
--data-raw '{"text":"A racecar has very powerful brakes that can decelerate from 200 km/h to 0 km/h in a few seconds"}'
{
"graph": [
[
"racecar [RACECAR]",
"has_component",
"brakes [COMPONENT]"
],
[
"racecar [RACECAR]",
"can_perform",
"decelerate [ACTION]"
],
[
"racecar [RACECAR]",
"has_property",
"powerful [PROPERTY]"
],
[
"200 km/h [VELOCITY]",
"decreased_to",
"0 km/h [VELOCITY]"
],
[
"decelerate [ACTION]",
"performed_by",
"racecar [RACECAR]"
]
]
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your Writer API key.
The response is of type object
.
Was this page helpful?