ljm625 / syntaxnet-rest-api

A simple rest api for Google SyntaxNet, powered by docker
GNU General Public License v3.0
72 stars 29 forks source link

"500 Internal Server Error" when trying to use Russian-SynTagRus language model. #2

Closed malakhovks closed 7 years ago

malakhovks commented 7 years ago

I'm trying to use Russian-SynTagRus language model and get 500 Internal Server Error. I think there is some encoding issues with cyrillic symbols processing. Most likely for processing strings with Cyrillic characters need to use Unicode, something like that for string processing:

data = u"""
Привет , как твои дела ?
Использование кириллических символов .
"""

or in Dockerfile to setup locales

RUN \
echo u_RU.UTF-8 UTF-8 > /etc/locale.gen && \
locale-gen "ru_RU.UTF-8" && \
echo 'LANG="ru_RU.UTF-8"'>/etc/default/locale && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LC_ALL=ru_RU.UTF-8 LANG=ru_RU.UTF-8  

ENV LANG ru_RU.UTF-8
ljm625 commented 7 years ago

Thanks for the feedback,will try to fix these encoding issues 👍

ljm625 commented 7 years ago

should be fixed, pls try again ;)

malakhovks commented 7 years ago

Now it does not work, even If insert the English model using parsey_universal: receive instant response from the server 500 Internal Server Error.

My path to English model folder /home/malakhovks/SyntaxNet/English So i use command to run model docker run -p 9000:9000 -v /home/malakhovks/SyntaxNet:/models -d ljm625/syntaxnet-rest-api And then i send POST request to http://178.151.51.73:223/api/v1/query/English

ljm625 commented 7 years ago

Thanks for the feedback again, it is a permission issue, I tested it with Russian and confirmed it's fixed :P [ { "pos_tag": "NOUN++NN", "dep": "ROOT", "contains": [ { "pos_tag": "NOUN++NN", "dep": "nmod", "contains": [ { "pos_tag": "ADJ++JJL", "dep": "amod", "name": "кириллических" } ], "name": "символов" } ], "name": "Использование" } ] Here is the result from my test. If there's any issue, please feel free to submit, really appreciate.

malakhovks commented 7 years ago

Yep, it's fine now :P Thanks!