Closed Nicbecoz closed 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
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.
@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?
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.