ottokart / punctuator2

A bidirectional recurrent neural network model with attention mechanism for restoring missing punctuation in unsegmented text
http://bark.phon.ioc.ee/punctuator
MIT License
659 stars 195 forks source link

Python3 compatibility #30

Closed mkhon closed 5 years ago

mkhon commented 6 years ago

I checked only demo_play_with_model.py with pre-built Demo-Europarl-EN.pcl

rhamnett commented 5 years ago

This change breaks punctuator.py

Traceback (most recent call last): File "/Users/rick/PycharmProjects/punctuator2/punctuator.py", line 149, in net, _ = models.load(model_file, 1, x) File "/Users/rick/PycharmProjects/punctuator2/models.py", line 54, in load from . import models ImportError: attempted relative import with no known parent package

ashutosh486 commented 3 years ago

It's better to put:

try:
    from . import models
except ImportError:
    import models