[09.10.20] Connection testing
This commit is contained in:
parent
73003deb68
commit
f934e6acbe
@ -15,6 +15,8 @@ def callSentimentAnalyser(tweet):
|
||||
uri = keys().sentiment_analyser_uri + "/sentiment?tweet="+tweet
|
||||
response = requests.request("GET", uri)
|
||||
|
||||
print(response)
|
||||
|
||||
scores = response["result"]["Score"]
|
||||
|
||||
return scores["pos"], scores["neu"], scores["neg"], scores["compound"]
|
||||
|
||||
@ -14,6 +14,8 @@ def callSpamFilter(tweet):
|
||||
uri = keys().spamFilter_uri + "/predict?tweet="+tweet
|
||||
response = requests.request("GET", uri)
|
||||
|
||||
print(response)
|
||||
|
||||
return response["result"]
|
||||
except:
|
||||
log("Could not call spam filter service", 'ERR')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user