openeventdata / UniversalPetrarch

Language-agnostic political event coding using universal dependencies
MIT License
18 stars 9 forks source link

Crash probably on verb + ADP #30

Open philip-schrodt opened 6 years ago

philip-schrodt commented 6 years ago

The following records all cause a crash on File "/UniversalPetrarch/PETRgraph.py", line 1544, in get_verb_code lowermatch = match_lower(patternDictPath, verb, target) File "/UniversalPetrarch/PETRgraph.py", line 1424, in match_lower temptargetmatch = match_noun(path, np) File "/UniversalPetrarch/PETRgraph.py", line 1246, in match_noun if np.npIDs[0] == noun_phrase.npIDs[1]: IndexError: list index out of range

The only way I can bypass them is eliminating the primary verb (e.g. TALK, STRIKE, MEET, CAME) rather than a pattern but it looks like what they have in common is an ADP (WITH, FROM) linked immediately to that verb.

<Sentence date="20150522" id="2fac7ae5-59c4-4577-b22e-43cb44ac7b21_1" category="COMPARE" evaluate="true">
<P1Event [['VNM', 'USABUS', '100']]>
<P2Event [['VNM', 'USABUS', '010']]>
<Text>
Ho Chi Minh City wants to meet with and talk to U.S. businesses to solve problems and create
advantageous environment for them, said the city People's Committee Deputy Chairman Le Manh Ha while
receiving U.S. Bitter's hope that there would have regular meetings between city leaders and U.S.
investors to help them solve procedure issues and give newcomers a hand to start their business in
the city .
</Text>
<Parse>
1   Ho  Ho  PROPN   NNP Number=Sing 4   compound    _   _
2   Chi chi PROPN   NNP Number=Sing 1   flat    _   _
3   Minh    Minh    PROPN   NNP Number=Sing 4   compound    _   _
4   City    City    PROPN   NNP Number=Sing 5   nsubj   _   _
5   wants   want    VERB    VBZ Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin   0   root    _   _
6   to  to  PART    TO  _   7   mark    _   _
7   meet    meet    VERB    VB  VerbForm=Inf    5   xcomp   _   _
8   with    with    ADP IN  _   7   obl _   _
9   and and CCONJ   CC  _   10  cc  _   _
10  talk    talk    VERB    VB  VerbForm=Inf    7   conj    _   _
11  to  to  ADP IN  _   13  case    _   _
12  U.S.    U.S.    PROPN   NNP Number=Sing 13  compound    _   _
13  businesses  business    NOUN    NNS Number=Plur 10  obl _   _
14  to  to  PART    TO  _   15  mark    _   _
15  solve   solve   VERB    VB  VerbForm=Inf    13  acl _   _
16  problems    problem NOUN    NNS Number=Plur 15  obj _   _
17  and and CCONJ   CC  _   18  cc  _   _
18  create  create  VERB    VBP Mood=Ind|Tense=Pres|VerbForm=Fin    15  conj    _   _
19  advantageous    advantageous    ADJ JJ  Degree=Pos  20  amod    _   _
20  environment environment NOUN    NN  Number=Sing 18  obj _   _
21  for for ADP IN  _   22  case    _   _
22  them    they    PRON    PRP Case=Acc|Number=Plur|Person=3|PronType=Prs  18  obl _   _
23  ,   ,   PUNCT   ,   _   24  punct   _   _
24  said    say VERB    VBD Mood=Ind|Tense=Past|VerbForm=Fin    5   conj    _   _
25  the the DET DT  Definite=Def|PronType=Art   27  det _   _
26  city    city    NOUN    NN  Number=Sing 27  compound    _   _
27  People  People  PROPN   NNPS    Number=Plur 34  nmod:poss   _   _
28  's  's  PART    POS _   27  case    _   _
29  Committee   committee   PROPN   NNP Number=Sing 34  compound    _   _
30  Deputy  deputy  PROPN   NNP Number=Sing 31  compound    _   _
31  Chairman    chairman    PROPN   NNP Number=Sing 33  compound    _   _
32  Le  Le  PROPN   NNP Number=Sing 31  flat    _   _
33  Manh    Manh    PROPN   NNP Number=Sing 34  compound    _   _
34  Ha  ha  PROPN   NNP Number=Sing 24  appos   _   _
35  while   while   SCONJ   IN  _   36  mark    _   _
36  receiving   receive VERB    VBG VerbForm=Ger    34  advcl   _   _
37  U.S.    U.S.    PROPN   NNP Number=Sing 38  compound    _   _
38  Bitter  bitter  PROPN   NNP Number=Sing 40  nmod:poss   _   _
39  's  's  PART    POS _   38  case    _   _
40  hope    hope    NOUN    NN  Number=Sing 36  obj _   _
41  that    that    SCONJ   IN  _   44  mark    _   _
42  there   there   PRON    EX  _   44  expl    _   _
43  would   would   AUX MD  VerbForm=Fin    44  aux _   _
44  have    have    VERB    VB  VerbForm=Inf    40  acl _   _
45  regular regular ADJ JJ  Degree=Pos  46  amod    _   _
46  meetings    meeting NOUN    NNS Number=Plur 44  obj _   _
47  between between ADP IN  _   49  case    _   _
48  city    city    NOUN    NN  Number=Sing 49  compound    _   _
49  leaders leader  NOUN    NNS Number=Plur 46  nmod    _   _
50  and and CCONJ   CC  _   52  cc  _   _
51  U.S.    U.S.    PROPN   NNP Number=Sing 52  compound    _   _
52  investors   investor    NOUN    NNS Number=Plur 49  conj    _   _
53  to  to  PART    TO  _   54  mark    _   _
54  help    help    VERB    VB  VerbForm=Inf    52  acl _   _
55  them    they    PRON    PRP Case=Acc|Number=Plur|Person=3|PronType=Prs  54  obj _   _
56  solve   solve   VERB    VB  VerbForm=Inf    54  xcomp   _   _
57  procedure   procedure   NOUN    NN  Number=Sing 58  compound    _   _
58  issues  issue   NOUN    NNS Number=Plur 56  obj _   _
59  and and CCONJ   CC  _   60  cc  _   _
60  give    give    VERB    VB  VerbForm=Inf    56  conj    _   _
61  newcomers   newcomer    PRON    PRP _   60  iobj    _   _
62  a   a   DET DT  Definite=Ind|PronType=Art   63  det _   _
63  hand    hand    NOUN    NN  Number=Sing 60  obj _   _
64  to  to  PART    TO  _   65  mark    _   _
65  start   start   VERB    VB  VerbForm=Inf    63  acl _   _
66  their   they    PRON    PRP$    Number=Plur|Person=3|Poss=Yes|PronType=Prs  67  nmod:poss   _   _
67  business    business    NOUN    NN  Number=Sing 65  obj _   _
68  in  in  ADP IN  _   70  case    _   _
69  the the DET DT  Definite=Def|PronType=Art   70  det _   _
70  city    city    NOUN    NN  Number=Sing 67  nmod    _   _
71  .   .   PUNCT   .   _   5   punct   _   _
</Parse></Sentence>

