concordia-preprocessor/tests/lemmatize_speed.py

16 lines
399 B
Python
Raw Normal View History

2019-07-14 22:29:07 +02:00
#!/usr/bin/python3
import requests, json, time
def do_lemmatize(data):
response = requests.post(url = 'http://127.0.0.1:10002/lemmatize', json = data)
return json.loads(response.text)
start = time.time()
data = {'language':'en', 'sentences':100*['this is just one of the sentences for testing']}
do_lemmatize(data)
end = time.time()
print("The operation took %.4f s" % (end - start))