concordia-preprocessor/tests/preprocess_verbose.py

25 lines
1.2 KiB
Python
Executable File

#!/usr/bin/python3
import requests, json
def do_preprocess(data):
response = requests.post(url = 'http://127.0.0.1:10002/preprocess', json = data)
return json.loads(response.text)
data = {'language':'pl', 'lemmatize':False, 'sentences':['zażółć, gęślą jaźń!','drugie: zdanie testowe.', 'Tę zarezerwowano dla McLarena GT. Supersamochód, który zaprezentowano oficjalnie 16 maja już przyjechał do Polski. Co to w ogóle za auto?']}
print('pl without lemmatizing')
print(do_preprocess(data))
data = {'language':'pl', 'lemmatize':True, 'sentences':['zażółć, gęślą jaźń!','drugie: zdanie testowe.', 'Tę zarezerwowano dla McLarena GT. Supersamochód, który zaprezentowano oficjalnie 16 maja już przyjechał do Polski. Co to w ogóle za auto?']}
print('pl with lemmatizing')
print(do_preprocess(data))
data = {'language':'en', 'lemmatize':False, 'sentences':['this is just one of the sentences for testing']}
print('en without lemmatizing')
print(do_preprocess(data))
data = {'language':'en', 'lemmatize':True, 'sentences':['this is just one of the sentences for testing']}
print('en with lemmatizing')
print(do_preprocess(data))