Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot make work depccg and viasock together #18

Open
kovvalsky opened this issue Jul 10, 2019 · 3 comments
Open

Cannot make work depccg and viasock together #18

kovvalsky opened this issue Jul 10, 2019 · 3 comments

Comments

@kovvalsky
Copy link

depccg takes tokenized Japanese text and prints in the conll style.

~$ cat out/p61/d1997/ja.tok
まー !
この T シャツ 、 3000 円 ?
!
ぼっ たくり だ わ 。

~$ cat out/p61/d1997/ja.tok | ./ext/depccg/bin/depccg_ja -f conll --silent --pre-tokenized -m models/depccg/ja_headfinal | cut -s -f 3
1.. 2.. 3.. 4.. 
NP[case=nc,mod=nm,fin=f]
NP[case=nc,mod=nm,fin=t]\NP[case=nc,mod=nm,fin=f]
NP[case=X1,mod=X2,fin=f]/NP[case=X1,mod=X2,fin=f]
NP[case=X1,mod=X2,fin=f]/NP[case=X1,mod=X2,fin=f]
NP[case=X1,mod=X2,fin=f]/NP[case=X1,mod=X2,fin=f]
(NP[case=X1,mod=X2,fin=f]/NP[case=X1,mod=X2,fin=f])\(NP[case=X1,mod=X2,fin=f]/NP[case=X1,mod=X2,fin=f])
NP[case=X1,mod=X2,fin=f]/NP[case=X1,mod=X2,fin=f]
NP[case=nc,mod=nm,fin=f]
NP[case=nc,mod=nm,fin=t]\NP[case=nc,mod=nm,fin=f]
NP[case=nc,mod=nm,fin=f]
S[mod=X1,form=X2,fin=f]/S[mod=X1,form=X2,fin=f]
S[mod=nm,form=cont,fin=f]
S[mod=nm,form=base,fin=f]\S[mod=nm,form=cont,fin=f]
S[mod=nm,form=stem,fin=f]\S[mod=nm,form=base,fin=f]
S[mod=nm,form=stem,fin=t]\S[mod=nm,form=stem,fin=f]

When I use viasock run, it throws an error after the timeout is reached. 20 seconds is more than enough to load the model and parse the text.

~$ cat out/p61/d1997/ja.tok |./ext/viasock/viasock run --process-timeout 20 --server-timeout 90  --log log/depccg/ja.log ./ext/depccg/bin/depccg_ja -f conll --silent --pre-tokenized -m models/depccg/ja_headfinal | cut -s -f 3
2019-07-10 15:15:53,943 - viasock client - 1470 - ERROR - server stopped sending output

The log file has not more information that the error says, I guess.

tail  log/depccg/ja.log
2019-07-10 15:06:36,681 - viasock server - .viasock/sockets/5f79728e3d94a7d0227c9d9374a4faa7 - 24841 - INFO - record 1 start
2019-07-10 15:06:56,699 - viasock server - .viasock/sockets/5f79728e3d94a7d0227c9d9374a4faa7 - 24841 - INFO - killed process
2019-07-10 15:06:56,700 - viasock server - .viasock/sockets/5f79728e3d94a7d0227c9d9374a4faa7 - 24841 - ERROR - process took too long to answer
2019-07-10 15:06:56,701 - viasock server - .viasock/sockets/5f79728e3d94a7d0227c9d9374a4faa7 - 24841 - INFO - stopped
2019-07-10 15:15:32,924 - viasock server - .viasock/sockets/5f79728e3d94a7d0227c9d9374a4faa7 - 1513 - INFO - started
2019-07-10 15:15:33,923 - viasock server - .viasock/sockets/5f79728e3d94a7d0227c9d9374a4faa7 - 1513 - INFO - connection 1 start
2019-07-10 15:15:33,924 - viasock server - .viasock/sockets/5f79728e3d94a7d0227c9d9374a4faa7 - 1513 - INFO - record 1 start
2019-07-10 15:15:53,943 - viasock server - .viasock/sockets/5f79728e3d94a7d0227c9d9374a4faa7 - 1513 - INFO - killed process
2019-07-10 15:15:53,944 - viasock server - .viasock/sockets/5f79728e3d94a7d0227c9d9374a4faa7 - 1513 - ERROR - process took too long to answer
2019-07-10 15:15:53,944 - viasock server - .viasock/sockets/5f79728e3d94a7d0227c9d9374a4faa7 - 1513 - INFO - stopped

I think the default values for -t, -T, and -P parameters are fine for this procedure as each input sentnce is on a separate line and output delimiters and prelude shouldn't have effect on the failure.
p.s. I use the uptodate version of viasock.

@kovvalsky
Copy link
Author

The way depccg is run could be also useful for this issue:

~$ cat ./ext/depccg/bin/depccg_ja
#!/bin/sh
export PYTHONPATH=/net/gsb/pmb/ext/depccg:$PYTHONPATH
export PATH=$HOME/local/python/bin:$PATH
export PYTHONPATH=$HOME/local/python/lib/python3.6/site-packages:$PYTHONPATH
python3 -m depccg ja "$@"

@texttheater
Copy link
Owner

This looks like depccg doesn't flush the output after each record like EasyCCG does.

@masashi-y
Copy link

I fixed that. Please check the latest depccg on my git master!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants