uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Klügl <peter.klu...@averbis.com>
Subject Re: Flattening Annotations?
Date Thu, 18 Apr 2019 21:12:31 GMT
Hi,

I normally use inlined rules as action for those use cases:

NP -> {
  np:NP{-> UNMARK(np)} ANY;
  ANY np:@NP{-> UNMARK(np)};
  };


It is longer, but faster...


Best,

Peter


Am 16.04.2019 um 22:08 schrieb Nikolai Krot:
> Hi all,
>
> Is there a quick way to remove all annotations of specific type if they are
> embedded in a wider annotation of the same type, for example:
>
> <NP> ... <NP> ... <NP>...</NP></NP></NP>
>
> needs to be flattened to just outermost
>
> <NP> ...    ...  ... </NP>
>
> At the moment I am doing it with the following (which seems to work and is
> said to be slow)
>
> NP  { PARTOFNEQ(NP)   -> UNMARK(NP)};
>
> Best regards,
> Nikolai
>
-- 
Dr. Peter Klügl
R&D Text Mining/Machine Learning

Averbis GmbH
Salzstr. 15
79098 Freiburg
Germany

Fon: +49 761 708 394 0
Fax: +49 761 708 394 10
Email: peter.kluegl@averbis.com
Web: https://averbis.com

Headquarters: Freiburg im Breisgau
Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó


Mime
View raw message