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
657 stars 195 forks source link

Pretrained model in windows #39

Closed Nicbecoz closed 5 years ago

Nicbecoz commented 5 years ago

I am trying to use the pretrained model (Demo-Europarl-EN.pcl) in Windows to convert a file "raw.txt" into "test.txt" with raw.txt has missing punctuations while test is the output file with punctuations

Sorry, i am a little confused on how to do that. Please correct me if I am wrong. Do I do this?

cat raw.txt | python punctuator.py Demo-Europarl-EN.pcl test.txt

cat is a linux command, how can i run this in windows command? Appreciate advice. thanks.

ottokart commented 5 years ago

I don't have a windows machine at hand right now, but in PowerShell you can maybe try: Get-Content ".\raw.txt" | python punctuator.py Demo-Europarl-EN.pcl test.txt If that does not work, then you can try modifying the line: https://github.com/ottokart/punctuator2/blob/5161946e0fdc144a607db4eaa4ef968e8f6e3d77/punctuator.py#L163 to read an input file instead of stdin. For example: input_text = codecs.open(sys.argv[4], 'r', 'utf-8').read() and run the script with: python punctuator.py Demo-Europarl-EN.pcl test.txt 0 raw.txt

Nicbecoz commented 5 years ago

Thanks. Got the answer from a friend to use the below instead. and working.

type raw.txt | python punctuator.py Demo-Europarl-EN.pcl test.txt

Also, found that I could not use python 3 2to3 script to run it in Python 3. Had to use Python 2 directly only.

FurkanGozukara commented 1 year ago

@Nicbecoz how did you make it work on Windows ?

I am also trying to make it work on Windows 10

could you explain the steps?