cslu-nlp/DetectorMorse

Provide information about setting up and using the project on Linux

Closed this issue · 5 comments

Hi, I'm trying to setup this project on linux and use it. However, I am unable to figure out how to do so.
For building and setting up this project I have used the commands
sudo pip install -r requirements.txt and then
sudo python setup build install
But I am unable to figure out how to use this project. If that information could be provided in the README or on this issue thread that would be very helpful :).

Is the usage string in the README.md file not enough information?

It clearly says you have to type:

python -m detectormorse

followed by additional commands for input and output data.

For instance, if you just want to segment text with the default model you'd do:

python -m detectormorse --read DM-wsj.json.gz --segment text.txt > text.tok

(you have to provide your own text.txt to segment.)

And to train you'd do:

python -m detectormorse -t training_data.txt -w model.json.gz

(you have to provide your own training_data.txt, naturally, if you want to train.)

Do you feel this information isn't already present in the README.md usage string? If so, please feel free to submit a simple pull request which adds a simple "worked example" to the README.md file, and I'll review and accept the patch.

Thanks for the help. However on running the commands python -m detectormorse --read DM-wsj.json.gz --segment nn > segmented, we recieve the following error:

Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main mod_name, _Error) File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details __import__(mod_name) # Do not catch exceptions initializing package File "detectormorse/__init__.py", line 23, in <module> from .detector import Detector, slurp File "detectormorse/detector.py", line 29, in <module> from nlup import case_feature, isnumberlike, listify, \ ImportError: cannot import name IO

I guess the problem lies with installation of NLUP. Can you provide with guide for the same. The problem is perhaps we are not able to find correct entry points for it.

Just checked again, with pip nlup is installed correctly. However, I am still not able to make it work and getting the same error again and again.

I see, there are some compatibility issues with nlup. (Which I also wrote. My bad.)

I have updated the DetectorMorse repo to address this so if you sync with head (git pull, then rebuild/reinstall) and try again, let me know how it goes?

BTW this is primarily tested on Python 3 (and specifically Python 3.6) but probably will work with Python 2.

It works now, I think this issue can be closed now. I would surely add a section to the readme about setting up the project on Linux. :)