akutuzov / webvectors

Web-ify your word2vec: framework to serve distributional semantic models online
http://vectors.nlpl.eu/explore/embeddings/
GNU General Public License v3.0
197 stars 49 forks source link

word2vec_server.py not starting on tagger port #54

Closed ahvahsky2008 closed 3 years ago

ahvahsky2008 commented 3 years ago

I try run word2vec_server.py. In logs its show that is started. I try connect to port 12666 with telnet - all works. But when i try connect to tagged_port 66666 - its no connection

root@vmi342368:/var/www/webvectors# python3.7 word2vec_server.py
2021-03-19 04:05:00,333 : INFO : loading projection weights from /var/www/model/model.bin
2021-03-19 04:05:10,794 : INFO : loaded (248978, 300) matrix from /var/www/model/model.bin
2021-03-19 04:05:10,794 : INFO : precomputing L2-norms of word weight vectors
Model ruwikiruscorpora_upos_skipgram_300_2_2019 from file /var/www/model/model.bin loaded successfully.
Socket created
Socket bind complete
Socket now listening on port 12666
[Languages]
interface_languages = ru,en

[Files and directories]
temp = tmp
l10n = strings.csv
models = models.tsv
image_cache = images_cache.csv
font = /var/www/webvectors/fonts/OpenSans-Bold.ttf
root = /var/www/webvectors/

[Sockets]
host = 0.0.0.0
port = 12666
tagger_port = 66666

[Tags]
use_tags = True
detect_tag = True
tags_list = ADJ ADV INTJ NOUN PROPN VERB ADP AUX CCONJ DET NUM PART PRON SCONJ PUNCT SYM X
exposed_tags_list = tags.tsv

[Other]
url = /
dbpedia_images = true
default_search = https://duckduckgo.com/?q=
tensorflow_projector = false
git_username = YOUR_GITHUB_USERNAME
git_token = YOUR_GITHUB_API_TOKEN
ahvahsky2008 commented 3 years ago
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/var/www/webvectors/webvectors.py", line 325, in misc_page
    w = process_query(w)
  File "/var/www/webvectors/webvectors.py", line 153, in process_query
    poses = tag_ud(66666,userquery)  # We tag using Stanford CoreNLP
  File "/var/www/webvectors/lemmatizer.py", line 18, in tag_ud
    data={'tokenizer': '', 'tagger': '', 'data': text}).content
  File "/usr/lib/python3/dist-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=66666): Max retries exceeded with url: /process (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3093bc6690>: Failed to establish a new connection: [Errno 111] Connection refused'))
lizaku commented 3 years ago

Hi! Two questions: 1) Do you use the latest version of WebVectors in your work? It seems that some code that you share is outdated (tagger_port in config file was changed some time ago, for example). Please make sure you update WebVectors to the latest version. 2) Did you start the tagger daemon? Changing detect_tag to True is not enough to make it work, the tagger daemon should be started and listening to the port listed in the config file.