<Sentence date="20151017" id="2f6242b3-4c51-490e-a277-e01298fe3bbc_7" category="COMPARE" evaluate="false">
<P1Event [['RUS', 'USA', '013']]>
<P2Event [['RUS', 'USA', '044']]>
<Text>
`` Moscow hopes to talk with'' all the participants of this complicated process, including with our
American partners'', Putin added .
</Text>
<Parse>
1   ``  ``  SYM $   _   2   compound    _   _
2   Moscow  Moscow  PROPN   NNP Number=Sing 3   nsubj   _   _
3   hopes   hope    VERB    VBZ Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin   0   root    _   _
4   to  to  PART    TO  _   5   mark    _   _
5   talk    talk    VERB    VB  VerbForm=Inf    3   xcomp   _   _
6   with    with    ADP IN  _   5   obl _   _
7   ''  ''  PUNCT   ''  _   3   punct   _   _
8   all all DET PDT _   10  det:predet  _   _
9   the the DET DT  Definite=Def|PronType=Art   10  det _   _
10  participants    participant NOUN    NNS Number=Plur 24  nsubj   _   _
11  of  of  ADP IN  _   14  case    _   _
12  this    this    DET DT  Number=Sing|PronType=Dem    14  det _   _
13  complicated complicated ADJ JJ  Degree=Pos  14  amod    _   _
14  process process NOUN    NN  Number=Sing 10  nmod    _   _
15  ,   ,   PUNCT   ,   _   10  punct   _   _
16  including   include VERB    VBG VerbForm=Ger    20  case    _   _
17  with    with    ADP IN  _   20  case    _   _
18  our we  PRON    PRP$    Number=Plur|Person=1|Poss=Yes|PronType=Prs  20  nmod:poss   _   _
19  American    american    ADJ JJ  Degree=Pos  20  amod    _   _
20  partners    partner NOUN    NNS Number=Plur 10  nmod    _   _
21  ''  ''  PUNCT   ''  _   20  punct   _   _
22  ,   ,   PUNCT   ,   _   10  punct   _   _
23  Putin   Putin   PROPN   NNP Number=Sing 24  compound    _   _
24  added   add VERB    VBD Mood=Ind|Tense=Past|VerbForm=Fin    3   parataxis   _   _
25  .   .   PUNCT   .   _   3   punct   _   _
</Parse></Sentence>

