Error using OpenNMT-py (Multiple edits, new issue)


(Jeremy) #1


I was led to believe we could use OpenNmt on the client-side using tensorflow but I don’t think it is possible.
How should I interact from NodeJS to OpenNmt and which OpenNmt library would be better?

My goal is to have the user input a product name like “Sliced White Bread” and it will be translated in multiple languages directly on the form for review before the user can add it to the database.

I tried cloning following the instructions but they are unclear.
After cd’ing in the folder, commands like onmt-build-vocab doesn’t work, obviously. Typing python ./ doesn’t work either.

Second Edit:
OpenNMT-py seems to be more complete, but after running pip install -r requirements.txt without any error, I cannot start without having:

Traceback (most recent call last):
  File "", line 12, in <module>
    import torch
  File "/home/jer/.local/lib/python2.7/site-packages/torch/", line 80, in <module>
    from torch._C import *
ImportError: numpy.core.multiarray failed to import

I looked back and I can indeed find torch installed.

Collecting torch>=0.4.0 (from -r requirements.txt (line 3))
  Downloading (519.5MB)
    100% |████████████████████████████████| 519.5MB 3.5kB/s 
Successfully installed certifi-2018.8.24 chardet-3.0.4 future-0.16.0 idna-2.7 requests-2.19.1 six-1.11.0 torch-0.4.1 torchtext-0.3.0 tqdm-4.25.0 urllib3-1.23

Thanks for your help!