tagging-paras
- cURL
- cURL (Windows)
- JavaScript
- Python
- Python SDK
curl -X POST -H 'X-API-KEY: <YOUR_API_KEY>' -H 'accept: */*' -H 'content-type: application/json' 'https://media-api.geneea.com/v2/nlp/analyze' -d '{
"id": "1234",
"paraSpecs": [
{"type": "title", "text": "Macron in Germany."},
{"type": "abstract", "text": "Emmanuel Macron is visiting Germany again."},
{"type": "text", "text": "Mr. Macron visited a trade show in Munich."}
]
}'
curl -X POST -H "X-API-KEY: <YOUR_API_KEY>" -H "content-type: application/json" "https://media-api.geneea.com/v2/nlp/analyze" -d "{
\"id\": \"1234\",
\"paraSpecs\": [
{\"type\": \"title\", \"text\": \"Macron in Germany.\"},
{\"type\": \"abstract\", \"text\": \"Emmanuel Macron is visiting Germany again.\"},
{\"type\": \"text\", \"text\": \"Mr. Macron visited a trade show in Munich.\"}
]
}"
const input = {
id: '1234',
paraSpecs: [
{type: 'title', text: 'Macron in Germany.'},
{type: 'abstract', text: 'Emmanuel Macron is visiting Germany again.'},
{type: 'text', text: 'Mr. Macron visited a trade show in Munich.'}
]
}
// see the definition of analyze above
analyze(config, input).then(report);
input = {
'id': '1234',
'paraSpecs': [
{'type': 'title', 'text': 'Macron in Germany.'},
{'type': 'abstract', 'text': 'Emmanuel Macron is visiting Germany again.'},
{'type': 'text', 'text': 'Mr. Macron visited a trade show in Munich.'}
]
}
## see the definition of analyze above
analyze(input)
requestBuilder = g3.Request.Builder()
with g3.Client.create(url=f'{BASE_URL}nlp/analyze') as analyzer:
analyzer.session.headers.update({'X-API-Key': API_KEY})
request = requestBuilder.build(
id='1234',
paraSpecs=[
g3.ParaSpec.title('Macron in Germany.'),
g3.ParaSpec.lead('Emmanuel Macron is visiting Germany again.'), ## g3.ParaSpec.abstract is equivalent
g3.ParaSpec.body('Mr. Macron visited a trade show in Munich.')
]
)
result = analyzer.analyze(request)