python.NLTK (WindowDiff and PK) vs python.Segeval (WindowDiff and PK) -
python nltk implementation of beeferman's pk , windowdiff getting complete different results python segeval implementation of both.
using same parameters.
hyp: 0100100000 ref: 0101000000 k=2 pk's segeval:0.2222222 pk's nltk:0.111111111 hyp: 111111 ref: 100100 k=2 pk's segeval:0.4 pk's nltk:0.64
this lead different research results use it.
possibly, go wrong how call nltk functions or you're using old version of nltk.
i'm getting same results nltk you've shown in segeval:
>>> nltk.metrics.segmentation import pk >>> hyp = '0100100000' >>> ref = '0101000000' >>> pk(hyp, ref, 2) 0.2222222222222222 >>> hyp = '111111' >>> ref = '100100' >>> pk(hyp, ref, 2) 0.4
my nltk version:
>>> nltk.__version__ '3.0.5'
do this:
$ pip install -u nltk
Comments
Post a Comment