Skip to content

Commit

Permalink
Add interactive script
Browse files Browse the repository at this point in the history
  • Loading branch information
Marshall James committed May 2, 2018
1 parent a3a0fbc commit 5007980
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions interactive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import requests

BASE_URL = "http://localhost:5000/"

print("Enter sentence to classify, or enter STOP")
while True:
text = input("Sentence: ")
if text == "STOP":
break
else:
payload = {"text": text}
req = requests.post(BASE_URL + "sentiments", data=payload)
print(req.json())
print("\n")

0 comments on commit 5007980

Please sign in to comment.