CogComp / cogcomp-nlpy

CogComp's light-weight Python NLP annotators
http://nlp.cogcomp.org/
Other
116 stars 26 forks source link

local pipeline yields different results from remote one #128

Open mattia-barbaresi opened 2 years ago

mattia-barbaresi commented 2 years ago

Hi,

Using it as a shallow parser, I noted that for some input strings the results are not the same. As an example:

from ccg_nlpy import local_pipeline
from ccg_nlpy import remote_pipeline
pipeline_remote = remote_pipeline.RemotePipeline()
pipeline_local = local_pipeline.LocalPipeline()
input_str = "youve not played with this ."
doc_r = pipeline_remote.doc(input_str, pretokenized=False)
doc_l = pipeline_local.doc(input_str, pretokenized=False)
spr = " || ".join(x["tokens"] for x in doc_r.get_shallow_parse.cons_list)
spl = " || ".join(x["tokens"] for x in doc_l.get_shallow_parse.cons_list)
print("spl:", spl)
print("spr: ", spr)

The above code prints the following (LocalPipeline gets rid of not in this case):

spl: youve || played || with || this
spr:  youve not || played || with || this

Any suggestion? Thanks, Mattia.