NLP-CISUC / NLPyPort

MIT License
23 stars 15 forks source link

A little help in a dep extraction rules. #13

Open alvieirajr opened 2 months ago

alvieirajr commented 2 months ago

When i'm try extract to deps from chunk and entities (even from depchunks) from sentence extract "A Lua e o Sol estão muito distantes." i got some entries like this:

(...)
A: Triple [subject=o Sol, predicate=ser, object=A Lua]
[A: o <START:thing> Sol <END> ser A <START:thing> Lua <END>]
A: Triple [subject=A Lua, predicate=ser, object=o Sol]
[A: A <START:thing> Lua <END> ser o <START:thing> Sol <END>]

B: Triple [subject=A Lua e o Sol, predicate=estar, object=muito distantes]
[B: A <START:thing> Lua <END> e o <START:thing> Sol <END> estar muito distantes]

--> [Attention!]  E: Triple [subject=o Sol, predicate=ser, object=A Lua]
[E: o <START:thing> Sol <END> ser A <START:thing> Lua <END>]
E: Triple [subject=estão, predicate=ser, object=muito distantes]
[E: estão ser muito distantes]
--> [Attention!] E: Triple [subject=A Lua, predicate=ser, object=o Sol]
[E: A <START:thing> Lua <END> ser o <START:thing> Sol <END>]

F: Triple [subject=A Lua e o Sol, predicate=estar, object=muito distantes]
[F: A <START:thing> Lua <END> e o <START:thing> Sol <END> estar muito distantes]
(...)

How i adjust the pipeline from NLPPORT to skip (or improve) this rule that tell us that Lua is a subject and "o Sol" an object when we have connections between two entities ("e", cc) + ("Lua", conj) ?

This is right ?

If i will use deps to create a KG to KBQA from a question "O sol é a lua ?" i will be entries like this:

E: Triple [subject=é, predicate=ser, object=a lua]
[E: é ser a lua]
F: Triple [subject=O sol, predicate=ser, object=a lua]
[F: O sol ser a lua]

so, i think will be a problem.

some directions, please.