<Sentence date="20150927" id="30191726-169c-4ea0-b19a-8afa8bc7c281_2" category="COMPARE" evaluate="true">
<P1Event [['JAMCOP', 'MNCJPN', '010']]>
<P2Event [['JAMCOP', 'MNCJPN', '010']]>
<Text>
Guy Forbes, of Kingston Police, told the Whig-Standard a light-blue Toyota Prius, carrying at least
three passengers and the driver, struck a beige Mazda Protege 6 from behind .
</Text>
<Parse>
1   Guy guy NOUN    NN  Number=Sing 2   compound    _   _
2   Forbes  Forbes  NOUN    NNS Number=Plur 8   nsubj   _   _
3   ,   ,   PUNCT   ,   _   2   punct   _   _
4   of  of  ADP IN  _   6   case    _   _
5   Kingston    Kingston    PROPN   NNP Number=Sing 6   compound    _   _
6   Police  police  PROPN   NNP Number=Sing 2   nmod    _   _
7   ,   ,   PUNCT   ,   _   8   punct   _   _
8   told    tell    VERB    VBD Mood=Ind|Tense=Past|VerbForm=Fin    0   root    _   _
9   the the DET DT  Definite=Def|PronType=Art   10  det _   _
10  Whig-Standard   Whig-Standard   PROPN   NNP Number=Sing 8   obj _   _
11  a   a   DET DT  Definite=Ind|PronType=Art   13  det _   _
12  light-blue  light-blue  ADJ JJ  Degree=Pos  13  amod    _   _
13  Toyota  Toyota  PROPN   NNP Number=Sing 10  appos   _   _
14  Prius   Prius   PROPN   NNP Number=Sing 13  flat    _   _
15  ,   ,   PUNCT   ,   _   8   punct   _   _
16  carrying    carry   VERB    VBG VerbForm=Ger    8   advcl   _   _
17  at  at  ADV RB  _   18  case    _   _
18  least   least   ADV RBS Degree=Sup  19  nmod    _   _
19  three   three   NUM CD  NumType=Card    20  nummod  _   _
20  passengers  passenger   NOUN    NNS Number=Plur 16  obj _   _
21  and and CCONJ   CC  _   23  cc  _   _
22  the the DET DT  Definite=Def|PronType=Art   23  det _   _
23  driver  driver  NOUN    NN  Number=Sing 20  conj    _   _
24  ,   ,   PUNCT   ,   _   8   punct   _   _
25  struck  strike  VERB    VBD Mood=Ind|Tense=Past|VerbForm=Fin    8   ccomp   _   _
26  a   a   DET DT  Definite=Ind|PronType=Art   29  det _   _
27  beige   beige   NOUN    NN  Number=Sing 28  compound    _   _
28  Mazda   Mazda   PROPN   NNP Number=Sing 29  compound    _   _
29  Protege Protege PROPN   NNP Number=Sing 25  obj _   _
30  6   6   NUM CD  NumType=Card    29  nummod  _   _
31  from    from    ADP IN  _   25  obl _   _
32  behind  behind  ADP IN  _   31  case    _   _
33  .   .   PUNCT   .   _   8   punct   _   _
</Parse></Sentence>

