How do I get the enhanced++ dependencies of CoreNLP using the Stanza python wrapper in google colab? - stanford-nlp

Stanza with Basic Dependencies
I need to get the enhanced++ dependencies instead of the above basic dependencies.
I have used the code from here: https://stanfordnlp.github.io/stanza/depparse.html

The Stanza depparse model only produces basic dependencies. However, there is a universal converter using a pipe to a Java process from CoreNLP which may help:
https://stanfordnlp.github.io/stanza/client_regex.html#universal-enhancements
If you have any issues using that, I suggest posting an issue on the stanza github

Related

How do I programmatically install Maven libraries to a cluster using init scripts?

Have been trying for a while now and Im sure the solution is simple enough, just struggling to find it. Im pretty new so be easy on me..!
Its a requirement to do this using a premade init-script, which is then selected in the UI when configuring the cluster.
I am trying to install com.microsoft.azure:azure-eventhubs-spark_2.12:2.3.18 to a cluster on Azure Databricks. Following the documentations example (it is installing a postgresql driver) they produce an init script using the following command:
dbutils.fs.put("/databricks/scripts/postgresql-install.sh","""
#!/bin/bash
wget --quiet -O /mnt/driver-daemon/jars/postgresql-42.2.2.jar https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.2/postgresql-42.2.2.jar""", True)```
My question is, what is the /mnt/driver-daemon/jars/postgresql-42.2.2.jar section of this code? And what would I have to do to make this work for my situation?
Many thanks in advance.
/mnt/driver-daemon/jars/postgresql-42.2.2.jar here is the output path where the jar file will be put. But it makes no sense as this jar won't be put into CLASSPATH and won't be found by Spark. Jars need to be put into /databricks/jars/ directory, where they will be picked up by Spark automatically.
But this method with downloading of jars works only for jars without dependencies, and for libraries like EventHubs connector this is not a case - they won't work if dependencies aren't downloaded as well. Instead it's better to use Cluster UI or Libraries API (or Jobs API for jobs) - with these methods, all dependencies will be fetched as well.
P.S. But really, instead of using EventHubs connector, it's better to use Kafka protocol that is supported by EventHubs as well. There are several reasons for that:
It's better from performance standpoint
It's better from stability standpoint
Kafka connector is included into DBR, so you don't need to install anything extra
You can read how to use Spark + EventHubs + Kafka connector in the EventHubs documentation.

Is there a maven plugin that I can use to generate openapi spec file from JAX-RX source files

I'm trying to generate openapi/swagger spec file during the build time. Maven plugin jaxrs-gen works but it's very old and no longer maintained and creates very old version of swagger spec file which is no longer compatible with the new versions. Please note that openapi-generator-maven-plugin which creates java client end points from spec file works as expected, but I am trying to do the other way round.
I found SmallRye OpenAPI Maven Plugin which works as expected and is aligned to what I needed.

How to enforce complete documentation on Kotlin code

What plugin or tool should I use to enforce complete kdoc documentation on new Kotlin code?
Java code is checked by checkstyle with Sun's rule set, I need a Kotlin's analogue for it.
Look at detekt and its comments rule set. Especially UndocumentedPublicClass, UndocumentedPublicFunction and UndocumentedPublicProperty.
It integrates with Maven via Ant task.

How to generate OpenAPI 3 documentation from protobuf files

I have an API generated from protobuf, and I would like to generate documentation conforming to the OpenAPI 3 spec. I've looked at a number of utilities but I haven't found a combination that works.
Does anyone know of a path from protobuf to OpenAPI 3 that I can follow?
I searched for the answer recently and found this package:
protobuf2swagger
It can be run in CLI with a js config file required. This packaged solved my problem.
Google has a repository on GitHub to do exactly that. It contains examples for OpenAPI v3 (and v2) on how the equivalent protobuf code should look like.
Here is a medium article that explains end to end gRPC + HTTP (using protobuf and swagger respectively) server implementation and documentation, in a step by step fashion. It is an OpenAPI v2 example, but similar concepts apply to OpenAPI v3.
There are other repositories that can do the same, but I would recommend to use the source code that is actually coming from the very source. :)
Hope this helps!
Looks like protoc-gen-openapi app, from gnostic, is what you were looking for. But it seems abandoned and not working.
Have no idea if it works.

Where are the docs for tasks.withType()?

Gradle is a well documented project, but when I search for the docs for tasks.withType(), I only find the API docs.
Isn't this an official part of Gradle?
One of the fundamental concepts in Gradle is that everything is executed against a Project instance. Once you know that, you can work through the javadoc to find what you want. There's a bit of "magic" to be wary of too (a topic for another conversation) and also groovy syntax to understand .
So tasks.withType(...) can be looked up in the javadocs as Project.getTasks().withType(...).
You'll notice that Project.getTasks() returns a TaskCollection (which you found in your googling)
* edit *
There's a mention here in the docs which links to the TaskContainer javadocs
A project is essentially a collection of Task objects. Each task performs some basic piece of work, such as compiling classes, or running unit tests, or zipping up a WAR file. You add tasks to a project using one of the create() methods on TaskContainer, such as TaskContainer.create(java.lang.String). You can locate existing tasks using one of the lookup methods on TaskContainer, such as TaskCollection.getByName(java.lang.String)

Resources