SceneGraphParser icon indicating copy to clipboard operation
SceneGraphParser copied to clipboard

More failure cases

Open bobwan1995 opened this issue 5 years ago • 2 comments

For the sentence "Blond caucasian male in black t-shirt and denim jeans wearing converse sneakers , sitting on a blue foldable chair , an orange box on his lap ." The results are:

WeChatdae1dce017d922da28eface0550af7e9

It works well in parsing all entities, but fail in finding their relationships. I find it's common when the subject is followed by more than 1 objects, e.g. here black t-shirt, denim jean, converse sneakers and blue foldable chair, but only the first relationship can be detected (in t-shirt). How can I solve this? Thank you!

bobwan1995 avatar May 23 '19 15:05 bobwan1995

Hi, @bobwan1995 , I get the same issue. Did you solve it?

onlyonewater avatar Oct 15 '20 11:10 onlyonewater

Due to 14ed400, this "and" case should work now.

In [4]: sng_parser.tprint(
   ...:     sng_parser.parse(
   ...:         "Blond caucasian male in black t-shirt and denim jeans wearing converse sneakers , sitting on a blue foldable c
   ...: hair."
   ...:     )
   ...: )
Entities:
+-------------+-----------------------+-----------------+
| Head        | Span                  | Modifiers       |
|-------------+-----------------------+-----------------|
| male        | blond caucasian male  | blond,caucasian |
| t shirt     | black t-shirt         | black           |
| denim jeans | denim jeans           |                 |
| sneakers    | converse sneakers     | converse        |
| chair       | a blue foldable chair | a,blue,foldable |
+-------------+-----------------------+-----------------+
Relations:
+-------------+------------+-------------+
| Subject     | Relation   | Object      |
|-------------+------------+-------------|
| male        | in         | t shirt     |
| male        | in         | denim jeans |
| denim jeans | wearing    | sneakers    |
| male        | sitting on | chair       |
+-------------+------------+-------------+

The "orange box" case is tricky.

First, this sentence isn't very grammatically correct. For example, if you change to comma to period, it will work.

In [5]: sng_parser.tprint(
   ...:     sng_parser.parse(
   ...:         "Blond caucasian male in black t-shirt and denim jeans wearing converse sneakers , sitting on a blue foldable c
   ...: hair. an orange box on his lap."
   ...:     )
   ...: )
Entities:
+-------------+-----------------------+-----------------+
| Head        | Span                  | Modifiers       |
|-------------+-----------------------+-----------------|
| male        | blond caucasian male  | blond,caucasian |
| t shirt     | black t-shirt         | black           |
| denim jeans | denim jeans           |                 |
| sneakers    | converse sneakers     | converse        |
| chair       | a blue foldable chair | a,blue,foldable |
| orange box  | an orange box         | an              |
| lap         | his lap               |                 |
+-------------+-----------------------+-----------------+
Relations:
+-------------+------------+-------------+
| Subject     | Relation   | Object      |
|-------------+------------+-------------|
| male        | in         | t shirt     |
| male        | in         | denim jeans |
| denim jeans | wearing    | sneakers    |
| male        | sitting on | chair       |
| orange box  | on         | lap         |
+-------------+------------+-------------+

Second, to fully understand this sentence, we need to do coreference resolution (i.e., his == the male's). This is beyond the scope of this project and I do not foresee a plan for supporting it.

vacancy avatar Mar 01 '22 17:03 vacancy