PredPatt
PredPatt copied to clipboard
PredPatt parser running indefinitely for some specific options
I encountered a strange problem while parsing a particular sentence. Consider:
conll_example = '''
1 The _ DET DT _ 2 det _ _
2 action _ NOUN NN _ 2 ROOT _ _
3 followed _ VERB VBD _ 2 acl _ _
4 by _ ADP IN _ 3 agent _ _
5 one _ NUM CD _ 6 nummod _ _
6 day _ NOUN NN _ 4 pobj _ _
7 an _ DET DT _ 9 det _ _
8 Intelogic _ PROPN NNP _ 9 amod _ _
9 announcement _ NOUN NN _ 3 dobj _ _
10 that _ ADP IN _ 13 mark _ _
11 it _ PRON PRP _ 13 nsubj _ _
12 will _ VERB MD _ 13 aux _ _
13 retain _ VERB VB _ 9 acl _ _
14 an _ DET DT _ 16 det _ _
15 investment _ NOUN NN _ 16 compound _ _
16 banker _ NOUN NN _ 13 dobj _ _
17 to _ PART TO _ 18 aux _ _
18 explore _ VERB VB _ 13 advcl _ _
19 alternatives _ NOUN NNS _ 18 dobj _ _
20 " _ PUNCT '' _ 19 punct _ _
21 to _ PART TO _ 22 aux _ _
22 maximize _ VERB VB _ 19 relcl _ _
23 shareholder _ NOUN NN _ 24 compound _ _
24 value _ NOUN NN _ 22 dobj _ _
25 , _ PUNCT , _ 2 punct _ _
26 " _ PUNCT '' _ 2 punct _ _
27 including _ VERB VBG _ 2 prep _ _
28 the _ DET DT _ 30 det _ _
29 possible _ ADJ JJ _ 30 amod _ _
30 sale _ NOUN NN _ 27 pobj _ _
31 of _ ADP IN _ 30 prep _ _
32 the _ DET DT _ 33 det _ _
33 company _ NOUN NN _ 31 pobj _ _
34 . _ PUNCT . _ 2 punct _ _
'''
conll_example = [ud_parse for sent_id, ud_parse in load_conllu(conll_example)][0]
obj = PredPatt(conll_example)
The above lines runs fine, but when I add the options as follows:
options = PredPattOpts(resolve_relcl=True, borrow_arg_for_relcl=True, resolve_conj=False, cut=True)
Then, the following line keeps running forever with no error messages:
obj = PredPatt(conll_example, opts=options)
PC Configurations: OS: MacOS High Sierra Python version: 3.6.5 |Anaconda custom (64-bit)
I encounter the same problem, only with from_sentence. Do you have any suggestions on how to avoid this?
I resolved my problem by adding cacheable=False to from_sentence call.