-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hello developers,
While using PyTrips, I have found time and time again that functionality of PyTrips is overly reliant on strings, as it appears that the prefix q::, wn::, ont::, etc., are all required to obtain appropriate functionality. This has been a significant source of frustration for me, and I'd like to provide an example as to why and how I would hope the API that PyTrips provides can be dramatically improved.
In my final project for Natural Language Processing, I have an AMR parse of the following sentence...
Sentence: Hallmark could make a fortune off of this guy.
This produces an AMR parse that looks like the following...
(p / possible
:domain (m / make-05
:ARG0 (c / company :name (n / name :op1 "Hallmark"))
:ARG1 (f / fortune
:source (g / guy
:mod (t / this)))))
While I have been mostly successful by using TRIPS' lexicon (get_word) to obtain the possible ontological mappings for all but fortune, which produces what I believe to be a nonsensical ontological type: ont::cookies. It is honestly so far out of left-field that it causes me to reconsider how to proceed with parsing this given that it is so far from what it is supposed to do that I can't, say, choose based on what is more likely given the only provided candidate is clearly wrong. Here, I have tried to obtain the wordnet mapping (get_wordnet), but it produces an empty list. The definition (get_definition) throws an exception, and lookup requires a pos.
Now after spending more time than I should have, I eventually found that I can obtain the wordnet mappings, but only by invoking make_query('q::fortune') which returns a dictionary of exactly what I want to see...
{'lex': [ont::cookies],
'wn': [ont::assets, ont::luckiness-scale, ont::situation]}
My issue is: Why doesn't get_wordnet return this? I am working with strings, yes, but I feel as if I shouldn't have to prepend a q:: to each query, and that instead there should be explicit functions and/or methods that can produce the same results. I.E, if get_wordnet produced the [ont::assets, ont::luckiness-scale, ont::situation], I would be satisfied enough. I am not certain what it does right now. Also lookup requires a pos, in which I cannot find documentation as to what it actually means or expects.
I am requesting that PyTrips provides some kind of enhanced API that can appropriately obtain this type of information without relying on string manipulation.