Performs natural language processing on news items, extracting keywords and named entities for better topic tagging and content analysis
uv venv
uv sync --all-extras --dev
Run via
flask run
# or
granian run
# or
docker run -p 8000:8000 ghcr.io/taranis-ai/taranis-nlp-bot:latest
To test the API with a POST request, use curl:
curl -X POST http://127.0.0.1:8000/ \
-H "Content-Type: application/json" \
-d '{"text": "This is an example for NER, about the ACME Corporation which is producing Dynamite in Acme City, which is in Australia and run by Mr. Wile E. Coyote."}'
# {"ACME Corporation":"ORG","Acme City":"LOC","Australia":"LOC","Dynamite":"MISC","NER":"ORG","Wile E. Coyote":"PER"}
import requests
json_data = {
'text': 'This is an example for NER, about the ACME Corporation which is producing Dynamite in Acme City, which is in Australia and run by Mr. Wile E. Coyote.',
}
response = requests.post('http://127.0.0.1:8000', json=json_data)
print(response.text)
EUROPEAN UNION PUBLIC LICENCE v. 1.2