Can I run stanza NER without downloading the language modules? - stanford-nlp

I need to run stanza ner in a platform without any access to external network. The code stanza.download('en') fails. Running without the download function, gives me an exception
Exception: Resources file not found at: \home\stanza_resources\resources.json. Try to download the model again
Is there a way to download and cache all the required modules in a resource directory and point this directory to stanza pipeline?
Thanks

It looks like both download and the Pipeline class take an argument for directory dir
So the below code works
stanza.download('en', dir='resources/', processors={ner_processor: package})
nlp_pipeline = stanza.Pipeline('en', dir='resources/', processors={ner_processor: package})

Related

Jenkins archive single file not working

I'm trying to archive a zip file in Jenkins using the archiveArtifacts step like this:
archiveArtifacts 'publish\\archive.zip'
But I keep getting this error:
Archiving artifacts
ERROR: No artifacts found that match the file pattern "publish\archive.zip". Configuration error?
ERROR: ‘publish\archive.zip’ doesn’t match anything: ‘publish’ exists but not ‘publish\archive.zip’
The file definitely exists. If a tack an asterisk onto the end of the path like this:
archiveArtifacts 'publish\\archive.zip*'
the step works fine and the file is archived but why is this necessary?
My best guess is that you have non readable char at the end of the filename or elsewhere in your script. I used to get some confusing script errors when writing scripts on windows and putting them on a linux environment. In IntelliJ you can change theese via file->line seperators->unix.

i18n dart library for translation won't run

Hello i run the command
pub run intl:extract_to_arb --output-dir=target/directory
But i take this error message:
Package "intl" is not an immediate dependency.
Cannot run executables in transitive dependencies.
i follow this site https://www.dartdocs.org/documentation/intl/0.11.9/index.html and i use api 1.15.1
There is another way to do that?
Finally i have a solution:
pub run intl:extract_to_arb --output-dir="/Volumes/Case Sensitive Part/Projects/MyProjectFolder/" web/dart/**/*.dart
This generate a file intl_messages.arb (a Json for the translator).
From the translator you can receive some file like this
intl_messages_fr.arb
intl_messages_de.arb
intl_messages_{locale}.arb to generalize.
After this:
pub run intl:generate_from_arb --generated-file-prefix=notneeded web/dart/**/*.dart ./intl_messages_fr.arb ./intl_messages_de.arb ./intl_messages_{locale}.arb
This generate a class dart named: "messages_all.dart" and dart class named "messages_messages_de.dart", "messages_messages_fr.dart", "messages_messages_{locale}.dart".
Only one problem left. I receive some info from last command generate_from_arb:
No ##locale or _locale field found in intl_messages_it, assuming 'messages_it' based on the file name.
No ##locale or _locale field found in intl_messages_de, assuming 'messages_de' based on the file name.
I thing that i should put this tag ##locale (##it) inside the translation arb files.

Deploying custom resource through DSC PullServer fails to extract the module

I've set up a DSC PullServer on Server 2008 R2 and I've run into an issue deploying a custom module. The module on the PullServer is in C:\Program Files\WindowsPowerShell\Modules\NTFSPermission, I've zipped everything using Windows Explorer (and 7-zip) and placed the zip in C:\Program Files\WindowsPowerShell\DscService\Modules\NTFSPermission_1.0.zip, I create a checksum using NEW-DSCChecksum for the zip file and I've got Import-DSCResource NTFSPermission in my node configuration. When I run the Invoke-CimMethod to push the config to a node it errors out with:
Invoke-CimMethod : Failed to extract the module from zip file
C:\Windows\TEMP\\635291179507191263\NTFSPermission_1.0.zip downloaded by Download
Manager WebDownloadManager.
The node logs a 4104 error in the event viewer reading:
This event indicates that failure happens when LCM is trying to get the configuration from pull server using download manager WebDownloadManager. ErrorId is 0x1. ErrorDetail is Failed to extract the module from zip file C:\Windows\TEMP\\635291179507191263\NTFSPermission_1.0.zip downloaded by Download Manager WebDownloadManager.
Has anyone else run into this? I'm not sure if there's a config file somewhere that is literally piping in an extra backslash and causing an invalid download/extraction path or if there is something wrong with the zipped module. If I move the module over manually the config will be pushed and apply successfully, which leads me to believe it's not the module.
There is a known issue with extracting zip files created using .NET compression class in 4.5. The workaround is to use the shell method of compressing files. That is, send to compressed archive option in right-click context menu or using Shell COM object.
I tested one of the modules from the DSC Resource Kit and it extracted with no problems on the desired node. I tracked the problem down to the psd file that the author created for their DSC-Resource. I updated the CLRVersion to require 4.0 and removed RequiredModules, RequiredAssemblies, ScriptsToProcess, TypesToProcess,FormatsToProcess and NestedModules (all were empty values anyway), pushed the config without the workaround and it downloaded and extracted the resource.