<Sentence date="20151020" id="30e773e2-8d50-4800-81ce-49b27e4c1680_1" category="COMPARE" evaluate="true">
<P1Event [['CAN', 'USAGOV', '010']]>
<P2Event [['CAN', 'USAGOV', '010']]>
<Text>
Canada's Prime Minister-designate Justin Trudeau, who came from behind to oust the ruling
Conservatives, said he has told US President Barack Obama that Canada will pull out of the coalition
bombing mission against the Islamic State, but maintain humanitarian aid and training .
</Text>
<Parse>
1   Canada  Canada  PROPN   NNP Number=Sing 6   nmod:poss   _   _
2   's  's  PART    POS _   1   case    _   _
3   Prime   Prime   PROPN   NNP Number=Sing 4   compound    _   _
4   Minister-designate  Minister-designate  PROPN   NNP Number=Sing 5   compound    _   _
5   Justin  Justin  PROPN   NNP Number=Sing 6   compound    _   _
6   Trudeau Trudeau PROPN   NNP Number=Sing 18  nsubj   _   _
7   ,   ,   PUNCT   ,   _   6   punct   _   _
8   who who PRON    WP  PronType=Rel    9   nsubj   _   _
9   came    come    VERB    VBD Mood=Ind|Tense=Past|VerbForm=Fin    6   acl:relcl   _   _
10  from    from    ADP IN  _   9   obl _   _
11  behind  behind  ADP IN  _   10  case    _   _
12  to  to  ADP IN  _   16  case    _   _
13  oust    oust    ADV RB  _   16  advmod  _   _
14  the the DET DT  Definite=Def|PronType=Art   16  det _   _
15  ruling  ruling  VERB    VBG VerbForm=Ger    16  amod    _   _
16  Conservatives   conservatife    NOUN    NNS Number=Plur 9   obl _   _
17  ,   ,   PUNCT   ,   _   18  punct   _   _
18  said    say VERB    VBN Tense=Past|VerbForm=Part    0   root    _   _
19  he  he  PRON    PRP Case=Nom|Gender=Masc|Number=Sing|Person=3|PronType=Prs  21  nsubj   _   _
20  has have    AUX VBZ Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin   21  aux _   _
21  told    tell    VERB    VBN Tense=Past|VerbForm=Part    18  ccomp   _   _
22  US  US  PROPN   NNP Number=Sing 23  compound    _   _
23  President   President   PROPN   NNP Number=Sing 21  obj _   _
24  Barack  Barack  PROPN   NNP Number=Sing 23  flat    _   _
25  Obama   Obama   PROPN   NNP Number=Sing 23  flat    _   _
26  that    that    SCONJ   IN  _   29  mark    _   _
27  Canada  Canada  PROPN   NNP Number=Sing 29  nsubj   _   _
28  will    will    AUX MD  VerbForm=Fin    29  aux _   _
29  pull    pull    VERB    VB  VerbForm=Inf    21  ccomp   _   _
30  out out ADP IN  _   29  compound:prt    _   _
31  of  of  ADP IN  _   35  case    _   _
32  the the DET DT  Definite=Def|PronType=Art   35  det _   _
33  coalition   coalition   NOUN    NN  Number=Sing 35  compound    _   _
34  bombing bombing NOUN    NN  Number=Sing 35  compound    _   _
35  mission mission NOUN    NN  Number=Sing 29  obl _   _
36  against against ADP IN  _   39  case    _   _
37  the the DET DT  Definite=Def|PronType=Art   39  det _   _
38  Islamic Islamic PROPN   NNP Number=Sing 39  compound    _   _
39  State   State   PROPN   NNP Number=Sing 35  nmod    _   _
40  ,   ,   PUNCT   ,   _   42  punct   _   _
41  but but CCONJ   CC  _   42  cc  _   _
42  maintain    maintain    VERB    VB  VerbForm=Inf    18  conj    _   _
43  humanitarian    humanitarian    ADJ JJ  Degree=Pos  44  amod    _   _
44  aid aid NOUN    NN  Number=Sing 42  obj _   _
45  and and CCONJ   CC  _   46  cc  _   _
46  training    training    NOUN    NN  Number=Sing 44  conj    _   _
47  .   .   PUNCT   .   _   18  punct   _   _
</Parse></Sentence>
JingL1014 commented 6 years ago

The errors are caused by the prepositions that has an 'obl' relation with the verbs. I fixed the errors.

ahalterman commented 6 years ago

Can you add these sentences to the test cases? Once they're in and the test cases are passing, we can close this issue.