tagging-sections
- 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",
"title": "Emmanuel Macron in Germany.",
"text": "Mr. Macron visited a trade show in Munich.",
"presentationLanguage": "fr",
"categories": [{"taxonomy": "MediaTopic", "code": "11000000"}, {"taxonomy": "Custom", "code": "politics"} ]
}'
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\",
\"title\": \"Emmanuel Macron in Germany.\",
\"text\": \"Mr. Macron visited a trade show in Munich.\",
\"presentationLanguage\": \"fr\",
\"categories\": [{\"taxonomy\": \"MediaTopic\", \"code\": \"11000000\"}, {\"taxonomy\": \"Custom\", \"code\": \"politics\"} ]
}"
const categories = [
{taxonomy: 'MediaTopic', code: '11000000'}, // IPTC category
{taxonomy: 'Custom', code: 'politics'} // custom category
]
const input = {
id: '1234',
title: 'Emmanuel Macron in Germany.',
text: 'Mr. Macron visited a trade show in Munich.',
categories: categories
}
// see the definition of analyze above
analyze(config, input).then(report);
categories = [
{'taxonomy': 'MediaTopic', 'code': '11000000'}, ## IPTC category
{'taxonomy': 'Custom', 'code': 'politics'}, ## custom category
]
input = {
'id': '1234',
'title': 'Emmanuel Macron in Germany.',
'text': 'Mr. Macron visited a trade show in Munich.',
'categories': categories,
}
## 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})
categories = [
{'taxonomy': 'MediaTopic', 'code': '11000000'}, ## IPTC category
{'taxonomy': 'Custom', 'code': 'politics'}, ## custom category
]
request = requestBuilder.build(
id='1234',
title='Emmanuel Macron in Germany.',
text='Mr. Macron visited a trade show in Munich.'
)
request.setCustomConfig(categories=categories)
result = analyzer.analyze(request)