Skip to content

How to transfer custom extension attributes from source entities to merged tokens when using "merge_entities" component? #13235

Discussion options

You must be logged in to vote

Hi!

To back up slightly, I'm trying to understand why you need the "merge token" functionality at all. It's true that the Matcher works on Tokens, as you say. But in my view, that doesn't mean that you need to merge all tokens of one entity into one artificial "token". Would the following setup work instead?

  • Define your entities and their custom data
  • Loop over each entity, and for each token within the entity, set the token attribute according to the entity attribute
  • Apply the matcher, matching on the token attribute
  • Retrieve the hits from the matcher, and for each token that hits, expand to the original entity by finding the entity whose start and end matches the token index

If this wo…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@koernel2
Comment options

@svlandeg
Comment options

@koernel2
Comment options

@svlandeg
Comment options

Answer selected by svlandeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / matcher Feature: Token, phrase and dependency matcher
2 participants