pres-lg-analysis
- JavaScript
- Python
- Python SDK
const analyze = async (config, input) => {
const response = await axios.post('nlp/analyze', input, config);
return response.data;
};
const input = {
id: '1234',
title: 'Emmanuel Macron in Germany.',
text: 'Mr. Macron visited a trade show in Munich.'
presentationLanguage: 'fr'
}
analyze(config, input).then(report);
def analyze(input):
return requests.post(f'{BASE_URL}nlp/analyze', json=input, headers=HEADERS).json()
input = {
'id': '1234',
'title': 'Emmanuel Macron in Germany.',
'text': 'Mr. Macron visited a trade show in Munich.',
'presentationLanguage': 'fr'
}
analyze(input)
from geneeanlpclient import g3
requestBuilder = g3.Request.Builder(customConfig={'presentationLanguage': 'fr'})
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=str('1234'), title='Emmanuel Macron in Germany.', text='Mr. Macron visited a trade show in Munich.')
result = analyzer.analyze(request)
print("Entities:")
for e in result.entities:
print(f' {e.type}: {e.stdForm} ({e.gkbId})')
print("Tags:")
for t in result.tags:
print(f' {t.type}: {t.stdForm} ({t.gkbId}) relevance: {t.relevance}')