Generating Pear file when using ConceptMapper Annotator

I have an UIMA project that uses the ConceptMapper Annotator. I would like to know how to set up the following:
How to specify the TokenizerDescriptionPath?
I have used the macro $main_root/descriptors/conceptMapper/primitive/OffsetTokenizer.xml, but when I was trying to install the pear file, the installer throws exceptions complaining that the file $main_root/descriptors/conceptMapper/primitive/OffsetTokenizer.xml could not be found
How to set up the value for the DictionaryFileName (A file containing the dictionary)?
In the GUI window for setting up this resource, I've filled the URL value with $main_root/data/dict/concepts.xml (my dictionary file) but at the installation time, the installer throws exceptions complaing that
Verification of uima-pipelines failed:
org.apache.uima.resource.ResourceInitializationException: Initialization of annotator class "org.apache.uima.conceptMapper.ConceptMapper" failed.
Caused by: org.apache.uima.resource.ResourceAccessException: The Resource /ConceptDetector/ConceptMapper/DictionaryFile requires parameters, none were specified.
at org.apache.uima.resource.impl.ResourceManager_impl.getResource(ResourceManager_impl.java:221)
at org.apache.uima.impl.UimaContext_ImplBase.getResourceObject(UimaContext_ImplBase.java:295)
at org.apache.uima.analysis_engine.impl.AnnotatorContext_impl.getResourceObject(AnnotatorContext_impl.java:175)
... 33 more
I had similar problems with the Concept Mapper. The way I solved the TokenizerDescriptorPath problem was to first create a PEAR file with the OffsetTokenizer as its main descriptor and the dependent classes. Then you can install this pear file locally and then set TokenizerDescriptorPath to: C:\path\to\your\pear\file\OffsetTokenizer_pear.xml. Otherwise there appears to be a CLASSPATH inheritance problem. The CLASSPATH does not seem to be passed from the ConceptMapper to the OffsetTokenizer once it is in the PEAR file. I found some great information on the GMANE listserver. user.uima.apache.org ConceptMapper Pear File Thread
I have set DictionaryFileName to file:dict/testDict.xml and this seems to work. To avoid getting a problem at save time you can add resources as a source folder.
When exporting the ConceptMapper to a PEAR file, I have both the resources and bin folder in the CLASSPATH. I have since expanded the Concept Mapper to have other annotators and it is working in a pipeline. It is all exportable to PEAR files which pass the verification step. It also works before export, locally in Eclipse.
Good Luck

Perl::WSDL. Generated methods in different directory than script

I am trying to write a script for using with op5/nagios.
What it tries to do is to connect to database an get a value there, and then send a request to a webservice and match the response from the webservice with the value from the database.
Now writing the script wasn't the problem. The problem arrises when trying to run it from OP5.
When including the interface to script I use the following syntax
use MyInterfaces::PortalServicesImplService::PortalServicesImplPort;
This works just fine when I execute the script located on the same level as "MyInterfaces".
The problem is that the script itself is located in the folder /opt/plugins/custom/SOAP where both the script and the folders generated by wsdl2perl.pl is located. However when OP5 executes the script is does so from the folder /opt/monitor.
So I tried to include the "PortalServicesImplPort" using this syntax
use lib "/opt/plugins/custom/SOAP/MyInterfaces/PortalservicesImplServices/PortalServicesImplPort
The code compiles but when trying to run it I get an error message saying
Can't locate object method "new" via package "MyInterfaces::PortalServicesImplService::PortalServicesImplPort" (perhaps you forgot to load "MyInterfaces::PortalServicesImplService::PortalServicesImplPort"?)
Am I doing something wrong when importing methods from another location or doesn't SOAP::WSDL support placing the auto generated files in a different directory from where you are executing the script?
Seems I managed to solve this myself by adding use lib "/opt/plugins/custom/SOAP

Resources