dair-iitd / OpenIE-standalone

Other
565 stars 73 forks source link

sometimes get wrong offsets #53

Open WangQiqing opened 3 years ago

WangQiqing commented 3 years ago

I used the ptyhon wrapper with the API from the Open IE 5.1.0 server, it works well on most sentences, but except for this one that gets wrong or empty offsets for the extracted args. I don't know whether the exception is caused by sentence structure or other problems.

>>> from pyopenie import OpenIE5
>>> extractor = OpenIE5('http://localhost:8000')
>>> extractions = extractor.extract("The fire burned 3400 hectares and caused millions of dollars of damage, killed livestock and burned out property.")
>>> extractions
[{'confidence': 0.9030401971054747,
  'sentence': 'The fire burned 3400 hectares and caused millions of dollars of damage, killed livestock and burned out property.',
  'extraction': {'arg1': {'text': 'The fire',
    'offsets': [[0, 1, 2, 3, 4, 5, 6, 7]]},
   'rel': {'text': 'killed', 'offsets': [[9, 10, 11, 12, 13, 14]]},
   'arg2s': [{'text': 'livestock',
     'offsets': [[16, 17, 18, 19, 20, 21, 22, 23, 24]]}],
   'context': None,
   'negated': False,
   'passive': False}},
 {'confidence': 0.9030401971054747,
  'sentence': 'The fire burned 3400 hectares and caused millions of dollars of damage, killed livestock and burned out property.',
  'extraction': {'arg1': {'text': 'The fire',
    'offsets': [[0, 1, 2, 3, 4, 5, 6, 7]]},
   'rel': {'text': 'caused', 'offsets': [[9, 10, 11, 12, 13, 14]]},
   'arg2s': [{'text': 'millions of dollars of damage',
     'offsets': [[16,
       17,
       18,
       19,
       20,
       21,
       22,
       23,
       24,
       25,
       26,
       27,
       28,
       29,
       30,
       31,
       32,
       33,
       34,
       35,
       36,
       37,
       38,
       39,
       40,
       41,
       42,
       43,
       44]]}],
   'context': None,
   'negated': False,
   'passive': False}},
 {'confidence': 0.9990000128746033,
  'sentence': 'The fire burned 3400 hectares and caused millions of dollars of damage, killed livestock and burned out property.',
  'extraction': {'arg1': {'text': 'The fire', 'offsets': [[]]},
   'rel': {'text': 'burned', 'offsets': [[]]},
   'arg2s': [{'text': '3400 hectares', 'offsets': [None]}],
   'context': None,
   'negated': False,
   'passive': False}}]
GillesJ commented 3 years ago

Same issue here, it happens seemingly on sentences with coordinations.