From user-return-8044-archive-asf-public=cust-asf.ponee.io@uima.apache.org Thu Feb 21 08:30:41 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id F221A18064C for ; Thu, 21 Feb 2019 09:30:40 +0100 (CET) Received: (qmail 96089 invoked by uid 500); 21 Feb 2019 08:30:39 -0000 Mailing-List: contact user-help@uima.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@uima.apache.org Delivered-To: mailing list user@uima.apache.org Received: (qmail 96050 invoked by uid 99); 21 Feb 2019 08:30:39 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2019 08:30:39 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A0C991819C3 for ; Thu, 21 Feb 2019 08:30:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2 X-Spam-Level: ** X-Spam-Status: No, score=2 tagged_above=-999 required=6.31 tests=[DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=mazancourt-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id hUTuYzPoRlMz for ; Thu, 21 Feb 2019 08:30:36 +0000 (UTC) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7CE1E5F295 for ; Thu, 21 Feb 2019 08:30:35 +0000 (UTC) Received: by mail-lj1-f170.google.com with SMTP id f24-v6so23252641ljk.0 for ; Thu, 21 Feb 2019 00:30:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mazancourt-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=KfmWjwqpt4hEjgNFCmuttbt/Zw/sj9Y6lhNJ0/UORJo=; b=MmAmAQEB6nXi+Ybc+EP2O/E8KLzexmvXaEYEPScZz7/vxAj7RQEYggEQSZ7ntMZsgM Uj9t6g+78nJN20QaK7AUQkpiCD+jVHezmDMy0ZYlVW3J6BcwKi6lBsF/GvTXDpprZKK+ CrMi79Ja1hcXxWZOlJ4CJeFANImPgl2QLP4b/aIyddljEPdN+VzIpervHZDwKv/7nTkE uMrSzM7cZt+QzkaaLAJpAnN5K4bJBQlwhxfJcH8zGfypdfDDX/JJHnHS5SI6ARmZoOMt XFgz4ypg1ol9azun+saHYpnZ3Ttqmb+pqivWN1MD9wzuKwbBN/ZJSUD8mSLHmn4bMHfs 9GhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=KfmWjwqpt4hEjgNFCmuttbt/Zw/sj9Y6lhNJ0/UORJo=; b=mWd8WwVv8VgHgoC9cLrGdBIUrhQjlh7U7DB4hFPUOOAvxxfbYwUrCPfKt4PHYkjIYT VM37brw6/AM/NEKwiWbJ2yDUxRyg5jdKN13vWWuDTNqS3wxIi+Hr4j+4UWeucMz/W4PR nvVOsX8rwtBxGh0xJpsuoclLV0RNKLMOHWx3g/zC2tvsC0sUX5xp4nyfOMwdRxazFaxx WeKAwYSNWwNYm9Ffv3yl1ig3wyuQzB+SGuctJHL8cRSrmR/q262yWj/AUD1xw4SwXVup vqdHfPcPYT53Gd0L3bT84MsJGsROTxAkRXuvpe2F192err7LKKwqcVxpsxO3OClcB2nG kK0g== X-Gm-Message-State: AHQUAua/ASYCyE9VUbJa9AGulwurv77uUoaFN5ddw22EJHy+OS39vMwQ srLTXsJJyl5OvdMYdTskj92YW4o31ECUqAv8Y1RkbJos X-Google-Smtp-Source: AHgI3IYg2YQI7p3xL+7mK0BMPKQKEw4BHbOtvklRtytluPDNmeZfsqM7CbuSSgO1qRH2kXYp/3zgwhp9a0h9fgKvnN8= X-Received: by 2002:a2e:92ce:: with SMTP id k14-v6mr23683585ljh.154.1550737828494; Thu, 21 Feb 2019 00:30:28 -0800 (PST) MIME-Version: 1.0 References: <5E5D3C66-068B-498E-B234-844189F25C38@gmail.com> <1550673806.local-8c76d2ef-041b-v1.5.6-4cb1851b@getmailspring.com> In-Reply-To: From: Hugues de Mazancourt Date: Thu, 21 Feb 2019 09:30:17 +0100 Message-ID: Subject: Re: Uima and spring To: user@uima.apache.org Content-Type: multipart/alternative; boundary="000000000000685f850582634927" --000000000000685f850582634927 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Sarah, Good that you found your solution. Regarding the resourecs, I don't think it's a good idea to locally store DKPro resources. If you use maven, the resources are dowloaded by maven; if you don't, DKPro uses an Ivy cache to store the downloaded artifacts. In any case, the resources will be downloaded only once. Best, Hugues Le mer. 20 f=C3=A9vr. 2019 =C3=A0 16:02, Sarah a =C3=A9= crit : > Hi Hugues, > > Actually, I found the main cause of my issue: I had some annotators > wrapped inside of a process method. > However, I got into the optimising business now. I was wondering about > your last question. Thus far, I use the standard DKPro resource managemen= t. > Is there a benefit to storing resources locally and binding them to the > annotators in terms of processing time? You would probably save the time > for downloading and unpacking the resource, right? > > All the best, > Sarah > > > On 20. Feb 2019, at 15:49, Hugues de Mazancourt > wrote: > > > > Hi Sarah, > > > > Sorry it didn't solve your issue. > > Do all resources get reloaded or just specific ones ? > > DKPro's components usually perform a check on the JCas typesystem and > reload the resource if the TS changed. This happen as a prolog in every > call to process(). > > Thus if the components "feels" that the typesystem has changed for some > reason, this will trigger a reload of the corresponding resource. > > Do you use standard DKPro resource management (through language/variant= ) > or use an explicit location for your resource (PARAM_RESOURCE_LOCATION, > ...) ? > > > > Best, > > Hugues de Mazancourt > > > > P: 06.72.78.70.33 (tel:06.72.78.70.33 ) > > W: http://www.mazancourt.com > > > > On f=C3=A9vr. 19 2019, at 3:25 pm, Sarah wrote: > >> Hi all, > >> > >> Thanks for the advice! > >> I have created a JCasPool with - for now - only one JCas instance. I > run my analysis engines on it, use the results, reset the JCas and releas= e > it back into the pool. Then I start the same process on the same JCas. > >> However, the resources still get produced every single time I call > =E2=80=9Cprocess=E2=80=9D on my aggregate engine. I assumed that the reso= urce management > would be taken care of during JCas creation. But that is not the case. > >> > >> Does anyone know where exactly the =E2=80=9Cinitialize=E2=80=9D method= of JCasAnnotator > is called? > >> Sarah > >>> On 18. Feb 2019, at 17:04, Marshall Schor wrote: > >>> Hi Sarah, > >>> I don't have knowledge of DKPro or Spring, but here's some general > guidance, > >>> which may (or may not) be of use :-). > >>> > >>> External Resources are associated with a Resource Manager instance. > >>> Try figuring out how to have one Resource Manager instance be reused > for > >>> multiple JCas instances. > >>> > >>> Also, try to not have multiple JCas instances, beyond what you need t= o > keep all > >>> the cpu "cores" in your host busy. > >>> Instead of one new JCas instance per piece of work, reusing existing > instances, > >>> by calling myJCasInstance.reset() and then using it again. > >>> > >>> Hopefully others with specific knowledge may comment also. > >>> -Marshall > >>> On 2/18/2019 6:48 AM, Sarah wrote: > >>>> Hi, > >>>> > >>>> I am using uimafit annotators in a spring component. These annotator= s > use external resources. These resources are currently produced for every > JCas even though the Aggregate Engine is created inside of the Spring > component's init and merely the process method is called on the individua= l > JCas objects. This slows my system down. > >>>> How do I handle external resources appropriately in a spring > component. I found the SpringContextResourceManager but I don=E2=80=99t k= now how to > use it. Can you point me to an example where e.g. the DKPro CoreNLP > Annotators are used in a spring context? > >>>> > >>>> All the best, > >>>> Sarah > >>> > >> > >> > > > > > > --000000000000685f850582634927--