You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Don't create multiple annotations for the same transition
Don't create multiple annotations for the same transition. For example 'cancer cancer' with keyword 'cancer': if an annotation was created for the first 'cancer' occurrence, don't create a new one for the second occurrence.
The rationale was to avoid the creation of two annotations for repeated words when the window is large:
fromiamsystemimportMatchermatcher=Matcher.build(
keywords=["cancer de prostate"],
w=20
)
text="cancer de prostate token token token token prostate"annots=matcher.annot_text(text=text)
forannotinannots:
print(annot)
# cancer de prostate 0 18 cancer de prostate
However, this is not appropriate for all use cases and is not the behavior a user expects; therefore multiple sequences of words that match a keyword should be annotated several times by default.
The text was updated successfully, but these errors were encountered:
It outputs a single annotation although the word 'cancer' is repeated twice. This behavior was explained in a comment in the code:
iamsystem_python/src/iamsystem/matcher/strategy.py
Line 83 in 2b19035
The rationale was to avoid the creation of two annotations for repeated words when the window is large:
However, this is not appropriate for all use cases and is not the behavior a user expects; therefore multiple sequences of words that match a keyword should be annotated several times by default.
The text was updated successfully, but these errors were encountered: