Natural language processing for advanced text analysis
Analyze text, HTML, or URLs for various features using IBM Watson Natural Language Understanding, powered by AI.
import requests
import base64
url = "https://api.natural-language-understanding.cloud.ibm.com/v1/analyze?version=2022-04-07"
api_key = "YOUR_API_KEY"
headers = {
"Content-Type": "application/json",
"Authorization": f"Basic {base64.b64encode(f'apikey:{api_key}'.encode()).decode()}"
}
data = {
"text": "IBM is an American multinational technology and consulting company.",
"features": {
"entities": {"sentiment": True},
"keywords": {"sentiment": True}
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())Last 50 checks (10 min intervals)