Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to define labels with regular expression replacement patterns #476

Open
matentzn opened this issue Sep 7, 2023 · 1 comment

Comments

@matentzn
Copy link

matentzn commented Sep 7, 2023

Right now, we are able to define simple lexical patterns like this:

"% biome" to define classes like "desert biome". Now the interesting thing is that in the case of biomes we define them in terms of "ecosystems", which means that the filler class is called something like "desert ecosystem". Now, we don't want to label our new class "desert ecosystem biome" - that's silly.

What would be good if we had a more flexible way to specify patterns for labels and definitions. For example something like:

text: "% biome"
match: r'(.*) ecosystem (biome)'
replacement: "$1 $2"

This would not be used for inference, just as a postprocessing step after the label is generated. I guess one may want to provide multiple match and replace rules, so his would be more flexible:

text: "% biome"
postprocessing:
  - match: r'(.*) ecosystem (biome)'
     replacement: "$1 $2"

@cmungall sounds a bit too crazy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants