python callback examples

45 views
Skip to first unread message

Fernando Javier Martínez Santiago

unread,
Jun 9, 2021, 2:28:09 AM6/9/21
to Grammatical Framework
Hello all,
I'm starting with using gf callback functions (python bridge), but I can't find examples in order to learn about the best way to use it. Any suggestion/resource will be very welcome, thank you!


Inari Listenmaa

unread,
Jun 16, 2021, 9:54:27 PM6/16/21
to Grammatical Framework
Hi,

Could you be more specific about your use case: instead of "how to use callbacks", explain the real-life problem you want to solve. 

The only mention of callbacks I find is here http://www.grammaticalframework.org/doc/runtime-api.html#python 

The callbacks is a list of functions that can be used for recognizing literals. For example we use those for recognizing names and unknown words in the translator.

For instance, if your use case is recognising unknown words, maybe that is a better cue for other people on this mailing list to step in and tell how they solved that problem in Python. 

Cheers,
Inari

On 9 Jun 2021, at 14:22, Fernando Javier Martínez Santiago <do...@ujaen.es> wrote:

Hello all,
I'm starting with using gf callback functions (python bridge), but I can't find examples in order to learn about the best way to use it. Any suggestion/resource will be very welcome, thank you!



--

---
You received this message because you are subscribed to the Google Groups "Grammatical Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gf-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gf-dev/eb13c822-ccf7-4ff3-ba50-9ab6e434ff6cn%40googlegroups.com.

Fernando Javier Martínez Santiago

unread,
Jun 17, 2021, 1:04:29 AM6/17/21
to Grammatical Framework
Hello Inai.

My interest is twice:
i. I want to catch possible errors when a sentence is parsed and the parsing fails in the middle of the process. In other words, if a partial tree, or trees, is generated I would like to get knowledge about these "partial/s tree/s". 
ii. I want to include some "dynamic" vocabulary. Sometimes the parsing process fails because of  misspelling or because the sentence includes a unknown lexical term. I could  fix such a situation programmatically, sometimes.

Thank you!
Fernando

Reply all
Reply to author
Forward
0 new messages